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

Re: /etc/profile.d



* Piotr Roszatycki said:

> > > Some programs outside Debian distribution located at /usr/local/... ditectory
> > > require modified user environment. 
> > They are not part of the Debian system.
> 
> If the Debian modified user environment, I wouldn't have to do it by hand.
If every package modified the user's environment at will, the environment
could become bloated very easily and in many cases this would be a simple
waste of memory. Not every user uses every package that needs to set an
environment variable, or a few of them.
 
> > > Manually modification of /etc/profile is annoying.
> > Hmm... it's a one-time task, so I see no problem...
> 
> I need to know which variables I have to set. i.e. libqt could do it
> automatically. It will not break the system but could help.
libqt is used by a limited range of users, if we take this example. If a
package needs to set a variable it should advise the user/administrator to
that effect, not set it automagically. How do you imagine a 100 packages
setting their variables automagically?? I don't wont INN envvars in my
environment, because I don't need them. If they were set in the system
environment, then I'd have to read the INN docs (although I, hypothetically,
don't care about the package) to unset them in my startup script. If there
were a 100 of such packages, I'd have to unset 100+ envvars I DON'T NEED. It
would be a beautiful bloat, don't you think?

> > > Yes, but only manually.
> > The syntax of this file is strictly defined. Writing a update-environment
> > script wouldn't be hard at all. But it would still break the policy.
> 
> i.e. I need a script 'langconfig' which set a default language for system.
Set it ONCE in /etc/environment

> The easiest way is to modify /etc/profile.d/lang.(sh|csh). This script
> shouldn't modify any conffile shared by a few packages.
This is a) a bloat, b) not all user shells need to understand the syntax. Do
you want to create scripts for each and every shell that is in the Debian
distro?
 
> Another example - mc could add default alias to user environment. Now it isn't
It was already discussed here.

> possible to stay in last directory after exit mc. /etc/profile.d/mc.csh could be
> following:
>     alias mc 'setenv MC `/usr/bin/mc -P *`; cd $MC; unsetenv MC'
Yes, it was discussed. It's as easy as including the relevant excerpt of
code in /usr/share/doc/mc and let the user know there's such possibility.
Also, such alias is bash-dependent, not very good - another bashism. Again,
you'd have to create aliases (if they are supported) for all the shells in
Debian.
      
> I don't understand why the environment have to be sane? In this extremal situation,
I explained it above. Also, setting the environment variables without the
knowledge of the system administrator and, what follows, a user can pose a
security risk - possible buffer overflows, exploits of shell escapes and
possibly more.

> the bash shouldn't set PATH and PS1 variables and umask.
> 
> This feature could be useful. No more, no less.
No, it's a classic bloat. IMO.

marek

Attachment: pgp8dEPA3E4sO.pgp
Description: PGP signature


Reply to: