Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / misc / cvsuser.c
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
8 int getuid (void)
9 {
10   return 0;
11 }
12
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
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 }