diff options
author | peter <peter@FreeBSD.org> | 1997-06-22 10:55:49 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-06-22 10:55:49 +0000 |
commit | 571cfa0005d94d99d1341bf8ab02be04d4df5f9f (patch) | |
tree | 8684660dbfd105deed9a44c9e97d4f56b231fac1 /contrib/cvs/src/subr.c | |
parent | fc35590c6dddf32e1fa855b541dc28a23965f90c (diff) | |
download | FreeBSD-src-571cfa0005d94d99d1341bf8ab02be04d4df5f9f.zip FreeBSD-src-571cfa0005d94d99d1341bf8ab02be04d4df5f9f.tar.gz |
Import cvs-1.9.10
Diffstat (limited to 'contrib/cvs/src/subr.c')
-rw-r--r-- | contrib/cvs/src/subr.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/contrib/cvs/src/subr.c b/contrib/cvs/src/subr.c index a098123..d29942b 100644 --- a/contrib/cvs/src/subr.c +++ b/contrib/cvs/src/subr.c @@ -234,11 +234,13 @@ numdots (s) return (dots); } -/* - * Get the caller's login from his uid. If the real uid is "root" try LOGNAME - * USER or getlogin(). If getlogin() and getpwuid() both fail, return - * the uid as a string. - */ +/* Return the username by which the caller should be identified in + CVS, in contexts such as the author field of RCS files, various + logs, etc. + + Returns a pointer to storage that we manage; it is good until the + next call to getcaller () (provided that the caller doesn't call + getlogin () or some such themself). */ char * getcaller () { @@ -247,6 +249,16 @@ getcaller () char *name; uid_t uid; + /* If there is a CVS username, return it. */ +#ifdef AUTH_SERVER_SUPPORT + if (CVS_Username != NULL) + return CVS_Username; +#endif + + /* Get the caller's login from his uid. If the real uid is "root" + try LOGNAME USER or getlogin(). If getlogin() and getpwuid() + both fail, return the uid as a string. */ + uid = getuid (); if (uid == (uid_t) 0) { |