* src/userdel.c: Re-indent.

* src/userdel.c: Added brackets.
	* src/userdel.c: Avoid implicit conversion of pointers to
	booleans.
This commit is contained in:
nekral-guest 2010-03-11 22:04:06 +00:00
parent 69798dde65
commit 33d3e28a7f
2 changed files with 19 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2010-03-11 Nicolas François <nicolas.francois@centraliens.net>
* src/userdel.c: Re-indent.
* src/userdel.c: Added brackets.
* src/userdel.c: Avoid implicit conversion of pointers to
booleans.
2010-03-11 Nicolas François <nicolas.francois@centraliens.net> 2010-03-11 Nicolas François <nicolas.francois@centraliens.net>
* lib/shadowio.c: Re-indent. * lib/shadowio.c: Re-indent.

View File

@ -745,8 +745,9 @@ static int remove_tcbdir (const char *user_name, uid_t user_id)
int ret = 0; int ret = 0;
size_t bufsize = (sizeof TCB_DIR) + strlen (user_name) + 2; size_t bufsize = (sizeof TCB_DIR) + strlen (user_name) + 2;
if (!getdef_bool ("USE_TCB")) if (!getdef_bool ("USE_TCB")) {
return 0; return 0;
}
buf = malloc (buflen); buf = malloc (buflen);
if (NULL == buf) { if (NULL == buf) {
@ -756,7 +757,7 @@ static int remove_tcbdir (const char *user_name, uid_t user_id)
return 1; return 1;
} }
snprintf (buf, buflen, TCB_DIR "/%s", user_name); snprintf (buf, buflen, TCB_DIR "/%s", user_name);
if (!shadowtcb_drop_priv ()) { if (shadowtcb_drop_priv () == 0) {
perror ("shadowtcb_drop_priv"); perror ("shadowtcb_drop_priv");
free (buf); free (buf);
return 1; return 1;
@ -764,7 +765,7 @@ static int remove_tcbdir (const char *user_name, uid_t user_id)
/* Only remove directory contents with dropped privileges. /* Only remove directory contents with dropped privileges.
* We will regain them and remove the user's tcb directory afterwards. * We will regain them and remove the user's tcb directory afterwards.
*/ */
if (remove_tree (buf, false)) { if (remove_tree (buf, false) != 0) {
perror ("remove_tree"); perror ("remove_tree");
shadowtcb_gain_priv (); shadowtcb_gain_priv ();
free (buf); free (buf);
@ -772,7 +773,7 @@ static int remove_tcbdir (const char *user_name, uid_t user_id)
} }
shadowtcb_gain_priv (); shadowtcb_gain_priv ();
free (buf); free (buf);
if (!shadowtcb_remove (user_name)) { if (shadowtcb_remove (user_name) == 0) {
fprintf (stderr, "Cannot remove tcb files for %s: %s\n", fprintf (stderr, "Cannot remove tcb files for %s: %s\n",
user_name, strerror (errno)); user_name, strerror (errno));
ret = 1; ret = 1;
@ -902,8 +903,9 @@ int main (int argc, char **argv)
user_home = xstrdup (pwd->pw_dir); user_home = xstrdup (pwd->pw_dir);
} }
#ifdef WITH_TCB #ifdef WITH_TCB
if (!shadowtcb_set_user (user_name)) if (shadowtcb_set_user (user_name) == 0) {
exit (E_NOTFOUND); exit (E_NOTFOUND);
}
#endif /* WITH_TCB */ #endif /* WITH_TCB */
#ifdef USE_NIS #ifdef USE_NIS