From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: Re: [devel] Q: почему в ALT su ведёт себя не так, как su из coreutils?
Date: Sat, 1 May 2004 14:54:02 +0400
Message-ID: <20040501105402.GA31872@nomad.office.altlinux.org> (raw)
In-Reply-To: <Pine.LNX.4.58L.0404301812150.25644@devel.office>
[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]
On Fri, Apr 30, 2004 at 06:36:15PM +0300, Andrei Bulava wrote:
> > А надо ли? Сделав специализированный shell, который будет
> > подправлять окружение и затем запускать обычный shell, можно в
> > сочетании с "su ab" добиться ещё большей гибкости, поскольку вы
> > можете сами определить, какие именно переменные среды вам нужно
> > переустановить.
>
> Всё вышесказанное понял, за исключением "сделав
> специализированный shell". Раскройте, пожалуйста, чуть подробнее.
> Тогда я смогу направить свою энергию в правильном направлении и
> помочь по мере сил ;-)
При переключении в непривилегированного пользователя "su user" из
coreutils устанавливает следующие переменные среды:
HOME, SHELL, USER, LOGNAME.
При этом другие переменные среды, содержащие настройки rootа, сохраняются
(см. printenv |fgrep "$USER").
Эмулировать su из coreutils можно, например, с помощью
env HOME=/home/user USER=user LOGNAME=user su user
Что касается совместимости с coreutils, то я намерен добавить параметр -p.
Поведение "su user" всегда будет вызывать споры, поскольку нет единой
практики, а разные реализации противоречивы.
Мне, например, время от времени предлагают приравнять "su user" к
"su -l user". После добавления параметра -p этот вопрос возникнет снова.
--
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-05-01 10:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-30 12:49 Andrei Bulava
2004-04-30 14:20 ` Dmitry V. Levin
2004-04-30 15:36 ` Andrei Bulava
2004-05-01 10:54 ` Dmitry V. Levin [this message]
2004-05-03 17:01 ` Andrei Bulava
2004-05-03 18:53 ` Dmitry V. Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040501105402.GA31872@nomad.office.altlinux.org \
--to=ldv@altlinux.org \
--cc=devel@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git