From: Alex Efros <powerman@powerman.asdfgroup.com>
To: gentoo-user-ru@lists.gentoo.org
Subject: Re: [gentoo-user-ru] root->user
Date: Wed, 23 Apr 2008 00:31:16 +0300 [thread overview]
Message-ID: <20080422213116.GB26500@home.power> (raw)
In-Reply-To: <480E555B.9020509@mail.ru>
Hi!
On Wed, Apr 23, 2008 at 01:15:07AM +0400, Mad Deer wrote:
> как на счёт sudo -u USER bash -c '. /etc/profile; COMMAND'
> или в особо сложных случаях sudo -u USER bash -c '. ~/.bashrc; COMMAND'
Это работать не будет - $HOME никто не выставил. Я поэтому и выстраивал
цепочку HOME= USER= LOGNAME= перед вызовом sudo. Но давайте проверим:
# sudo -u USER bash -c '. /etc/profile; echo $HOME'
/root
# sudo -u USER bash -c '. ~/.bashrc'
bash: /root/.bashrc: Permission denied
> пропробуй в /etc/sudoers закоментить "Defaults env_reset" она сбрасывает
> переменые
Это ничего не даёт, что вполне логично.
В общем, спасибо за ответ, но Вы бы проверяли то, что советуете, хоть в
общих чертах. Конкретно в моём случае не требуется для этого подготавливать
сложную тестовую среду, достаточно просто выполнить команду перед тем, как
отправлять её в maillist.
--
WBR, Alex.
prev parent reply other threads:[~2008-04-22 21:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-22 20:15 [gentoo-user-ru] root->user Alex Efros
2008-04-22 21:06 ` Andrey Vasyutchenko
2008-04-22 21:23 ` Alex Efros
2008-04-22 21:15 ` Mad Deer
2008-04-22 21:31 ` Alex Efros [this message]
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=20080422213116.GB26500@home.power \
--to=powerman@powerman.asdfgroup.com \
--cc=gentoo-user-ru@lists.gentoo.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox