]> git.pld-linux.org Git - packages/arpd.git/blob - arpd-uid.patch
- updated - uses device in /var/lib/arpd now
[packages/arpd.git] / arpd-uid.patch
1 --- ./arpd.c.orig       Tue Jul 17 18:46:39 2001
2 +++ ./arpd.c    Fri Jul 27 20:32:06 2001
3 @@ -74,11 +74,15 @@
4  
5         openlog ("arpd", LOG_PID | LOG_CONS, LOG_DAEMON);
6  
7 -       syslog(LOG_NOTICE, "Initializing, version %s\n", ARPD_VERSION);
8 +       syslog(LOG_NOTICE, "Initializing, PLD-modified version %s\n", ARPD_VERSION);
9  
10 -       fd = open("/dev/arpd", O_RDWR);
11 +       fd = open("/var/lib/arpd/arpd", O_RDWR);
12 +/* You need to have user UID=40 in your system. There is needed to make checking
13 + * that "little" thing. */
14 +       setuid(40);
15 +       
16         if (fd < 0) {
17 -               syslog(LOG_CRIT, "cannot open /dev/arpd: %m");
18 +               syslog(LOG_CRIT, "cannot open /var/lib/arpd/arpd: %m");
19                 exit(-1);
20         }
21  
22 @@ -89,12 +93,12 @@
23                 if (status < 0) {
24                         if (errno == EINTR)
25                                 continue;
26 -                       syslog(LOG_CRIT, "cannot read from /dev/arpd: %m");
27 +                       syslog(LOG_CRIT, "cannot read from /var/lib/arpd/arpd: %m");
28                         exit(-1);
29                 }
30                 if (status != sizeof(req))
31                 {
32 -                       syslog(LOG_CRIT, "read from /dev/arpd returns %d",
33 +                       syslog(LOG_CRIT, "read from /var/lib/arpd/arpd returns %d",
34                                  status);
35                         exit(-1);
36                 }
37 @@ -115,12 +119,12 @@
38                         status = write(fd, rep, sizeof(*rep));
39                         if (status < 0) {
40                                  syslog(LOG_CRIT,
41 -                                       "cannot write to /dev/arpd: %m");
42 +                                       "cannot write to /var/lib/arpd/arpd: %m");
43                                 exit(-1);
44                         }
45                         if (status != sizeof(*rep)) {
46                                 syslog(LOG_CRIT, 
47 -                                       "write to /dev/arpd returns %d",
48 +                                       "write to /var/lib/arpd/arpd returns %d",
49                                          status);
50                                 exit(-1);
51                         }
This page took 0.117151 seconds and 4 git commands to generate.