home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8282 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  2.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!levell.austin.ibm.com!julie
  2. From: julie@levell.austin.ibm.com (Julie L. Craft)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: problem with putuserpw subroutine
  5. Message-ID: <1992Jul28.163737.29750@awdprime.austin.ibm.com>
  6. Date: 28 Jul 92 16:37:37 GMT
  7. References: <1992Jul23.225734.9999@slate.mines.colorado.edu>
  8. Sender: news@awdprime.austin.ibm.com (USENET News)
  9. Organization: IBM, Austin
  10. Lines: 69
  11.  
  12. In article <1992Jul23.225734.9999@slate.mines.colorado.edu> bware@slate.mines.colorado.edu (Bob Ware) writes:
  13. >Has anyone had success using the putuserpw subroutine?  
  14. >
  15. >The getuserpw subroutine seems to work as advertised, but the putuserpw
  16. >routine always bombs with errno pointing to:
  17. >
  18. >    Only the owner or a privileged user can perform the operation.
  19. >
  20. >This even happens when the struct provided as the argument for the
  21. >routine is what is returned from getuserpw, so I know it is not a
  22. >problem with the contents of the struct.
  23. >
  24. >For example, the following program:
  25. >
  26. >    #include <userpw.h>
  27. >    #include <errno.h>
  28.  
  29.     #include <usersec.h>
  30.  
  31. >    main()
  32. >    {
  33. >        struct userpw *pwptr;
  34.  
  35.             /* update /etc/security/passwd */
  36.             setpwdb (S_READ | S_WRITE );
  37.  
  38. >    
  39. >        perror("before getuserpw");
  40. >        pwptr = getuserpw("studente");
  41. >        perror("after getuserpw");
  42. >        putuserpw(pwptr);
  43. >        perror("after putuserpw");
  44.  
  45.             endpwdb();
  46.  
  47. >    }
  48. >
  49. >produces the following output when run as 'root':
  50. >
  51. >    before getuserpw: Error 0
  52. >    after getuserpw: Error 0
  53. >    after putuserpw: Only the owner or a privileged user can perform the operation.
  54. >
  55. >Yes, root has write permission for /etc/security/passwd.  This happens
  56. >when run on both AIX 3.1.6 and 3.2.0.
  57. >
  58. >Is this a bug in AIX???
  59.  
  60.  
  61.     No, you need to set up the "database" to be able to 
  62.     READ and WRITE to it.  By default, if you don't call setpwdb,
  63.     then you get READ access.
  64.  
  65. >
  66. >-- 
  67. >Bob Ware, System Administrator 
  68. >Computing and Networking, Colorado School of Mines, Golden, Co 80401, USA
  69. >(303) 273-3987
  70. >bware@mines.colorado.edu bware@mines.bitnet
  71.  
  72.     Let me know if this doesn't work for you.
  73.  
  74. Later,
  75. Julie
  76. -- 
  77. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
  78. Julie Levell Craft IBM AUSTIN,TX  Internet: julie@aixwiz.austin.ibm.com
  79. IBMNET: JULIEL at AUSVM6 2F-007/903  (512) 838-2677 (Tie 678-2677)
  80. "I'm not getting defensive!"
  81.