public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Why empty in LD_LIBRARY_PATH be interpreted as `use the current directory`?
@ 2019-05-08  7:20 ronyweng
  2019-05-08 10:00 ` Florian Weimer
  2019-05-08 15:03 ` Paul Smith
  0 siblings, 2 replies; 3+ messages in thread
From: ronyweng @ 2019-05-08  7:20 UTC (permalink / raw)
  To: libc-help



I know it was   deliberately, but it seems to be error prone.

Some utilities(gvm in my case) change LD_LIBRARY_PATH like this.

export LD_LIBRARY_PATH; LD_LIBRARY_PATH="${GVM_OVERLAY_PREFIX}/lib:${LD_LIBRARY_PATH}"

 

There is no default LD_LIBRARY_PATH in most of systems,

It turn out that the empty (current dirctory) is appended to LD_LIBRARY_PATH.

I am concerned for the security. Shouldn't glibc just ignore empty?

 

 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why empty in LD_LIBRARY_PATH be interpreted as `use the current directory`?
  2019-05-08  7:20 Why empty in LD_LIBRARY_PATH be interpreted as `use the current directory`? ronyweng
@ 2019-05-08 10:00 ` Florian Weimer
  2019-05-08 15:03 ` Paul Smith
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2019-05-08 10:00 UTC (permalink / raw)
  To: ronyweng; +Cc: libc-help

* ronyweng:

> I am concerned for the security. Shouldn't glibc just ignore empty?

It's always been this way.  For PATH, current POSIX requires it (“A
zero-length prefix is a legacy feature that indicates the current
working directory.”).  These scripts need to be fixed.

Maybe we could provide a different variable that behaves differently,
but the transition period would be quite long.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why empty in LD_LIBRARY_PATH be interpreted as `use the current directory`?
  2019-05-08  7:20 Why empty in LD_LIBRARY_PATH be interpreted as `use the current directory`? ronyweng
  2019-05-08 10:00 ` Florian Weimer
@ 2019-05-08 15:03 ` Paul Smith
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Smith @ 2019-05-08 15:03 UTC (permalink / raw)
  To: ronyweng, libc-help

On Wed, 2019-05-08 at 15:20 +0800, ronyweng wrote:
> LD_LIBRARY_PATH="${GVM_OVERLAY_PREFIX}/lib:${LD_LIBRARY_PATH}"

This should be written as:

  LD_LIBRARY_PATH="${GVM_OVERLAY_PREFIX}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-08 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08  7:20 Why empty in LD_LIBRARY_PATH be interpreted as `use the current directory`? ronyweng
2019-05-08 10:00 ` Florian Weimer
2019-05-08 15:03 ` Paul Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).