Bugzilla – Attachment 1738 Details for
Bug 1679
chroot and shell check ambiguity
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Initial patch
chroot-shellfix.patch (text/plain), 1.63 KB, created by
Alex Beregszaszi
on 2009-12-04 12:21:29 AEDT
(
hide
)
Description:
Initial patch
Filename:
MIME Type:
Creator:
Alex Beregszaszi
Created:
2009-12-04 12:21:29 AEDT
Size:
1.63 KB
patch
obsolete
>Index: auth.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/auth.c,v >retrieving revision 1.80 >diff -b -c auth.c >*** auth.c 4 Nov 2008 07:58:09 -0000 1.80 >--- auth.c 4 Dec 2009 01:19:28 -0000 >*************** >*** 92,97 **** >--- 92,114 ---- > */ > shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; > >+ /* >+ * Amend shell if chroot is requested. >+ * This code is based on the appropriate one found in session.c >+ */ >+ if (options.chroot_directory != NULL && >+ strcasecmp(options.chroot_directory, "none") != 0) { >+ char *shell2, *tmp, *chroot_path; >+ tmp = tilde_expand_filename(options.chroot_directory, >+ pw->pw_uid); >+ chroot_path = percent_expand(tmp, "h", pw->pw_dir, >+ "u", pw->pw_name, (char *)NULL); >+ xasprintf(&shell2, "%s/%s", chroot_path, shell); >+ shell = shell2; >+ free(chroot_path); >+ free(tmp); >+ } >+ > /* deny if shell does not exists or is not executable */ > if (stat(shell, &st) != 0) { > logit("User %.100s not allowed because shell %.100s does not exist", >*************** >*** 103,108 **** >--- 120,130 ---- > logit("User %.100s not allowed because shell %.100s is not executable", > pw->pw_name, shell); > return 0; >+ } >+ >+ if (options.chroot_directory != NULL && >+ strcasecmp(options.chroot_directory, "none") != 0) { >+ free(shell); > } > > if (options.num_deny_users > 0 || options.num_allow_users > 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 1679
:
1737
| 1738 |
1777
|
1778