| | |
How to use admin passwords with "C"
![]() |
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....
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...."
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
•
•
•
•
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
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...."
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
![]() |
Similar Threads
- Lost Master Password But still Have Admin Password (Mac tips 'n' tweaks)
- What Do I Do With My G4 If I Forgotten Password (Apple Hardware)
- Password lockout (Windows NT / 2000 / XP)
- Wanna know Administrator password.... (Windows NT / 2000 / XP)
Other Threads in the C Forum
- Previous Thread: help on turbo c: creating a truth table please..
- Next Thread: Struct with variable length arrays of struct
| Thread Tools | Search this Thread |
#include adobe api array arrays asterisks binarysearch calculate char cm copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic feet fflush fgets file fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o include incrementoperators input interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix meter microsoft motherboard mqqueue mysql number odf open opensource owf pattern pdf performance pointer posix probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socket socketprograming stack standard string systemcall turboc unix user voidmain() wab win32api windows.h






