Remove tty-prefix from ut_id; this field is usually very short.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@565 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -12,6 +12,7 @@ void utmp_login(char *tty, char *username, char *hostname)
|
|||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
char *ttyx; /* tty w/o /dev/* */
|
char *ttyx; /* tty w/o /dev/* */
|
||||||
|
char *id;
|
||||||
|
|
||||||
ttyx = tty;
|
ttyx = tty;
|
||||||
|
|
||||||
@@ -49,7 +50,10 @@ void utmp_login(char *tty, char *username, char *hostname)
|
|||||||
|
|
||||||
# ifdef HAVE_UT_ID
|
# ifdef HAVE_UT_ID
|
||||||
/* any particular reason to not include "tty" ? */
|
/* any particular reason to not include "tty" ? */
|
||||||
strncpy(utmp.ut_id, ttyx, sizeof(utmp.ut_id));
|
id = ttyx;
|
||||||
|
if(strncmp(ttyx, "tty", 3) == 0)
|
||||||
|
id += 3;
|
||||||
|
strncpy(utmp.ut_id, id, sizeof(utmp.ut_id));
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user