home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!levell.austin.ibm.com!julie
- From: julie@levell.austin.ibm.com (Julie L. Craft)
- Newsgroups: comp.unix.aix
- Subject: Re: problem with putuserpw subroutine
- Message-ID: <1992Jul28.163737.29750@awdprime.austin.ibm.com>
- Date: 28 Jul 92 16:37:37 GMT
- References: <1992Jul23.225734.9999@slate.mines.colorado.edu>
- Sender: news@awdprime.austin.ibm.com (USENET News)
- Organization: IBM, Austin
- Lines: 69
-
- In article <1992Jul23.225734.9999@slate.mines.colorado.edu> bware@slate.mines.colorado.edu (Bob Ware) writes:
- >Has anyone had success using the putuserpw subroutine?
- >
- >The getuserpw subroutine seems to work as advertised, but the putuserpw
- >routine always bombs with errno pointing to:
- >
- > Only the owner or a privileged user can perform the operation.
- >
- >This even happens when the struct provided as the argument for the
- >routine is what is returned from getuserpw, so I know it is not a
- >problem with the contents of the struct.
- >
- >For example, the following program:
- >
- > #include <userpw.h>
- > #include <errno.h>
-
- #include <usersec.h>
-
- > main()
- > {
- > struct userpw *pwptr;
-
- /* update /etc/security/passwd */
- setpwdb (S_READ | S_WRITE );
-
- >
- > perror("before getuserpw");
- > pwptr = getuserpw("studente");
- > perror("after getuserpw");
- > putuserpw(pwptr);
- > perror("after putuserpw");
-
- endpwdb();
-
- > }
- >
- >produces the following output when run as 'root':
- >
- > before getuserpw: Error 0
- > after getuserpw: Error 0
- > after putuserpw: Only the owner or a privileged user can perform the operation.
- >
- >Yes, root has write permission for /etc/security/passwd. This happens
- >when run on both AIX 3.1.6 and 3.2.0.
- >
- >Is this a bug in AIX???
-
-
- No, you need to set up the "database" to be able to
- READ and WRITE to it. By default, if you don't call setpwdb,
- then you get READ access.
-
- >
- >--
- >Bob Ware, System Administrator
- >Computing and Networking, Colorado School of Mines, Golden, Co 80401, USA
- >(303) 273-3987
- >bware@mines.colorado.edu bware@mines.bitnet
-
- Let me know if this doesn't work for you.
-
- Later,
- Julie
- --
- *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
- Julie Levell Craft IBM AUSTIN,TX Internet: julie@aixwiz.austin.ibm.com
- IBMNET: JULIEL at AUSVM6 2F-007/903 (512) 838-2677 (Tie 678-2677)
- "I'm not getting defensive!"
-