xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/misc/cvsuser.c (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1 /* Enable a variable CVSUSER for cvs.  */
2 /* See cvs/subr.c: getcaller().  */
3 
4 #include <stdlib.h>
5 #include <string.h>
6 #include <pwd.h>
7 
getuid(void)8 int getuid (void)
9 {
10   return 0;
11 }
12 
getlogin(void)13 char * getlogin (void)
14 {
15   char *s;
16 
17   s = getenv ("CVSUSER");
18   if (s && *s)
19     return s;
20   s = getenv ("USER");
21   if (s && *s)
22     return s;
23   return NULL;
24 }
25 
getpwnam(const char * name)26 struct passwd * getpwnam (const char *name)
27 {
28   static struct passwd pw;
29   static char namebuf[100];
30 
31   pw.pw_name = strcpy (namebuf, name);
32   pw.pw_passwd = "*";
33   pw.pw_uid = 100;
34   pw.pw_gid = 100;
35   pw.pw_gecos = "";
36   pw.pw_dir = "/";
37   pw.pw_shell = "/bin/sh";
38 
39   return &pw;
40 }
41