Bugzilla – Attachment 339 Details for
Bug 606
sshd [-t] should warn when cannot create pid file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Use realpath to test existence of PidFile directory
openbsd-pidfile_test.patch (text/plain), 1.09 KB, created by
Darren Tucker
on 2003-06-28 00:11:56 AEST
(
hide
)
Description:
Use realpath to test existence of PidFile directory
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2003-06-28 00:11:56 AEST
Size:
1.09 KB
patch
obsolete
>Index: sshd.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sshd.c,v >retrieving revision 1.269 >diff -u -r1.269 sshd.c >--- sshd.c 2003/06/24 08:23:46 1.269 >+++ sshd.c 2003/06/27 14:08:33 >@@ -794,7 +794,7 @@ > int remote_port; > FILE *f; > struct addrinfo *ai; >- char ntop[NI_MAXHOST], strport[NI_MAXSERV]; >+ char ntop[NI_MAXHOST], strport[NI_MAXSERV], *path; > int listen_sock, maxfd; > int startup_p[2]; > int startups = 0; >@@ -1020,6 +1020,13 @@ > "world-writable.", _PATH_PRIVSEP_CHROOT_DIR); > } > >+ /* Check if PidFile a valid path */ >+ path = xmalloc(MAXPATHLEN); >+ if (realpath(options.pid_file, path) == NULL) >+ error("Invalid PidFile specification: %s (%s)", >+ options.pid_file, strerror(errno)); >+ xfree(path); >+ > /* Configuration looks good, so exit if in test mode. */ > if (test_flag) > exit(0); >@@ -1164,7 +1171,9 @@ > if (f) { > fprintf(f, "%ld\n", (long) getpid()); > fclose(f); >- } >+ } else >+ error("Failed to write PidFile %.100s (%s)", >+ options.pid_file, strerror(errno)); > } > > /* setup fd set for listen */
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 606
:
338
| 339