Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!maxwell!smw From: smw@maxwell.Concordia.CA ( Steven Winikoff ) Newsgroups: comp.unix.questions Subject: Re: Problem with getuid() -- same as geteuid()?! Message-ID: <1837@clyde.concordia.ca> Date: 2 Feb 90 22:58:35 GMT References: <1836@clyde.concordia.ca> Sender: usenet@clyde.concordia.ca Reply-To: smw@maxwell.Concordia.CA ( Steven Winikoff ) Organization: Concordia University, Montreal Quebec Lines: 38 In article tale@cs.rpi.edu (David C Lawrence) writes: >@opinionated sidebar >I personally loathe getlogin() and programmes that are concerned with >what userid I might have started out as on some pre-su level, so I >won't describe how to do it. One thing you might want to reconsider >is why you are concerned with the userid of the login. When I su to >someone else I want my userid to be that one, not the one that I was. My problem is that there are several people at our site who are legitimately able to su root, working on different projects at the same time (perhaps that's a bad idea, but it's not under my control). In any case, the idea is to find some way to identify our printed output, from within a local customized print program. Several hundred (ok, I'm exaggerating!) listings all marked "root" are, IMHO, less useful than the same listings broken down by our real user name. Perhaps I'm going about this by trying to solve the wrong problem, but that's what I'm looking for. Thoughts? Comments? Ideas? All would be appreciated. >If there was a bug in it then things would have been upchucking all >over the place and people would be up in arms about it. That does make sense, I suppose :-) >geteuid() is >used to get the userid of a setuid executable. getuid() is meant to >return the userid that invoked the programme. For non-setuid >executables they will always return the same number. Thanks for the clarification! ------------------------------------------------------------------------ Steven Winikoff smw@maxwell.concordia.ca Software Analyst Dept. of Computing services Concordia University voice: (514) 848-7619 Montreal, Quebec, Canada (10:00-18:00 EST)