[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: QA needed for insecure LD_LIBRARY_PATH in many wrapper scripts



On Fri, 16 Nov 2007 22:01:34 +0100, Stefan Fritsch wrote:
[...]
> The fix is to use "${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" instead of
> ":$LD_LIBRARY_PATH". This will get rid of the colon if LD_LIBRARY_PATH
> is unset. (Actually, some scripts use "${LD_LIBRARY_PATH+:
> $LD_LIBRARY_PATH}", which seems to work, too. But this is not 
> documented in the bash man page, at least I can't find it.)

Actually it is documented, just above the description of the various
expansions:
	bash tests for a parameter that is unset or null; omitting the colon
	results in a test only for a parameter that is unset.

Given that a null LD_LIBRARY_PATH seems to have no effect, just as if
it were unset, the :+ form appears to be more appropriate.

-- 
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.

Attachment: signature.asc
Description: Digital signature


Reply to: