home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sun / misc / 6205 < prev    next >
Encoding:
Internet Message Format  |  1993-01-10  |  1.2 KB

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!usc!sol.ctr.columbia.edu!ira.uka.de!Germany.EU.net!b.marco.de!krabat!louis
  2. From: louis@krabat.marco.de (Ju"rgen Fluk)
  3. Newsgroups: comp.sys.sun.misc
  4. Subject: /usr/5bin/cc: initgroups() bug ?
  5. Message-ID: <1521@krabat.marco.de>
  6. Date: 8 Jan 93 12:18:58 GMT
  7. Organization: marco GmbH, D-8047 Karlsfeld
  8. Lines: 20
  9.  
  10. Is there a patch for /usr/5bin/cc on SunOS 4.1.2 concerning initgroups() ?
  11.  
  12. It seems like the routine is setting up an array of "int" and passing this
  13. down to setgroups(), which expects an array of "gid_t" (short) [see TFM].
  14. Result: /bin/id shows one out of two groups set to "0(wheel)".
  15.  
  16. Example: my setting is
  17.     uid=142(louis) gid=52(entw) groups=52(entw),6(mail),59(verw),99(sw)
  18. Running a programm with initgroups() compiled by /usr/5bin/cc gives
  19.     uid=142(louis) gid=52(entw) groups=0(wheel),52(entw),0(wheel),6(mail)
  20. [groups 52 and 6 appear as 2nd and 4th entry, groups 59 and 99 discarded]
  21.  
  22. My workaround re-implements initgroups() (scanning /etc/group with
  23. getgrent() and calling setgroups()).
  24.  
  25. Any comments ?
  26.   louis
  27. -- 
  28. louis@marco.de        in real life: Ju"rgen Fluk
  29. ..!unido!marco!louis    marco GmbH, 8047 Karlsfeld    tel: +49 8131 90020
  30.