[sisyphus] sudo + user local = secure?

Ilya Palagin =?iso-8859-1?q?tux_=CE=C1_fioc=2Ekz?=
Вт Ноя 19 08:20:21 MSK 2002


Anton V. Denisov wrote:
> Приветствую всех.
> 
> Уже много раз обсуждалось и объяснялось по каким соображениям у root'а
> используется POSIX локаль, также много раз говорилось о полезности
> использования sudo для выполнения каких-либо действий с правами
> суперпользователя. Но вот чего я так и не могу понять, так это почему при
> вызове sudo все переменные окружения, описывающме локаль, остаются
> пользовательскими? Получается мы сами нарушаем использование POSIX локали
> при
> работе с привелегиями суперпользователя. Или я не понимаю тонкостей работы
> sudo? Прошу разъяснений по этому вопросу от более опытных товарищей.
> 

Это делается в целях безопасности. man - лучший товарищ:

sudo tries to be safe when executing external commands.  Variables that 
control how
dynamic loading and binding is done can be used to subvert the program 
that sudo
runs.  To combat this the LD_*, _RLD_*, SHLIB_PATH (HP-UX only), and 
LIBPATH (AIX
only) environment variables are removed from the environment passed on 
to all com-
mands executed.  sudo will also remove the IFS, ENV, BASH_ENV, KRB_CONF, 
KRB-
CONFDIR, KRBTKFILE, KRB5_CONFIG, LOCALDOMAIN, RES_OPTIONS, HOSTALIASES, 
NLSPATH,
PATH_LOCALE, TERMINFO, TERMINFO_DIRS and TERMPATH variables as they too 
can pose a
threat.  If the TERMCAP variable is set and is a pathname, it too is 
ignored.
Additionally, if the LC_* or LANGUAGE variables contain the / or % 
characters, they
are ignored.  If sudo has been compiled with SecurID support, the 
VAR_ACE, USR_ACE
and DLC_ACE variables are cleared as well.  The list of environment 
variables that
sudo clears is contained in the output of sudo -V when run as root.





Подробная информация о списке рассылки Sisyphus