(start_login): put utmpx code into a new scope to avoid pre c99 problems.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15196 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1295,28 +1295,30 @@ start_login(const char *host, int autologin, char *name)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX_H
|
#ifdef HAVE_UTMPX_H
|
||||||
int pid = getpid();
|
{
|
||||||
struct utmpx utmpx;
|
int pid = getpid();
|
||||||
char *clean_tty;
|
struct utmpx utmpx;
|
||||||
|
char *clean_tty;
|
||||||
/*
|
|
||||||
* Create utmp entry for child
|
|
||||||
*/
|
|
||||||
|
|
||||||
clean_tty = clean_ttyname(line);
|
|
||||||
memset(&utmpx, 0, sizeof(utmpx));
|
|
||||||
strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user));
|
|
||||||
strncpy(utmpx.ut_line, clean_tty, sizeof(utmpx.ut_line));
|
|
||||||
#ifdef HAVE_STRUCT_UTMP_UT_ID
|
|
||||||
strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id));
|
|
||||||
#endif
|
|
||||||
utmpx.ut_pid = pid;
|
|
||||||
|
|
||||||
utmpx.ut_type = LOGIN_PROCESS;
|
/*
|
||||||
|
* Create utmp entry for child
|
||||||
gettimeofday (&utmpx.ut_tv, NULL);
|
*/
|
||||||
if (pututxline(&utmpx) == NULL)
|
|
||||||
fatal(net, "pututxline failed");
|
clean_tty = clean_ttyname(line);
|
||||||
|
memset(&utmpx, 0, sizeof(utmpx));
|
||||||
|
strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user));
|
||||||
|
strncpy(utmpx.ut_line, clean_tty, sizeof(utmpx.ut_line));
|
||||||
|
#ifdef HAVE_STRUCT_UTMP_UT_ID
|
||||||
|
strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id));
|
||||||
|
#endif
|
||||||
|
utmpx.ut_pid = pid;
|
||||||
|
|
||||||
|
utmpx.ut_type = LOGIN_PROCESS;
|
||||||
|
|
||||||
|
gettimeofday (&utmpx.ut_tv, NULL);
|
||||||
|
if (pututxline(&utmpx) == NULL)
|
||||||
|
fatal(net, "pututxline failed");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
scrub_env();
|
scrub_env();
|
||||||
|
Reference in New Issue
Block a user