From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,54857fb1ad7c82f3 X-Google-Attributes: gidfee84,public From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Subject: Re: LD_LIBRARY_PATH mangled on SUID program Date: 2000/02/03 Message-ID: <87chgd$32h$1@news.ndsu.nodak.edu>#1/1 X-Deja-AN: 581187062 Content-Transfer-Encoding: 7bit References: <87cab9$h5v$1@news.gov.on.ca> Content-Type: text/plain; charset=US-ASCII X-Complaints-To: abuse@nodak.edu X-Trace: news.ndsu.nodak.edu 949602637 3153 134.129.106.23 (3 Feb 2000 18:30:37 GMT) Organization: North Dakota Higher Education Computing Network (NDHECN) Mime-Version: 1.0 NNTP-Posting-Date: 3 Feb 2000 18:30:37 GMT Newsgroups: comp.unix.osf.osf1 In article <87cab9$h5v$1@news.gov.on.ca>, Richard wrote: > Dear List: > > This is the second time I have run into this. Does anyone have a work > around? > > I have a user with a particular LD_LIBRARY_PATH variable set. I want the > user to run a program with 4755 protection. The LD_LIBRARY_PATH of the user > wishing to run the program becomes mangled by a prepended string which > appears as follows when it is od'd from an output file. If the LD_LIBRARY_PATH is required for the particular application, they're out of luck. As a (correct!) security precaution, the runtime loader will ignore LD_LIBRARY_PATH for any setuid or setgid programs unless the user is already root. This is hinted at in the loader(5) man page, and probably stated more forcefully elsewhere. Other Unix platforms that support LD_LIBRARY_PATH or its moral equivalent do the exact same thing -- ignore the user's LD_LIBRARY_PATH for setuid and setgid programs so the user can't spoof routines that may get executed with elevated privs. In this particular case, why you're getting the junk you're seeing is unknown (to me, anyway). It's probably moot, though, since you're desired goal isn't going to work anyway. You may want to investigate either using executable or library RPATH's (check out the `-rpath' option to ld, for when the library or executable is built), or static linking of the program. That way the user can unset the LD_LIBRARY_PATH and the problem will hopefully go away. Tim -- Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J1, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164