* 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:
nekral-guest
2010-08-22 12:49:07 +00:00
parent 7e398a169b
commit 471a2df3a6
10 changed files with 222 additions and 175 deletions

View File

@ -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);
}