HP3000-L Archives

July 1997, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Date:
Thu, 17 Jul 1997 09:05:02 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
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)

ATOM RSS1 RSS2