ALT Linux Bugzilla
– Attachment 341 Details for
Bug 3580
su command breaks utmp
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
SimplePAMApps-0.60-owl-login-su-ut_id-undo.patch
SimplePAMApps-0.60-owl-login-su-ut_id-undo.patch (text/plain), 1.33 KB, created by
Dmitry V. Levin
on 2004-02-04 18:43:03 MSK
(
hide
)
Description:
SimplePAMApps-0.60-owl-login-su-ut_id-undo.patch
Filename:
MIME Type:
Creator:
Dmitry V. Levin
Created:
2004-02-04 18:43:03 MSK
Size:
1.33 KB
patch
obsolete
>diff -u SimplePAMApps-0.60/common/lib/wtmp.c SimplePAMApps-0.60/common/lib/wtmp.c >--- SimplePAMApps-0.60/common/lib/wtmp.c Fri Mar 1 23:14:57 2002 >+++ SimplePAMApps-0.60/common/lib/wtmp.c Fri Mar 1 23:14:57 2002 >@@ -3,6 +3,9 @@ > */ > > #define RHOST_UNKNOWN_NAME "" /* perhaps "[from.where?]" */ >+ >+#define DEVICE_FILE_PREFIX "/dev/" >+ > #define WTMP_LOCK_TIMEOUT 3 /* in seconds */ > > #include <fcntl.h> >@@ -47,6 +50,7 @@ > while ((u_tmp_p = getutent()) != NULL) > if ((u_tmp_p->ut_type == INIT_PROCESS || > u_tmp_p->ut_type == LOGIN_PROCESS || >+ u_tmp_p->ut_type == DEAD_PROCESS || > u_tmp_p->ut_type == USER_PROCESS) && > !strncmp(u_tmp_p->ut_line, ut_line, UT_LINESIZE)) { > if (!strncmp(u_tmp_p->ut_id, ut_id, UT_IDSIZE)) >@@ -81,18 +85,13 @@ > if ( *terminal == '/' ) { /* now deal with filenames */ > int o1, o2; > >- o1 = strncmp("/dev/", terminal, 5) ? 0 : 5; >+ o1 = strncmp(DEVICE_FILE_PREFIX, terminal, 5) ? 0 : 5; > if (!strncmp("/dev/tty", terminal, 8)) { > o2 = 8; > } else { >- if (!strncmp("/dev/pts/", terminal, 9)) >- o1 = 8; /* include the slash */ >- o2 = strlen(terminal + o1) - UT_IDSIZE; >+ o2 = strlen(terminal) - sizeof(UT_IDSIZE); > if (o2 < 0) > o2 = 0; >- o2 += o1; >- if (o1 > 5) >- o1 = 5; > } > > strncpy(ut_line, terminal + o1, UT_LINESIZE);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 3580
:
341
|
342