in reply to Can the username be represented differently ?
You may want to look at getpwnam(). Reading the documentation, it appears that if you call it in a scalar context giving it the username, you will get back the UID:
Then you can replace as desired.$uid = getpwnam($name);
As to using the PID (process ID) or GID (group ID), many systems only carry a PID up to a certain value, such as 65535, then wrap back around, so on a busy system you can wrap within a very short time. As to using the GID, this might point you only as far as a group the user was in, but not necessarily down to the particular user, which would not be as helpful should you be trying to track down one of your users accused of spamming.
Hope that helps.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can the username be represented differently ?
by peterr (Scribe) on Jun 28, 2004 at 05:44 UTC | |
by atcroft (Abbot) on Jun 28, 2004 at 05:57 UTC | |
by peterr (Scribe) on Jun 28, 2004 at 06:13 UTC | |
by peterr (Scribe) on Jun 28, 2004 at 06:36 UTC |