Re: Determining whether shadow passwords are enabled?

From: Jem Berkes (jb2002_padding_@pc9.org)
Date: 05/31/02


From: Jem Berkes <jb2002_padding_@pc9.org>
Date: Thu, 30 May 2002 23:45:25 GMT


> How can I determine in my C program whether shadow passwords are
> enabled? I need to know whether I should call getpwnam() or
> getspnam() to obtain the encrypted password for a given user. Right
> now, I call getpwnam, and if the password is "x", I call getspnam(),
> but I know this is not a good technique.

You could check to see if /etc/shadow exists. Unless you're root though,
you won't be able to actually read the file.

-- 
Jem E. Berkes
Student IEEE (Winnipeg)

http://www.pc-tools.net/ Windows, Linux & UNIX software



Relevant Pages

  • Re: Determining whether shadow passwords are enabled?
    ... > How can I determine in my C program whether shadow passwords are ... > getspnam() to obtain the encrypted password for a given user. ... > now, I call getpwnam, and if the password is "x", I call getspnam, ... Windows, Linux & UNIX software ...
    (comp.os.linux.security)
  • Determining whether shadow passwords are enabled?
    ... How can I determine in my C program whether shadow passwords are ... getspnam() to obtain the encrypted password for a given user. ... now, I call getpwnam, and if the password is "x", I call getspnam, ... but I know this is not a good technique. ...
    (comp.os.linux.security)
  • Determining whether shadow passwords are enabled?
    ... How can I determine in my C program whether shadow passwords are ... getspnam() to obtain the encrypted password for a given user. ... now, I call getpwnam, and if the password is "x", I call getspnam, ... but I know this is not a good technique. ...
    (comp.os.linux.security)
  • Re: Authenticate a User.
    ... > is not running as root. ... on getpwnam() + crypt for password information. ... If you want to support shadow passwords, take a look at the "Linux ... > That is because the salt may be longer than 2 characters. ...
    (comp.os.linux.development.apps)