* libmisc/xgetXXbyYY.c, libmisc/myname.c, libmisc/getgr_nam_gid.c,

libmisc/salt.c, libmisc/list.c, libmisc/cleanup.c, src/login.c,
	lib/getdef.h, lib/groupio.c, lib/getlong.c, lib/gshadow_.h,
	lib/sgroupio.c, lib/shadowio.c, lib/pwio.c, lib/commonio.h,
	lib/fputsx.c, lib/prototypes.h: Added splint annotations.
	* lib/groupio.c: Avoid implicit conversion of pointers to
	booleans.
	* lib/groupio.c: Free allocated buffers in case of failure.
This commit is contained in:
nekral-guest
2009-04-23 09:57:03 +00:00
parent fef6f9379a
commit 614c79defc
16 changed files with 80 additions and 64 deletions

View File

@@ -123,11 +123,11 @@ extern char **environ;
static void usage (void);
static void setup_tty (void);
static void process_flags (int argc, char *const *argv);
static const char *get_failent_user (/*@returned@*/const char *user);
static /*@observer@*/const char *get_failent_user (/*@returned@*/const char *user);
static void update_utmp (const char *username,
const char *tty,
const char *hostname,
const struct utmp *utent);
/*@null@*/const struct utmp *utent);
#ifndef USE_PAM
static struct faillog faillog;
@@ -194,13 +194,13 @@ static void setup_tty (void)
/* Make sure the values were valid.
* getdef_num cannot validate this.
*/
if (erasechar != termio.c_cc[VERASE]) {
if (erasechar != (int) termio.c_cc[VERASE]) {
fprintf (stderr,
_("configuration error - cannot parse %s value: '%d'"),
"ERASECHAR", erasechar);
exit (1);
}
if (killchar != termio.c_cc[VKILL]) {
if (killchar != (int) termio.c_cc[VKILL]) {
fprintf (stderr,
_("configuration error - cannot parse %s value: '%d'"),
"KILLCHAR", killchar);
@@ -454,7 +454,7 @@ static void get_pam_user (char **ptr_pam_user)
* It is quite common to mistyped the password for username, and passwords
* should not be logged.
*/
static const char *get_failent_user (/*@returned@*/const char *user)
static /*@observer@*/const char *get_failent_user (/*@returned@*/const char *user)
{
const char *failent_user = "UNKNOWN";
bool log_unkfail_enab = getdef_bool("LOG_UNKFAIL_ENAB");
@@ -1000,7 +1000,7 @@ int main (int argc, char **argv)
failed = true;
}
if ( !failed
&& !login_access (username, *hostname ? hostname : tty)) {
&& !login_access (username, ('\0' != *hostname) ? hostname : tty)) {
SYSLOG ((LOG_WARN, "LOGIN '%s' REFUSED %s",
username, fromhost));
failed = true;