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

Re: rsync --delete



On Tue, Oct 20, 2020 at 09:42:26AM -0400, The Wanderer wrote:
> Maybe I'm still missing something, but so far I'm not seeing a way to
> export this, so I still don't see a way it could get exposed inside the
> script.

Oh, looks like a change was made.

wooledg:~$ bash-4.4
wooledg:~$ function /bin/echo { echo "good-bye world"; }
wooledg:~$ export -f /bin/echo
bash-4.4: export: /bin/echo: cannot export
wooledg:~$ exit
wooledg:~$ bash-3.2
wooledg:~$ function /bin/echo { echo "good-bye world"; }
wooledg:~$ export -f /bin/echo
wooledg:~$ exit
wooledg:~$ bash-4.3
wooledg:~$ function /bin/echo { echo "good-bye world"; }
wooledg:~$ export -f /bin/echo
wooledg:~$ 

Not sure whether that was an intentional change for security purposes, or
something accidental.  In any case, the change occurred between 4.3 and 4.4.

Anyway, hard-coding paths to common system tools is not a helpful
practice.  You're far better off just setting a safe PATH at the top
of your script, if you feel that you can't trust the execution
environment for some reason.


Reply to: