Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 202977

Summary: start-stop-daemon PATH striping patch (<=baselayout-2.0.0_rc6)
Product: Gentoo Linux Reporter: Jan Psota <jasiupsota>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED DUPLICATE    
Severity: critical    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jan Psota 2007-12-22 02:20:08 UTC
start-stop-daemon /rc/ from PATH remove function does not copy
terminating '\0' from token, full patch attached in 'additional information',
and here is the only change (src/start-stop-daemon.c, line 908):
-memcpy (np, token, sizeof (char) * strlen (token));
+memcpy (np, token, sizeof (char) * strlen (token) + 1);


Reproducible: Always

Steps to Reproduce:
1. set loglevel to debug in /etc/conf.d/distccd
2. /etc/init.d/distccd start
3. try to compile using distcc and look into syslog

Actual Results:  
distccd returns with 110 (cannot find compiler), because of PATH setting broken by strange characters after actual paths

Expected Results:  
distcc compiles OK

--- src/start-stop-daemon.c~	2007-12-22 02:44:58.000000000 +0100
+++ src/start-stop-daemon.c	2007-12-22 02:44:58.000000000 +0100
@@ -905,7 +905,7 @@
 											(l + strlen (token) + 2));
 						np = newpath + l;
 						*np++ = ':';
-						memcpy (np, token, sizeof (char) * strlen (token));
+						memcpy (np, token, sizeof (char) * strlen (token) + 1);
 					} else {
 						l = strlen ("PATH=") + strlen (token) + 1;
 						newpath = xmalloc (sizeof (char) * l);
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-12-22 11:10:32 UTC

*** This bug has been marked as a duplicate of bug 199749 ***
Comment 2 Roy Marples (RETIRED) gentoo-dev 2007-12-22 11:11:06 UTC
Thanks for the patch though :)