[Xquartz-dev] 2.3.2_rc4

Cameron Simpson cs at zip.com.au
Sat Dec 27 13:41:38 PST 2008


On 27Dec2008 12:26, Harald Hanche-Olsen <hanche at math.ntnu.no> wrote:
| + Cameron Simpson <cs at zip.com.au>:
| > On 27Dec2008 09:43, Harald Hanche-Olsen <hanche at math.ntnu.no> wrote:
| > | Would it make sense to drop the --have-login-env command line flag and
| > | just test for the presence of _WITH_LOGIN_ENV_QUOTED_COMMAND in the
| > | environment instead?
| > [...]
| > It could be done, but what does it do for us? I can't see that it solves
| > any specific problem. [...]
| > So, can you explain what this change gains for us?
| 
| As you noted, it simplifies the script and makes it easier to
| understand, to me at least. But that is all. And your note on blindly
| evalling an environment string is well taken, though, of course,

Thinking on this last night, I am more strongly of thing opinion than
I was yesterday; I really do only want to eval that envvar when told to
with the option.

| if
| the user really has an environment variable with such an unlikely name
| lying around already, it's a real possibility that they are in fact
| setting it up in their login script - in which case we're hosed
| anyhow.

Yes, this is true.

| So to me, using the command line argument is a complication
| with a very marginal gain. OTOH, my proposed simplification is also
| relatively minor, so I am not going to argue it further.

The argument I made with myself during the night included this
consideration: if the script will blindly eval a variable, then in order
to _safely_ invoke the script the caller must unset the variable before
calling the script, and the caller isn't meant to need to be very aware of
the variable. By requiring the command line option, it is perfectly safe
for a caller to just invoke the script (excepting your "they probably
set it in their .profile" scenario). Omitting the command line option
requirement makes it harder for someone to safely call the script.

So I'm going to leave the option there - it makes me feel better.
But thanks for the suggestion.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/


More information about the Xquartz-dev mailing list