How to use admin passwords with "C"

Reply

Join Date: Apr 2007
Posts: 53
Reputation: kxh29 is an unknown quantity at this point 
Solved Threads: 1
kxh29's Avatar
kxh29 kxh29 is offline Offline
Junior Poster in Training

How to use admin passwords with "C"

 
0
  #1
Jul 16th, 2007
Hello All:

I have a question: How can you perform Password Administration using "C-Programming" functions.

Basically, we had UNIX Shell script that performed the following:
1. Got the current users password.
2. Did a time computation on it - had it expired yet, and when it will
3. Queried if the user wanted to change their password.

Well, after the time calculations and other UNIX issues, managment decided that it would be better just to use "C" to do these same functions. Start a C-process, pass the appropriate parameters, and perform the appropriate password processing, if necessary.

Can anyone direct me to where I can get more information on this? I am currently utilizing the AIX 4.3 version of UNIX.

Thanks again, for your help in advance....
"....We will add your Biological and Technological distinctiveness to our Own....Resistance is Futile....You will be Assimilated...."
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,398
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: How to use admin passwords with "C"

 
0
  #2
Jul 16th, 2007
can't you just translate that shell program into c? That is, write a c program that makes the same system calls ?
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 170
Reputation: TkTkorrovi is on a distinguished road 
Solved Threads: 11
TkTkorrovi's Avatar
TkTkorrovi TkTkorrovi is offline Offline
Junior Poster

Re: How to use admin passwords with "C"

 
0
  #3
Jul 16th, 2007
As much as i know, there are no system calls for doing all that in POSIX http://opengroup.org/onlinepubs/007908799 nothing about password expiry. All that can be done though with commands, again i'm not entirely sure whether all of these are POSIX. The shell script likely used commands, and it is not always possible to replace all commands with UNIX functions, there are no equivalent ones for every command. Some of the necessary data is likely in the file etc/shadow
Last edited by TkTkorrovi; Jul 16th, 2007 at 7:26 pm.
Knowledge is regarded by the fool as ignorance, and the things that are profitable are to him hurtful. He liveth in death. -- Thoth the Atlantean
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 53
Reputation: kxh29 is an unknown quantity at this point 
Solved Threads: 1
kxh29's Avatar
kxh29 kxh29 is offline Offline
Junior Poster in Training

Re: How to use admin passwords with "C"

 
0
  #4
Jul 17th, 2007
Originally Posted by TkTkorrovi View Post
As much as i know, there are no system calls for doing all that in POSIX http://opengroup.org/onlinepubs/007908799 nothing about password expiry. All that can be done though with commands, again i'm not entirely sure whether all of these are POSIX. The shell script likely used commands, and it is not always possible to replace all commands with UNIX functions, there are no equivalent ones for every command. Some of the necessary data is likely in the file etc/shadow
Thanks for the Response!

I did happen to find the getuserattr and putuserattr calls in "C". Now I just got to figure out how these gizmo's really work.....

Thanks!
"....We will add your Biological and Technological distinctiveness to our Own....Resistance is Futile....You will be Assimilated...."
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 170
Reputation: TkTkorrovi is on a distinguished road 
Solved Threads: 11
TkTkorrovi's Avatar
TkTkorrovi TkTkorrovi is offline Offline
Junior Poster

Re: How to use admin passwords with "C"

 
0
  #5
Jul 17th, 2007
getuserattr and putuserattr are some solaris functions or such, i found them nowhere in debian. The command usermod can be used to change these attributes. But to read these attributes, the only way seems to be to read the file /etc/shadow, which is not difficult, the format of this file is there: http://www.cyberciti.biz/faq/underst...etcshadow-file
Knowledge is regarded by the fool as ignorance, and the things that are profitable are to him hurtful. He liveth in death. -- Thoth the Atlantean
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC