FreeBSD Bugzilla – Attachment 8553 Details for
Bug 17843
ftpd fails to set cwd with mode 700 NFS mounted home dirs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.24 KB, created by
Andrew Gallatin
on 2000-04-07 15:10:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Andrew Gallatin
Created:
2000-04-07 15:10:01 UTC
Size:
1.24 KB
patch
obsolete
>Index: libexec/ftpd//ftpd.c >=================================================================== >RCS file: /home/ncvs/src/libexec/ftpd/ftpd.c,v >retrieving revision 1.62 >diff -u -r1.62 ftpd.c >--- libexec/ftpd//ftpd.c 2000/02/10 19:51:30 1.62 >+++ libexec/ftpd//ftpd.c 2000/04/07 13:55:40 >@@ -1287,14 +1287,29 @@ > goto bad; > } > } else if (chdir(pw->pw_dir) < 0) { >- if (chdir("/") < 0) { >- reply(530, "User %s: can't change directory to %s.", >- pw->pw_name, pw->pw_dir); >+ /* >+ * We may have failed to chdir if the user's home >+ * directory is mounted over NFS & it is unreadable by >+ * this machines superuser (eg. mode x00) -- set the >+ * uid & try again. >+ */ >+ >+ if (seteuid((uid_t)pw->pw_uid) < 0) { >+ reply(550, "Can't set uid."); > goto bad; >- } else >- lreply(230, "No directory! Logging in with home=/"); >+ } >+ >+ if (chdir(pw->pw_dir) < 0) { >+ if (chdir("/") < 0) { >+ reply(530, "User %s: can't change directory to %s.", >+ pw->pw_name, pw->pw_dir); >+ goto bad; >+ } else >+ lreply(230, "No directory! Logging in with home=/"); >+ } > } >- if (seteuid((uid_t)pw->pw_uid) < 0) { >+ if (((uid_t)pw->pw_uid != geteuid()) && >+ seteuid((uid_t)pw->pw_uid) < 0) { > reply(550, "Can't set uid."); > goto bad; > }
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 17843
: 8553