--7ZAtKRhVyVSsbBD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 02, 2002 at 09:19:31PM -0700, David Retz wrote: > passwd that uses PAM complains that it's not running as root, even from > programs that are suid to root. (This includes forked programs that > exec to passwd without invoking the bash 2.0 shell, which apparently > disables suid root when it starts.) setuid programs run with the uid of the invoker, and the euid of whatever its setuid to, this is how passwd knows whether its running as root or a user. > Can anyone suggest a method to change passwords from programs that > aren't logged in as root (i.e., ones that are just suid to root)? Is > passwd the only program that can change the shadow password file > (especially using the MD5 passwords) ? if you setuid(0); in your suid wrapper before running passwd it will then act as if run by root. --=20 Ethan Benson http://www.alaska.net/~erbenson/ --7ZAtKRhVyVSsbBD2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAj0ipkcACgkQJKx7GixEevyHZQCfclYFafPDbh0iSfmMGbon1Snj 8/oAoJqdviOuXYWb+mlrPdCpSm/vw5Pw =5mGn -----END PGP SIGNATURE----- --7ZAtKRhVyVSsbBD2--