Ed, Thanks for the information, I was using the qwtsetp API and was looking for a better way. My initial tests with these Unix APIs were promising. In a few places they refer to groups (plural) and I was hoping that the set effective group ID profile accepted an array and I was just dense. The trouble with the qwtsetp API is that you have to change the profile first, and there is no lightweight way (that I know of) to do that. From the information you sent (http://www.opengroup.org/onlinepubs/7908799/xcu/newgrp.html), it looks like the set effective group GID should do what I want, but just one at a time. I can retrieve the GID, which appears to correspond to the GID I set on the profile. When I pass it to the setegid API, it ends up setting my group to *NONE. I am just calling qsysetegid() with a 4-byte integer that contains the GID I get back from getgrname(). Any ideas on whether this will work? David Morris >>> firstname.lastname@example.org 01/31/02 10:43AM >>> David, >Can anyone explain the difference between an effective >user id and a real user id. Same with group. I have been >playing with the qsyseteuid(), qsysetreuid(), and qsysetuid(), >etc. apis and am wondering if anyone can explain their use. These are "Unix" APIs. The related Unix terms have not been incorporated into the OS/400 documentation. The terms for real, effective, and saved user/group ID can be found here: http://www.opengroup.org/onlinepubs/7908799/xbd/ixfile.html >I also wonder why getpwnam() and getgroups() imply that you >can set more than one group id but there doesn't seem to be >an api that allows you to set more than one at a time. It may just >be a typo in the documentation. You are correct that there is no API to just change the groups, but you can change the user ID and all of its groups by using the Set Profile Handle (QWTSETP, QsySetProfileHandle) API. Ed Fishel, edfishel@US.IBM.COM
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.