943,999 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1030
  • C RSS
Jul 16th, 2007
0

How to use admin passwords with "C"

Expand Post »
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....
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
kxh29 is offline Offline
55 posts
since Apr 2007
Jul 16th, 2007
0

Re: How to use admin passwords with "C"

can't you just translate that shell program into c? That is, write a c program that makes the same system calls ?
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Jul 16th, 2007
0

Re: How to use admin passwords with "C"

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.
Reputation Points: 85
Solved Threads: 13
Junior Poster
TkTkorrovi is offline Offline
170 posts
since Mar 2005
Jul 17th, 2007
0

Re: How to use admin passwords with "C"

Click to Expand / Collapse  Quote originally posted by TkTkorrovi ...
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!
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
kxh29 is offline Offline
55 posts
since Apr 2007
Jul 17th, 2007
0

Re: How to use admin passwords with "C"

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
Reputation Points: 85
Solved Threads: 13
Junior Poster
TkTkorrovi is offline Offline
170 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: help on turbo c: creating a truth table please..
Next Thread in C Forum Timeline: Struct with variable length arrays of struct





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC