summaryrefslogtreecommitdiff
path: root/net/rmsg/files/patch-ab
blob: bc83dd37e9c3ccf2b635dc7de4351f46b1c64e5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
*** parser.c	Sat Jun 26 17:04:41 1993
--- parser.c	Tue Apr 23 17:26:30 2013
***************
*** 11,22 ****
   * Last modified: Sat Aug 20 18:47:54 1988
   */
  
  #include <stdio.h>
! #if defined(SVR4)
! # include <string.h>
! #else
! # include <strings.h>
! #endif /* SVR4 */
  #include <pwd.h>
  #include <ctype.h>
  #include <sys/types.h>
--- 11,19 ----
   * Last modified: Sat Aug 20 18:47:54 1988
   */
  
+ #include <stdlib.h>
  #include <stdio.h>
! #include <string.h>
  #include <pwd.h>
  #include <ctype.h>
  #include <sys/types.h>
***************
*** 71,79 ****
  
  /* end of config params */
  
- struct passwd *getpwnam();
- char *malloc();
- 
  extern char *progname;
  extern int debug;
  
--- 68,73 ----
***************
*** 89,94 ****
--- 83,89 ----
  char *user;
  {
       struct passwd *pwd;
+      uid_t  nobody;
       static char line[LINE_LEN];
       static char config[PATHLEN];
  
***************
*** 107,119 ****
       a->next = 0;
       cur_ali = aliases = a;
  
       if (!(pwd = getpwnam(user)))
            return(ERR_UNK_USER);
  
       if (root) {
            (void) setgid (pwd->pw_gid);
            if (setuid (pwd->pw_uid) == -1)
! 	       (void) setuid(NOBODY);
       }
  
       (void) strcpy (home, pwd->pw_dir);
--- 102,119 ----
       a->next = 0;
       cur_ali = aliases = a;
  
+      if (!(pwd = getpwnam("nobody")))
+ 	  exit(67);
+ 
+      nobody = pwd->pw_uid;
+ 
       if (!(pwd = getpwnam(user)))
            return(ERR_UNK_USER);
  
       if (root) {
            (void) setgid (pwd->pw_gid);
            if (setuid (pwd->pw_uid) == -1)
! 	       (void) setuid(nobody);
       }
  
       (void) strcpy (home, pwd->pw_dir);