Bugzilla – Attachment 1448 Details for
Bug 1433
sshd.pid has permissions of 666
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
set umask for PidFile
openssh-pidfile-perm.patch (text/plain), 832 bytes, created by
Darren Tucker
on 2008-01-28 16:24:37 AEDT
(
hide
)
Description:
set umask for PidFile
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2008-01-28 16:24:37 AEDT
Size:
832 bytes
patch
obsolete
>Index: sshd.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh/sshd.c,v >retrieving revision 1.367 >diff -u -p -r1.367 sshd.c >--- sshd.c 19 Jan 2008 21:56:00 -0000 1.367 >+++ sshd.c 28 Jan 2008 05:10:47 -0000 >@@ -1625,15 +1625,17 @@ main(int ac, char **av) > * is setup and the listen sockets are bound > */ > if (!debug_flag) { >- FILE *f = fopen(options.pid_file, "w"); >+ FILE *f; >+ mode_t old_mask = umask(0022); > >- if (f == NULL) { >+ if ((f = fopen(options.pid_file, "w")) == NULL) { > error("Couldn't create pid file \"%s\": %s", > options.pid_file, strerror(errno)); > } else { > fprintf(f, "%ld\n", (long) getpid()); > fclose(f); > } >+ umask(old_mask); > } > > /* Accept a connection and return in a forked child */
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 1433
:
1448
|
1449
|
1522