* libmisc/obscure.c, lib/prototypes.h (obscure): Return a bool
instead of an int. * libmisc/obscure.c, libmisc/tz.c, src/passwd.c, lib/encrypt.c, libmisc/copydir.c, lib/prototypes.h: Add splint annotations. * libmisc/tz.c: Fix some const issues. * libmisc/tz.c: Avoid multi-statements lines. * libmisc/tz.c: Add brackets. * libmisc/copydir.c: Do not check *printf/*puts return value. * libmisc/copydir.c: Fail if we cannot set or reset the SELinux fscreate context. * libmisc/copydir.c: Use xmalloc instead of malloc. * libmisc/copydir.c: Do not check lutimes return value * src/vipw.c: Avoid implicit conversion of integer to boolean. * src/su.c (iswheel): Return a bool instead of an int. * src/passwd.c: Remove insert_crypt_passwd(). Use xstrdup instead. * src/passwd.c: Return constant strings when sufficient. * src/passwd.c: Do not check *printf/*puts return value. * src/passwd.c: Avoid implicit conversion of character to boolean. * src/passwd.c: Do not check sleep return value. * src/sulogin.c: Do not check *printf/*puts return value. * lib/encrypt.c: Do not check fprintf return value.
This commit is contained in:
6
src/su.c
6
src/su.c
@ -112,7 +112,7 @@ static void execve_shell (const char *shellstr,
|
||||
static RETSIGTYPE kill_child (int unused(s));
|
||||
#else /* !USE_PAM */
|
||||
static RETSIGTYPE die (int);
|
||||
static int iswheel (const char *);
|
||||
static bool iswheel (const char *);
|
||||
#endif /* !USE_PAM */
|
||||
|
||||
#ifndef USE_PAM
|
||||
@ -138,14 +138,14 @@ static RETSIGTYPE die (int killed)
|
||||
}
|
||||
}
|
||||
|
||||
static int iswheel (const char *username)
|
||||
static bool iswheel (const char *username)
|
||||
{
|
||||
struct group *grp;
|
||||
|
||||
grp = getgrnam ("wheel"); /* !USE_PAM, no need for xgetgrnam */
|
||||
if ( (NULL ==grp)
|
||||
|| (NULL == grp->gr_mem)) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
return is_on_list (grp->gr_mem, username);
|
||||
}
|
||||
|
Reference in New Issue
Block a user