Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Sep 2009 13:15:28 -0700
From:      Chris Cowart <ccowart@rescomp.berkeley.edu>
To:        bsd <bsd@todoo.biz>
Cc:        Liste FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: sudo script not executing
Message-ID:  <20090911201527.GE37291@hal.rescomp.berkeley.edu>
In-Reply-To: <08AA332C-6F99-4B28-B391-92616C0602F1@todoo.biz>
References:  <08AA332C-6F99-4B28-B391-92616C0602F1@todoo.biz>

next in thread | previous in thread | raw e-mail | index | archive | help

--XaUbO9McV5wPQijU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

bsd wrote:
> I have an sh script that is called by the "www" process which has a =20
> shell that defaults to /sbin/nologin
>=20
> I have configured the sudoers file with these settings:
>=20
> www ALL=3D(www) NOPASSWD: /usr/local/bin/postfixadmin-domain-=20
> postdeletion.sh
>=20
>=20
> And It does not seem to be able to execute?
>=20
>=20
> > Sorry, user www is not allowed to execute '/usr/local/bin/=20
> > postfixadmin-mailbox-postdeletion.sh y@test.com test.com' as www on new=
mail.rmm.fr=20
> > .
> >
>=20
>=20
> The file I am trying to delete is also owned by a non privileged =20
> user? ??

The user www is www, so you shouldn't need to sudo to run as that
account. Did you mean to setup the rule for the postfix user? Or a
postfix target account?

That said, I think what you typed should have worked. You shouldn't have
seen "www is not allowed to execute ... as www", because your sudoers
file says otherwise.

Assuming your account has full sudo, what do you see if you type:
  $ sudo -u www sudo -l

Hopefully, because of the NOPASSWD in there, you won't have to produce
www's password.

Is your script (postfixadmin-domain-postdeletion.sh) readable and
executable by user www?

Do you have any trailing characters or something on the line with your
sudo rule which might make sudo think you've typed a literal command
with arguments instead of a command that can be run with arbitrary
arguments?

--=20
Chris Cowart
Network Technical Lead
Network & Infrastructure Services, RSSP-IT
UC Berkeley

--XaUbO9McV5wPQijU
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (FreeBSD)

iQIcBAEBAwAGBQJKqq/fAAoJEC8b9sM8ejXtcX0P/iZmSAJ5GA7VM5lwlgzAMsko
537+hQ5qPPRTtob0dVZZ/4sC3K3/NeAYsPtddlU0iFUH+bMOeg16fL3wB2tKPUMk
JskQ5+5oRlVrg+GUAnR/cBk1o5xpvl0A1lZEf91er6pXQMoQ/PfvlLb3EIlxUIr4
XmqDI76uvsupGJV9NW+WY1nRcWKt1Hfej0tG/XhW2TjG7W4rtozDXZeHrzofqwK7
juIARwPpjIaRfx4pyeenJennI4kMcTy6Zsk4yzbmJKXSSSjTNhzaNdAuEX2qG9g5
TEM5ZivMZsvbwfY+UQnDOvcKurJUJITze6RzUDQ93edLn0eTHNWfYTf0zw/hw+bB
7UODrZQW5p+D4Bc60wIrMC+5SzjiQifqCGHkJye4n3Qjmp/hqbvaIMkWARwswig/
0rDJBsWXMTeBH9X5qemWutvwFiK2vCsFX71Vpo0Wva+vgnNC3iLaj9MYdESf0Ji/
XSyNmbvy356OMZrayPfrzrr2+KKwl+rhe0qVvZ7NkSlvbHOx4xJX0TDukEtixgC3
MGXaTq6+gkqZy6B8fBygHndstU6xXLKfWfbr9nCt+H/uTR3CQreAiMzDI4E2yklN
2/SJ9tvQpfspIKhoYK/euKDVNMsKluo0cCCahTLvZ6+ZY0r0xq/xPjYBqonN3phf
NLeVrhjmkETF+ACKorIP
=ubL/
-----END PGP SIGNATURE-----

--XaUbO9McV5wPQijU--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090911201527.GE37291>