Bug#835513: [PATCH] rpctrace: Pass prefixed_name to _hurd_exec_file_name.
Hello, Kalle Olavi Niemitalo, on Fri 26 Aug 2016 17:23:28 +0300, wrote: > This fixes the following test case: Thanks! > https://www.gnu.org/prep/maintain/maintain.html#Legally-Significant > says a series of minor changes can become significant. Right. > I list my previously applied patches so that you have the correct > information for your decision: That still looks to me small enough for now. It's OK for Debian anyway. Thanks! Samuel
Processed: tagging 835513
Processing commands for cont...@bugs.debian.org: > tags 835513 + pending Bug #835513 [hurd] rpctrace passes incomplete filename to _hurd_exec_file_name if it finds COMMAND in PATH Ignoring request to alter tags of bug #835513 to the same tags previously set > thanks Stopping processing here. Please contact me if you need assistance. -- 835513: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835513 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
Bug#835513: [PATCH] rpctrace: Pass prefixed_name to _hurd_exec_file_name.
This fixes the following test case: mkdir testy echo '#! /bin/bash' > testy/prog echo 'printf "%s\n" "$0"' >> testy/prog chmod +x testy/prog PATH=$(pwd)/testy /bin/rpctrace -E PATH=/usr/bin:/bin -o /dev/null prog Before this patch, the output is: /bin/bash: prog: No such file or directory After this patch, the output is similar to: /home/kalle/testy/prog * utils/rpctrace.c (traced_spawn): Get prefixed_name from file_name_path_lookup and pass it to _hurd_exec_file_name. --- Samuel Thibaultwrites: > It seems simple enough that it's not copyrightable, could you send a > patch? (english phrasing can always have ambiguity issues...) Here is the patch I last built. It fixes both test cases. However, I wrote the commit message before finding the shorter test case and filing the bug. Perhaps one should replace the lengthy description with just a DEP-3 "Bug-Debian" header. https://www.gnu.org/prep/maintain/maintain.html#Legally-Significant says a series of minor changes can become significant. I list my previously applied patches so that you have the correct information for your decision: commit 52d0590bca46d1368a6c5588d214e3724ebad358 diffstat (+7 -4) excluding ChangeLog, which was not from me posted to 39...@bugs.debian.org (deleted) on 1999-07-01 "hurd: /libexec/rc waits for /tmp/* translators" applied on 1999-07-01 commit 9e84be3cabcdd988f4c4af9f0794d0ba2d6929c1 diffstat (+1 -1) posted to http://bugs.debian.org/47382 on 1999-10-14 "libdiskfs/opts-std-startup.c (parse_startup_opt): TOGGLE never clears the variable" applied on 1999-10-14 commit 0e0bcad3e157579dbeafec933ac6ccbc00a515a3 diffstat (+1 -1) posted to http://bugs.debian.org/62557 on 2000-04-17 "[patch] #! doubles first character of argument" applied on 2000-07-20 commit ca5b01f538c122dc1f0e989f5703c75b8cf8ca3a "rpctrace: Print beyond '\0' in MACH_MSG_TYPE_CHAR." diffstat (+2 -1) posted to bug-hurd on 2016-08-23 applied on 2016-08-23 utils/rpctrace.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/rpctrace.c b/utils/rpctrace.c index 95ff124..10843bc 100644 --- a/utils/rpctrace.c +++ b/utils/rpctrace.c @@ -1622,8 +1622,9 @@ traced_spawn (char **argv, char **envp) task_t traced_task; struct sender_info *ti; struct receiver_info *receive_ti; + char *prefixed_name; file_t file = file_name_path_lookup (argv[0], getenv ("PATH"), - O_EXEC, 0, 0); + O_EXEC, 0, _name); if (file == MACH_PORT_NULL) error (1, errno, "command not found: %s", argv[0]); @@ -1664,7 +1665,8 @@ traced_spawn (char **argv, char **envp) the actual task, so the RPCs to map in the program itself do not get traced. Could have an option to use TASK_WRAPPER here instead. */ #ifdef HAVE__HURD_EXEC_FILE_NAME - err = _hurd_exec_file_name (traced_task, file, *argv, argv, envp); + err = _hurd_exec_file_name (traced_task, file, prefixed_name ?: *argv, + argv, envp); #else err = _hurd_exec (traced_task, file, argv, envp); #endif @@ -1675,6 +1677,7 @@ traced_spawn (char **argv, char **envp) cannot die and hence our TRACED_TASK ref cannot have been released. */ mach_port_deallocate (mach_task_self (), task_wrapper); + free (prefixed_name); return pid; } -- 2.6.4
Bug#835513: rpctrace passes incomplete filename to _hurd_exec_file_name if it finds COMMAND in PATH
Hello, Kalle Olavi Niemitalo, on Fri 26 Aug 2016 15:30:22 +0300, wrote: > Fixing this is simple: get prefixed_name from the existing > file_name_path_lookup call, and if it isn't NULL, then use it > instead of *argv and free it afterwards. It seems simple enough that it's not copyrightable, could you send a patch? (english phrasing can always have ambiguity issues...) Samuel
Bug#835513: rpctrace passes incomplete filename to _hurd_exec_file_name if it finds COMMAND in PATH
Package: hurd Version: 1:0.8.git20160809-1 Severity: normal File: /bin/rpctrace If the COMMAND argument of rpctrace does not contain slash, then rpctrace searches for it in PATH. If the file found is a script file, then the interpreter of the script needs to know the file name so that it can open the file. However, when rpctrace calls _hurd_exec_file_name, it specifies COMMAND unchanged as the file name. The interpreter then typically does not find the file. For example, /bin/which in debianutils 4.8 has "#! /bin/sh". If you run: cd / PATH=/bin rpctrace which then it shows that dash outputs "/bin/sh: 0: Can't open which" after calling dir_lookup("which" 1 0) in some directory. rpctrace should specify the correct file name "/bin/which" instead; then dash would be able to open the file. Another, more complex test case: mkdir testy echo '#! /bin/bash' > testy/prog echo 'printf "%s\n" "$0"' >> testy/prog chmod +x testy/prog PATH=$(pwd)/testy /bin/rpctrace -E PATH=/usr/bin:/bin -o /dev/null prog Actual output: /bin/bash: prog: No such file or directory Expected output similar to: /home/kalle/testy/prog Fixing this is simple: get prefixed_name from the existing file_name_path_lookup call, and if it isn't NULL, then use it instead of *argv and free it afterwards. AFAIK, the _hurd_exec_file_name patches are not yet in the upstream Hurd, so I'm filing this in Debian only. -- System Information: Debian Release: stretch/sid APT prefers unstable-debug APT policy: (500, 'unstable-debug'), (500, 'unstable') Architecture: hurd-i386 (i686-AT386) Kernel: GNU-Mach 1.7+git20160809-486-dbg/Hurd-0.8 Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init) Versions of packages hurd depends on: ii hurd-libs0.3 1:0.8.git20160809-1 ii libblkid1 2.28.1-1 ii libbz2-1.01.0.6-8 ii libc0.3 2.23-4 ii libdaemon00.14-6 ii libncursesw5 6.0+20160625-1+b1 ii libtinfo5 6.0+20160625-1+b1 ii libx11-6 2:1.6.3-1+b1 ii netdde0.0.20150828-3 ii sysv-rc 2.88dsf-59 ii xkb-data 2.17-1 ii zlib1g1:1.2.8.dfsg-2 Versions of packages hurd recommends: pn bf-utf-source Versions of packages hurd suggests: pn hurd-doc -- Configuration Files: /etc/default/hurd-console changed: ENABLE='false' DISPLAY='-d vga' KBD='-d pc_kbd' if [ -f /etc/default/keyboard ] then . /etc/default/keyboard fi [ -z "$XKBLAYOUT" ] || KBD="$KBD --keymap $XKBLAYOUT" KBD_REPEAT='--repeat=kbd' MOUSE='-d pc_mouse --protocol=ps/2' MOUSE_REPEAT='--repeat=mouse' -- no debconf information pgpCcg7zkX4cJ.pgp Description: PGP signature
hurd_0.8.git20160826-1_hurd-i386.changes ACCEPTED into unstable
Accepted: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Format: 1.8 Date: Fri, 26 Aug 2016 01:05:01 + Source: hurd Binary: hurd-libs0.3 hurd hurd-prof hurd-dev hurd-doc hurd-libs0.3-udeb hurd-udeb Architecture: source hurd-i386 all Version: 1:0.8.git20160826-1 Distribution: unstable Urgency: medium Maintainer: GNU Hurd MaintainersChanged-By: Samuel Thibault Description: hurd - GNU Hurd hurd-dev - GNU Hurd (development files) hurd-doc - GNU Hurd manual hurd-libs0.3 - GNU Hurd (libraries) hurd-libs0.3-udeb - GNU Hurd (libraries) - udeb (udeb) hurd-prof - GNU Hurd hurd-udeb - GNU Hurd - udeb (udeb) Changes: hurd (1:0.8.git20160826-1) unstable; urgency=medium . * New upstream snapshot, fixes loading small pic programs. * Fix screen-udeb by adding more ptys for d-i. Checksums-Sha1: 5f3718523ace5f5c61dc8bf1464f057b800571fe 5151 hurd_0.8.git20160826-1.dsc daa93d74df7a2464b9b1609b699f6b5ba308abff 18084 hurd_0.8.git20160826.orig-eth-filter.tar.bz2 e4c76bcf05b1419ec9d8c589f36db21acdac4883 16003 hurd_0.8.git20160826.orig-eth-multiplexer.tar.bz2 9d1ef8c9796da2fe62fcb3abe16af367d6289354 10432 hurd_0.8.git20160826.orig-libbpf.tar.bz2 0871ac46085dc120713fc52e852abc616e868661 3346313 hurd_0.8.git20160826.orig-libdde-linux26.tar.bz2 5556f0ad8a706765f982d9c5c2007d21c7ac356f 20131 hurd_0.8.git20160826.orig-libddekit.tar.bz2 99cd78b942052c72061625e01b69c27438993a48 22238 hurd_0.8.git20160826.orig-libmachdev.tar.bz2 28557cb7df7c257fb978baa31f045c50f09bb566 2032483 hurd_0.8.git20160826.orig.tar.bz2 a51666aecafe2ed5acabfd44b7f32cc52059f16d 72856 hurd_0.8.git20160826-1.debian.tar.bz2 f0f755986e97263ab24ffdc3b24a2f982fac6a4a 6732000 hurd-dbgsym_0.8.git20160826-1_hurd-i386.deb 97b04c2478082bd706112264bbd26b101f2cf65f 13500 hurd-dev-dbgsym_0.8.git20160826-1_hurd-i386.deb e12404c16b6fedcae5274515433725e73bd2aee5 3145644 hurd-dev_0.8.git20160826-1_hurd-i386.deb f76c5d85a6ef0fe139fbbfc0594c57b759940dd4 170310 hurd-doc_0.8.git20160826-1_all.deb 851aeaea96463a5e8aac5bd30a57c630ff003122 1801010 hurd-libs0.3-dbgsym_0.8.git20160826-1_hurd-i386.deb f359f0460582ca5f9351d3ffe05591cd8967f2d5 278454 hurd-libs0.3-udeb_0.8.git20160826-1_hurd-i386.udeb e168c9b7b47a9fbbe50bbc86523f261bc8ad4c7f 303484 hurd-libs0.3_0.8.git20160826-1_hurd-i386.deb 7ea9a65f2369572bac19384e00ae6b557d506e48 3981112 hurd-prof_0.8.git20160826-1_hurd-i386.deb db5334afe4f3814c4946aeab006fcdfebb978f9e 1584988 hurd-udeb_0.8.git20160826-1_hurd-i386.udeb bdc7e674ec12492d66ec11a123106fd0f1346a52 1512880 hurd_0.8.git20160826-1_hurd-i386.deb Checksums-Sha256: c6667aecf1ca81ffd8908027d7248f4c2694797c8ebb3c01c68ecbb72447c7bc 5151 hurd_0.8.git20160826-1.dsc 492c618a3b0f03c6461c07d9c4bfc4f9b6b0e0efd958f18ecfd15d209c2521b9 18084 hurd_0.8.git20160826.orig-eth-filter.tar.bz2 38a1643b846941115a8b089dc9170cf476f0123dd6881165e377b87e9ec157cb 16003 hurd_0.8.git20160826.orig-eth-multiplexer.tar.bz2 4c8804539b6609ae9a582155062f59d61a159a537e4ba385ea5f4a606d30b38a 10432 hurd_0.8.git20160826.orig-libbpf.tar.bz2 4e095c391f6a58004735208296a7b5b90c3589350cd5a51cdb06b7f06dc1c843 3346313 hurd_0.8.git20160826.orig-libdde-linux26.tar.bz2 40305745a32c1e3ac42c108de27c30feff3a3295acf5165dbbb57a775fe627cf 20131 hurd_0.8.git20160826.orig-libddekit.tar.bz2 5c476683dbf828094a745dac55720d2416c765033c4eb4bf336d695dac8ab845 22238 hurd_0.8.git20160826.orig-libmachdev.tar.bz2 87eb85f8e23070939ff32f0d2a955dd982eb1e52878d9e6637897eae6710bf06 2032483 hurd_0.8.git20160826.orig.tar.bz2 37ea1caa36823b3689bd20571488eac3bb98ea82037289fa80ec16a80737a209 72856 hurd_0.8.git20160826-1.debian.tar.bz2 f5ac7aa99306e64d2f0e156ad00903892e4654c824ec615843d3bcfe624a4ff9 6732000 hurd-dbgsym_0.8.git20160826-1_hurd-i386.deb a39179a5663cdf6354ebf05d7cabd8d9623810ef4c28c7ccb442f9ccc8ea8b8f 13500 hurd-dev-dbgsym_0.8.git20160826-1_hurd-i386.deb 62ea84b84b7901887f5eb99b2ea17769582692170598c28831655739bdedbd6e 3145644 hurd-dev_0.8.git20160826-1_hurd-i386.deb eca7c1cd7d2b273e6aa817e81028b3c7fc87f39d2f1890de83f7345932c9515f 170310 hurd-doc_0.8.git20160826-1_all.deb 23ab1145816cf4a0534f8fd6f4f5131d2d5e866fa335453a016656f345f86229 1801010 hurd-libs0.3-dbgsym_0.8.git20160826-1_hurd-i386.deb 11b3c752797107ee6142b723ddb3ae85a92e0fa9d9f5caf26ebed996c642019c 278454 hurd-libs0.3-udeb_0.8.git20160826-1_hurd-i386.udeb 021a807c5437367e2ae3acff79dfc2f391cf75d787359f9c94383ea4a4d1c290 303484 hurd-libs0.3_0.8.git20160826-1_hurd-i386.deb 90b24251dbbcccf76cab403c483ee02f9bf3afdf2e5730f4324c1ee4cb75490f 3981112 hurd-prof_0.8.git20160826-1_hurd-i386.deb c4c72d686f7b0fa942458c91ff0fc19d700b6be3273a6c1bdf6aa4f4f84e1675 1584988 hurd-udeb_0.8.git20160826-1_hurd-i386.udeb aa2cd443bc44a22582fe83a341fa6605b21d7a4fd2687ea1837a5b9955b9ee83 1512880 hurd_0.8.git20160826-1_hurd-i386.deb Files: 6dedd14eabbaf8d81411c54a5f03f9f9 5151 admin required hurd_0.8.git20160826-1.dsc c2b432989bcca5059cba2c19178176a9
Processing of hurd_0.8.git20160826-1_hurd-i386.changes
hurd_0.8.git20160826-1_hurd-i386.changes uploaded successfully to localhost along with the files: hurd_0.8.git20160826-1.dsc hurd_0.8.git20160826.orig-eth-filter.tar.bz2 hurd_0.8.git20160826.orig-eth-multiplexer.tar.bz2 hurd_0.8.git20160826.orig-libbpf.tar.bz2 hurd_0.8.git20160826.orig-libdde-linux26.tar.bz2 hurd_0.8.git20160826.orig-libddekit.tar.bz2 hurd_0.8.git20160826.orig-libmachdev.tar.bz2 hurd_0.8.git20160826.orig.tar.bz2 hurd_0.8.git20160826-1.debian.tar.bz2 hurd-dbgsym_0.8.git20160826-1_hurd-i386.deb hurd-dev-dbgsym_0.8.git20160826-1_hurd-i386.deb hurd-dev_0.8.git20160826-1_hurd-i386.deb hurd-doc_0.8.git20160826-1_all.deb hurd-libs0.3-dbgsym_0.8.git20160826-1_hurd-i386.deb hurd-libs0.3-udeb_0.8.git20160826-1_hurd-i386.udeb hurd-libs0.3_0.8.git20160826-1_hurd-i386.deb hurd-prof_0.8.git20160826-1_hurd-i386.deb hurd-udeb_0.8.git20160826-1_hurd-i386.udeb hurd_0.8.git20160826-1_hurd-i386.deb Greetings, Your Debian queue daemon (running on host franck.debian.org)
Processing of hurd_0.8.git20160826-1_hurd-i386.changes
hurd_0.8.git20160826-1_hurd-i386.changes uploaded successfully to ftp-master.debian.org along with the files: hurd_0.8.git20160826-1.dsc hurd_0.8.git20160826.orig-eth-filter.tar.bz2 hurd_0.8.git20160826.orig-eth-multiplexer.tar.bz2 hurd_0.8.git20160826.orig-libbpf.tar.bz2 hurd_0.8.git20160826.orig-libdde-linux26.tar.bz2 hurd_0.8.git20160826.orig-libddekit.tar.bz2 hurd_0.8.git20160826.orig-libmachdev.tar.bz2 hurd_0.8.git20160826.orig.tar.bz2 hurd_0.8.git20160826-1.debian.tar.bz2 hurd-dbgsym_0.8.git20160826-1_hurd-i386.deb hurd-dev-dbgsym_0.8.git20160826-1_hurd-i386.deb hurd-dev_0.8.git20160826-1_hurd-i386.deb hurd-doc_0.8.git20160826-1_all.deb hurd-libs0.3-dbgsym_0.8.git20160826-1_hurd-i386.deb hurd-libs0.3-udeb_0.8.git20160826-1_hurd-i386.udeb hurd-libs0.3_0.8.git20160826-1_hurd-i386.deb hurd-prof_0.8.git20160826-1_hurd-i386.deb hurd-udeb_0.8.git20160826-1_hurd-i386.udeb hurd_0.8.git20160826-1_hurd-i386.deb Greetings, Your Debian queue daemon (running on host coccia.debian.org)