Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney)
Subject: Re: LD_LIBRARY_PATH mangled on SUID program
Date: 2000/02/03	[thread overview]
Message-ID: <87chgd$32h$1@news.ndsu.nodak.edu> (raw)
In-Reply-To: 87cab9$h5v$1@news.gov.on.ca

In article <87cab9$h5v$1@news.gov.on.ca>,
Richard <richard.abraham@mnr.gov.on.ca> 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



  reply	other threads:[~2000-02-03  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-03  5:00 LD_LIBRARY_PATH mangled on SUID program Richard
2000-02-03  5:00 ` Tim Mooney [this message]
2000-02-03  5:00 ` Rob Urban
2000-02-04  5:00 ` John Goodbody
2000-02-11  5:00 ` Richard
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox