Subject: Re: Changing user passwd thru a program
To: Sumeet Malhotra <smalhotra@rhapsodynetworks.com>
From: Emiel Kollof <coolvibe@hackerheaven.org>
List: netbsd-users
Date: 04/18/2002 00:43:15
Sumeet Malhotra heeft op woensdag 17 april 2002 om 19:59 het volgende 
geschreven:

> Thanks Steve,
>
> I ran the program as root and it passes that point now! But was 
> wondering
> how does the passwd program change its effective uid to 0. setuid (or
> seteuid) to 0 can only be done if you are a super user. Am I right?

passwd(1) is suid root (like everyone else pointed out), but please _do_ 
be careful not to introduce security vulnerabilities in the code you are 
writing. Please read up on secure programming before you take your trip 
into suid-land. I bet lots of people here can shower you with book 
titles and webpage urls, so I don't :)

Cheers,
Emiel