Bugzilla – Attachment 1012 Details for
Bug 1107
Honouring securetty file in HP-UX with UseLogin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to honour securetty file in HP-UX
Securettyfile.patch (text/plain), 1.44 KB, created by
senthilkumar
on 2005-10-26 16:27:37 AEST
(
hide
)
Description:
Patch to honour securetty file in HP-UX
Filename:
MIME Type:
Creator:
senthilkumar
Created:
2005-10-26 16:27:37 AEST
Size:
1.44 KB
patch
obsolete
>--- session.c 2005-08-25 17:01:54.000000000 +0530 >+++ session.c-securetty 2005-10-25 19:33:52.000000000 +0530 >@@ -1566,6 +1566,38 @@ > close(i); > } > >+int >+check_securetty(char *namebuf) >+{ >+ >+ FILE *f; >+ char buf[1024]; >+ struct stat sb; >+ >+ namebuf += (sizeof("/dev/")-1); >+ if ((f = fopen("/etc/securetty", "r")) == NULL) >+ return(1); >+ >+ if (fstat(fileno(f), &sb) == -1) >+ fatal("fstat securetty file: %s", strerror(errno)); >+ if (sb.st_uid != 0 || (sb.st_mode & 077) != 0) { >+ logit("Bad owner or permissions on securetty file"); >+ return(1); >+ } >+ >+ while (fgets(buf, sizeof buf, f) != NULL) { >+ buf[strlen(buf)-1] = '\0'; >+ if (strcmp(namebuf, buf) == 0) { >+ fclose(f); >+ return(1); >+ } >+ } >+ fclose(f); >+ execl(LOGIN_PROGRAM, "login", "-h", (char *)NULL); >+ >+} >+ >+ > /* > * Performs common processing for the child, such as setting up the > * environment, closing extra file descriptors, setting the user and group >@@ -1710,6 +1742,7 @@ > signal(SIGPIPE, SIG_DFL); > > if (options.use_login) { >+ if (s->pw->pw_uid == 0 && check_securetty(s->tty)) > launch_login(pw, hostname); > /* NEVERREACHED */ > } >
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 1107
: 1012