Package: bash
Version: 4.4-5

According to the man page:

       UID    Expands to the user ID of the current user, initialized at
shell
              startup.  This variable is readonly.

However, if the variable is set in the environment then it will inherit
it from there rather than initializing it during startup. The same is
true of EUID and perhaps others.

$ bash -c 'echo $UID'
1000
$ env UID=spong bash -c 'echo $UID'
spong

The example is contrived but the issue has a real impact, for example:
  http://aptosid.com/index.php?name=PNphpBB2&file=viewtopic&t=2985

ttfn/rjk

Reply via email to