Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 578786 Details for
Bug 814427
Unexpected /sbin/securetty failure with read-only root file system
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
lightly tested patch
diff (text/plain), 1.65 KB, created by
Bill Nottingham
on 2012-04-19 21:05:17 UTC
(
hide
)
Description:
lightly tested patch
Filename:
MIME Type:
Creator:
Bill Nottingham
Created:
2012-04-19 21:05:17 UTC
Size:
1.65 KB
patch
obsolete
>diff --git a/src/securetty.c b/src/securetty.c >index 9ec8e7e..5fd1759 100644 >--- a/src/securetty.c >+++ b/src/securetty.c >@@ -18,6 +18,7 @@ > > #include <errno.h> > #include <fcntl.h> >+#include <limits.h> > #include <signal.h> > #include <stdio.h> > #include <stdlib.h> >@@ -25,6 +26,7 @@ > #include <syslog.h> > #include <unistd.h> > >+#include <sys/mman.h> > #include <sys/types.h> > #include <sys/stat.h> > >@@ -101,11 +103,45 @@ out_ok: > return 0; > } > >+int check_securetty(char *terminal) { >+ int fd, rc = 1; >+ char *buf, term[PATH_MAX]; >+ struct stat sb; >+ >+ fd = open("/etc/securetty", O_RDONLY); >+ if (fd == -1) >+ goto out; >+ fstat(fd, &sb); >+ buf = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); >+ if (buf == ((caddr_t) -1)) { >+ close(fd); >+ return 1; >+ } >+ snprintf(term,PATH_MAX,"%s\n",terminal); >+ if (!strncmp(buf,term,strlen(term))) { >+ rc = 0; >+ goto out_unmap; >+ } >+ snprintf(term,PATH_MAX,"\n%s\n",terminal); >+ if (strstr(buf,term)) { >+ rc = 0; >+ goto out_unmap; >+ } >+out_unmap: >+ munmap(buf, sb.st_size); >+out: >+ close(fd); >+ return rc; >+} >+ > int main(int argc, char **argv) { > if (argc < 2 ) { > fprintf(stderr, "Usage: securetty <device>\n"); > exit(1); > } > openlog("securetty", LOG_CONS, LOG_DAEMON); >- return rewrite_securetty(argv[1]); >+ if (check_securetty(argv[1])) >+ return rewrite_securetty(argv[1]); >+ else >+ return 0; > }
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 814427
:
578786
|
578789