The Samba-Bugzilla – Bug 5289
Build system: Uninstall scripts can clobber system files
Last modified: 2008-09-18 11:46:39 UTC
Credit for this discovery goes to cypher on IRC.
The "make uninstall" functionality can clobber system files if S4 was uninstalled under the standard /usr/bin, /usr/sbin, /usr/lib, etc. directories.
The problem is that "make uninstall" calls some shell scripts (script/uninstall*) that take a base directory and file names or partial paths as arguments. Each of the file names/partial paths is passed through "basename" and then the combination of the base directory and the output of basename is removed.
The particular problem is that /usr/include/time.h can get clobbered. The uninstallheader.sh script gets /usr/include as the base directory. One of the partial paths given as an argument is lib/util/time.h, which results in "time.h" when passed through basename. Thus, "/usr/include" + "time.h" causes the system header file to get clobbered.
Seems like these scripts (and maybe the arguments to their calls in the Makefile) are slightly out of date.
The basename method seems to be used in most of the uninstall* scripts.
*** Bug 5437 has been marked as a duplicate of this bug. ***
This shouldn't be too difficult to fix!
Well, patches are welcome :-)
Now I realize that the issue is much more difficult. A small and fast resolution would be the renaming of SAMBA's "time.h".
Otherwise we had much more effort to proof for the right "time.h". Another solution would be to change the header path from "/usr/include" to a subdirectory called "/usr/include/samba".
This is caused due to the use of "--prefix=/usr" on the invocation of "configure". This should be prevented, because there exists an extra option (--with-fhs) for installation in FHS paths.
I'm posting a patch to correct this.
Created attachment 3578 [details]
Patch to prevent prefix=/usr
This patch prevents this special case.