FreeBSD Bugzilla – Attachment 202073 Details for
Bug 235121
shells/rssh: rssh crashes on invocation due to new basename(3) POSIX behaviour
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
shar patch - supersedes all others
pa (text/plain), 3.06 KB, created by
jharris
on 2019-02-16 20:36:12 UTC
(
hide
)
Description:
shar patch - supersedes all others
Filename:
MIME Type:
Creator:
jharris
Created:
2019-02-16 20:36:12 UTC
Size:
3.06 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># pa ># patch-log.c ># patch-rssh_chroot_helper.c ># patch-util.c ># >echo x - pa >sed 's/^X//' >pa << 'e529a9cea4a728eb9c5828b13b22844c' >X# This is a shell archive. Save it in a file, remove anything before >X# this line, and then unpack it by entering "sh file". Note, it may >X# create directories; files and directories will be owned by you and >X# have default permissions. >X# >X# This archive contains: >X# >X# pa >X# patch-log.c >X# patch-rssh_chroot_helper.c >X# patch-util.c >X# >Xecho x - pa >Xsed 's/^X//' >pa << 'e529a9cea4a728eb9c5828b13b22844c' >e529a9cea4a728eb9c5828b13b22844c >echo x - patch-log.c >sed 's/^X//' >patch-log.c << '101c0d259f81e22d723659e7df44ffb8' >Xdiff -r 5ce4cf551944 log.c >X--- ./log.c Sat Feb 09 18:39:29 2019 -0400 >X+++ ./log.c Sat Feb 09 19:33:11 2019 -0400 >X@@ -93,10 +93,14 @@ >X } >X /* assign new value to ident from name */ >X if ( !name ) return (ident = NULL); >X- ident = strdup(basename((char*)name)); >X- /* remove leading '-' from ident, if there is one */ >X- if ( ident[0] == '-' ){ >X- temp = strdup(ident + 1); >X+ /* clone name in case basename() is POSIX-compliant */ >X+ temp = strdup ((char *) name); >X+ /* always pass writeable string to basename() */ >X+ ident = strdup (basename (temp)); >X+ free (temp); >X+ /* safely remove leading '-' from ident, if there is one */ >X+ if ((ident != NULL) && (ident[0] == '-')){ >X+ temp = strdup(&ident[1]); >X free(ident); >X ident = temp; >X } >101c0d259f81e22d723659e7df44ffb8 >echo x - patch-rssh_chroot_helper.c >sed 's/^X//' >patch-rssh_chroot_helper.c << '81db34ef15ef2912b0219dde1e19b4d8' >Xdiff -r 5ce4cf551944 rssh_chroot_helper.c >X--- ./rssh_chroot_helper.c Sat Feb 09 18:39:29 2019 -0400 >X+++ ./rssh_chroot_helper.c Sat Feb 09 19:33:11 2019 -0400 >X@@ -159,7 +159,7 @@ >X opts.chroot_path = NULL; >X >X /* figure out our name, and give it to the log module */ >X- progname = strdup(log_make_ident(basename(argv[0]))); >X+ progname = strdup(log_make_ident(basename(strdup (argv[0])))); >X >X /* get user's passwd info */ >X if ( (temp = getpwuid(getuid())) ){ >81db34ef15ef2912b0219dde1e19b4d8 >echo x - patch-util.c >sed 's/^X//' >patch-util.c << 'c56fe84a0a66a81e0d100c7d41d5b174' >Xdiff -r 5ce4cf551944 util.c >X--- ./util.c Sat Feb 09 18:39:29 2019 -0400 >X+++ ./util.c Sat Feb 09 19:33:11 2019 -0400 >X@@ -165,6 +165,7 @@ >X { >X char *prog; /* basename of cmd */ >X char *tmp = cl; >X+ char *tmp2 = NULL; >X bool need_free = FALSE; >X bool rc = FALSE; >X int i; >X@@ -186,7 +187,13 @@ >X } >X >X /* compare tmp to cmd and prog for match */ >X- prog = basename(cmd); >X+ tmp2 = strdup (cmd); >X+ if (tmp2 == NULL) { >X+ log_msg ("strdup() failed in check_command()"); >X+ return FALSE; >X+ } >X+ prog = basename(tmp2); >X+ free (tmp2); >X if ( !(strcmp(tmp, cmd)) || !(strcmp(tmp, prog))){ >X log_msg("cmd '%s' approved", prog); >X rc = TRUE; >c56fe84a0a66a81e0d100c7d41d5b174 >exit >
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
Flags:
jharris:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 235121
:
201321
|
201322
|
201752
|
201753
|
201754
|
201755
| 202073 |
202528