Reiner Hutsch writes:
> i have a background process on our HP3000 running, which serves as a
> listener on a sockets connection.
> PC processes connect to the listener process which in turn forks() for
> each PC user to perform DB queries and updates for the user. The
> listener process runs as MANAGER.SYS.
> My problem is that i would like to have the forked process run with the
> user-id / account of the connecting user.
> Is it possible to let the program change the user-id from MANAGER.SYS to
> <user.acct>?
After the fork() you can do this to change the userid:
GETPRIVMODE();
setuid(new_uid);
GETUSERMODE();
You should only do this after careful validation of the new_uid to make sure
the PC isn't trying to gain access to unauthorized users.
--
Mark Bixby E-mail: [log in to unmask]
Coast Community College Dist. Web: http://www.cccd.edu/~markb/
District Information Services 1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)