From: Leonid Krivoshein <klark.devel@gmail.com> To: devel@lists.altlinux.org Subject: Re: [devel] Как правильно определить, что мы внутри Hasher? Date: Tue, 18 Aug 2020 03:13:34 +0300 Message-ID: <b4348dd2-f174-b479-86fc-66a6d254cba4@gmail.com> (raw) In-Reply-To: <20200817235735.GE5522@altlinux.org> 18.08.2020 2:57, Dmitry V. Levin пишет: > On Tue, Aug 18, 2020 at 02:19:12AM +0300, Leonid Krivoshein wrote: > [...] >> Нашёл ещё такой вариант: >> >> # chroot / /bin/sh -c exit; echo $? >> 0 >> >> $ hsh-run --rooter -- chroot / /bin/sh -c exit; echo $? >> chroot: cannot change root directory to '/': Operation not permitted >> 125 > Так проще: > $ hsh-run --root -- chroot / /bin/true Да, спасибо! Беру на вооружение. >> Но вообще интересно, как правильно... > Для того, чтобы выяснить, достаточно ли настоящий root, протестируйте > выполнение той привилегированной операции, которая вам нужна. По условиям задачи нужен либо fakeroot, либо rooter в хэшере. А в случае настоящего root'а лучше сразу выходить или хотя бы ругаться.)) Так что если "chroot" в минимальном хэшере есть, это вполне годится. -- Best regards, Leonid Krivoshein.
prev parent reply other threads:[~2020-08-18 0:13 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-17 22:51 Leonid Krivoshein 2020-08-17 22:59 ` Alexey V. Vissarionov 2020-08-17 23:19 ` Leonid Krivoshein 2020-08-17 23:57 ` Dmitry V. Levin 2020-08-18 0:13 ` Leonid Krivoshein [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=b4348dd2-f174-b479-86fc-66a6d254cba4@gmail.com \ --to=klark.devel@gmail.com \ --cc=devel@lists.altlinux.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
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