Summary: | rpcgen looks for "cpp" in /lib, but not in /usr/bin | ||
---|---|---|---|
Product: | glibc | Reporter: | Arjan van de Ven <arjan> |
Component: | nis | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aj, allan, bugdal, drepper.fsp, kukuk |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | 2.15 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: |
add /usr/bin to the places to search
Use execvp to fall back to system cpp |
There are other patches floating around to do this. The one attached to https://bugzilla.redhat.com/show_bug.cgi?id=456089 makes an array of paths to search. That would be easier to extend. Others use execvp to call cpp and so use the system path, although I doubt that will detect /lib/cpp and /usr/ccs/lib/cpp will not be a PATH so that would not be backwards compatible. there are obviously many ways to skin this cat I went for "least invasive to clearly very old code" Isn't /lib/cpp usually a "traditional" (non-ANSI/ISO-conformant) "C preprocessor" used for non-C-language config file preprocessing, etc.? I may be wrong, but if so, it seems like it could be useful/desirable to have this somewhere outside the normal bin path so that the "cpp" in the path can actually be a conformant C preprocessor. Btw. my system has as /lib/cpp the following script: #!/bin/sh # Traditionally, /lib/cpp only knew about C. exec /usr/bin/cpp -xc "$@" interesting discussion. but the real question is .. what does rpcgen expect for its own use and afaics that's just the normal /usr/bin/cpp anyway. Created attachment 6530 [details]
Use execvp to fall back to system cpp
How about the attached patch using execvp to fall back to using the system cpp? This saves hardcoding another path.
> what does rpcgen expect for its own use
It appears to need a vey basic C pre-processor so /usr/bin/cpp from gcc is more than enough.
Allan, I like your patch. could you send it to libc-alpha for review, please? This has been fixed now, thanks for the report. commit bf9b740a119eecf01499b4de0dc8cbd27b7c47bd Author: Allan McRae <allan@archlinux.org> Date: Sat Aug 4 12:19:09 2012 +1000 rpcgen - fall back to looking for cpp in system path Fall back to the system cpp when /lib/cpp is not present. Removes searching for /usr/ccs/lib/cpp which is not supported on any system that uses glibc. |
Created attachment 6491 [details] add /usr/bin to the places to search attached patch solves the issue rpcgen by default looks for /lib/cpp only (well and some sun specific weird path), but not in "/usr/bin", where gcc installs it. gcc does not install a /lib/cpp symlink. (although many distros manually add it, I suppose for rpcgen's sake) patch makes it look also in /usr/bin. I had to restructure the code slightly to avoid having a 3rd nested if, but it's really only 3 new lines of code