From: Fernando Rodriguez <cyklonite@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] executing a command as a nologin user
Date: Wed, 13 Jul 2016 07:29:29 -0400 [thread overview]
Message-ID: <b0f2934d-14ef-7fcc-3023-be23879ddf50@gmail.com> (raw)
In-Reply-To: <578621B6.3080001@gmail.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 07/13/2016 07:10 AM, Alan McKinnon wrote:
> On 12/07/2016 03:47, jens w wrote:
>> .procmailrc
>> :0 c
>> * !^X-Loop: name@example.com
>> | formail -X "From:" | $HOME/bin/script.sh
>>
>> procmail.log
>> procmail: Executing " formail -X "From:" | $HOME/bin/script.sh
>>
>> for incoming mail, a script is executed. logfile has the same entry as
>> it is in other users. but the script do nothing.
>>
>> How executing a command as a nologin user?
>>
>
>
> You can't, not the way you are doing it.
> You want to launch a shell script for the user, but the user's shell is /sbin/nologin. This exits immediately without launching the script.
>
> Give the user a real shell.
>
> Alan
>
I've been following this thread and thinking the same thing but wasn't sure.
What if you invoke the shell directly instead of the script, either:
/bin/sh -c "<path to script>" or /bin/sh -c "$(cat <script>)"?
If procmail uses the system() call to launch the script it won't work but if it
uses fork()/exec() or similar I think that it should work.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJXhiYYAAoJEPbOFX/5Ulwcof0P/3KcoZ2vKh7cHoLdR7njoggC
L+4Qpe5Fjs1jM38SUq3RWfiSZrG4rmfmI38uBMQ1yLGN/fU5lhUsjlnLfxCdAYxu
AyoWiEdbFYKN/iIssLdxQgnPxQDmjKJzcVUEIZhJwz+xEV0bjM3eejX0UzjIgoM7
Bx2bqlBe010zva9uvE1msHxz/S7K8KetGBJt8RvXhpYJcQJuYLU3iKyNvBGzzKMx
0dkr0AybZHbgrGqgDCbkZzI9AOx7ydK0TEeeVrMmA/oFSkdJ5hAEhw2tnbt68Adb
2268/QLwswRQ5C5s6r3SRv+xcqaOixvZxjDTahAdEziz60+Gyyv03Edmeeio7rPg
/vCOMjdboTSGPRPKtOJXoHgIMh4aRqY6MA/hC8/h9WuVg9xJN0elCgef4XRN+sUR
GSxb59o2ITvzoxUqu19YmYerS1Ec4lIqdcrVLofHsRBXUNfYrQ73kYgha2YVaqp8
gicY8kKlCKUdztS7tFt+lk6oP1cJhXGj5vxdbncShr6BFWkB63CDb4NNPYGWgKOZ
ly1uZxznw1Stim6p+I2EkY5WsK82EUjmYohiIdW1La1jYc4P43eASrx6suvCXIS0
95cs6qcauFtv4V6wZwnzI2w2T2yHAjAGPvmIwtfn6SgYyE5il8TkrML/EX1n2pDO
5YTP9IuRZE92rOysBo3X
=IkJx
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2016-07-13 11:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 1:47 [gentoo-user] executing a command as a nologin user jens w
2016-07-12 14:17 ` wabe
2016-07-12 20:39 ` jens w
2016-07-12 20:54 ` Neil Bothwick
2016-07-12 21:51 ` jens w
2016-07-12 20:59 ` Alan McKinnon
2016-07-12 21:58 ` jens w
2016-07-13 1:02 ` wabe
2016-07-13 10:31 ` jens w
2016-07-15 13:50 ` Fernando Rodriguez
2016-07-13 11:10 ` Alan McKinnon
2016-07-13 11:29 ` Fernando Rodriguez [this message]
2016-07-13 16:42 ` wabe
2016-07-13 16:50 ` Alan McKinnon
2016-07-13 17:05 ` wabe
2016-07-13 20:41 ` Alan McKinnon
2016-07-13 17:41 ` wabe
2016-07-14 21:19 ` Fernando Rodriguez
2016-07-15 1:36 ` [gentoo-user] " Jonathan Callen
2016-07-15 13:45 ` Fernando Rodriguez
2016-07-15 14:20 ` Fernando Rodriguez
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=b0f2934d-14ef-7fcc-3023-be23879ddf50@gmail.com \
--to=cyklonite@gmail.com \
--cc=gentoo-user@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