* src/login.c: Added splint annotations.

This commit is contained in:
nekral-guest 2009-04-22 20:53:15 +00:00
parent 2a32262725
commit 54302f6006
2 changed files with 6 additions and 5 deletions

View File

@ -2,6 +2,7 @@
* src/login.c: Added assert()s for NULL (or ! NULL) username, and * src/login.c: Added assert()s for NULL (or ! NULL) username, and
pwd. This helps splint. pwd. This helps splint.
* src/login.c: Added splint annotations.
2009-04-22 Nicolas François <nicolas.francois@centraliens.net> 2009-04-22 Nicolas François <nicolas.francois@centraliens.net>

View File

@ -83,7 +83,7 @@ static pam_handle_t *pamh = NULL;
char *Prog; char *Prog;
static const char *hostname = ""; static const char *hostname = "";
static char *username = NULL; static /*@null@*/ /*@only@*/char *username = NULL;
static int reason = PW_LOGIN; static int reason = PW_LOGIN;
#ifndef USE_PAM #ifndef USE_PAM
@ -122,8 +122,8 @@ extern char **environ;
/* local function prototypes */ /* local function prototypes */
static void usage (void); static void usage (void);
static void setup_tty (void); static void setup_tty (void);
static void process_flags (int, char *const *); static void process_flags (int argc, char *const *argv);
static const char *get_failent_user (const char *user); static const char *get_failent_user (/*@returned@*/const char *user);
static void update_utmp (const char *username, static void update_utmp (const char *username,
const char *tty, const char *tty,
const char *hostname, const char *hostname,
@ -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 * It is quite common to mistyped the password for username, and passwords
* should not be logged. * should not be logged.
*/ */
static const char *get_failent_user (const char *user) static const char *get_failent_user (/*@returned@*/const char *user)
{ {
const char *failent_user = "UNKNOWN"; const char *failent_user = "UNKNOWN";
bool log_unkfail_enab = getdef_bool("LOG_UNKFAIL_ENAB"); bool log_unkfail_enab = getdef_bool("LOG_UNKFAIL_ENAB");
@ -537,7 +537,7 @@ int main (int argc, char **argv)
struct passwd *pwd = NULL; struct passwd *pwd = NULL;
char **envp = environ; char **envp = environ;
const char *failent_user; const char *failent_user;
struct utmp *utent; /*@null@*/struct utmp *utent;
#ifdef USE_PAM #ifdef USE_PAM
int retcode; int retcode;