* src/login.c: Replace HAVE_UTMPX_H by USE_UTMPX.
* src/login.c: Avoid name clash between global variables and the update_utmp() arguments.
This commit is contained in:
parent
69307a1f2b
commit
8112a12521
@ -1,3 +1,9 @@
|
|||||||
|
2009-04-27 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/login.c: Replace HAVE_UTMPX_H by USE_UTMPX.
|
||||||
|
* src/login.c: Avoid name clash between global variables and the
|
||||||
|
update_utmp() arguments.
|
||||||
|
|
||||||
2009-04-27 Nicolas François <nicolas.francois@centraliens.net>
|
2009-04-27 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/groupadd.c, lib/commonio.c, lib/groupio.c: Added missing
|
* src/groupadd.c, lib/commonio.c, lib/groupio.c: Added missing
|
||||||
|
26
src/login.c
26
src/login.c
@ -124,9 +124,9 @@ static void usage (void);
|
|||||||
static void setup_tty (void);
|
static void setup_tty (void);
|
||||||
static void process_flags (int argc, char *const *argv);
|
static void process_flags (int argc, char *const *argv);
|
||||||
static /*@observer@*/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,
|
static void update_utmp (const char *user,
|
||||||
const char *tty,
|
const char *tty,
|
||||||
const char *hostname,
|
const char *host,
|
||||||
/*@null@*/const struct utmp *utent);
|
/*@null@*/const struct utmp *utent);
|
||||||
|
|
||||||
#ifndef USE_PAM
|
#ifndef USE_PAM
|
||||||
@ -476,23 +476,23 @@ static /*@observer@*/const char *get_failent_user (/*@returned@*/const char *use
|
|||||||
* utent should be the utmp entry returned by get_current_utmp (or
|
* utent should be the utmp entry returned by get_current_utmp (or
|
||||||
* NULL).
|
* NULL).
|
||||||
*/
|
*/
|
||||||
static void update_utmp (const char *username,
|
static void update_utmp (const char *user,
|
||||||
const char *tty,
|
const char *tty,
|
||||||
const char *hostname,
|
const char *host,
|
||||||
/*@null@*/const struct utmp *utent)
|
/*@null@*/const struct utmp *utent)
|
||||||
{
|
{
|
||||||
struct utmp *ut = prepare_utmp (username, tty, hostname, utent);
|
struct utmp *ut = prepare_utmp (user, tty, host, utent);
|
||||||
#ifdef HAVE_UTMPX_H
|
#ifdef USE_UTMPX
|
||||||
struct utmpx *utx = prepare_utmpx (username, tty, hostname, utent);
|
struct utmpx *utx = prepare_utmpx (user, tty, host, utent);
|
||||||
#endif /* HAVE_UTMPX_H */
|
#endif /* USE_UTMPX */
|
||||||
|
|
||||||
(void) setutmp (ut); /* make entry in the utmp & wtmp files */
|
(void) setutmp (ut); /* make entry in the utmp & wtmp files */
|
||||||
free (ut);
|
free (ut);
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX_H
|
#ifdef USE_UTMPX
|
||||||
(void) setutmpx (utx); /* make entry in the utmpx & wtmpx files */
|
(void) setutmpx (utx); /* make entry in the utmpx & wtmpx files */
|
||||||
free (utx);
|
free (utx);
|
||||||
#endif /* HAVE_UTMPX_H */
|
#endif /* USE_UTMPX */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1022,19 +1022,19 @@ int main (int argc, char **argv)
|
|||||||
failure (pwd->pw_uid, tty, &faillog);
|
failure (pwd->pw_uid, tty, &faillog);
|
||||||
}
|
}
|
||||||
if (getdef_str ("FTMP_FILE") != NULL) {
|
if (getdef_str ("FTMP_FILE") != NULL) {
|
||||||
#ifdef HAVE_UTMPX_H
|
#ifdef USE_UTMPX
|
||||||
struct utmpx *failent =
|
struct utmpx *failent =
|
||||||
prepare_utmpx (failent_user,
|
prepare_utmpx (failent_user,
|
||||||
tty,
|
tty,
|
||||||
/* FIXME: or fromhost? */hostname,
|
/* FIXME: or fromhost? */hostname,
|
||||||
utent);
|
utent);
|
||||||
#else
|
#else /* !USE_UTMPX */
|
||||||
struct utmp *failent =
|
struct utmp *failent =
|
||||||
prepare_utmp (failent_user,
|
prepare_utmp (failent_user,
|
||||||
tty,
|
tty,
|
||||||
hostname,
|
hostname,
|
||||||
utent);
|
utent);
|
||||||
#endif
|
#endif /* !USE_UTMPX */
|
||||||
failtmp (failent_user, failent);
|
failtmp (failent_user, failent);
|
||||||
free (failent);
|
free (failent);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user