]>
Commit | Line | Data |
---|---|---|
c763e8c1 | 1 | diff -Nur getty_ps-2.0.7j/Makefile getty_ps-2.0.7j.pld/Makefile |
2 | --- getty_ps-2.0.7j/Makefile Tue Jan 23 17:07:04 1996 | |
3 | +++ getty_ps-2.0.7j.pld/Makefile Thu Jun 10 16:34:45 1999 | |
4 | @@ -8,22 +8,23 @@ | |
5 | # be expected in /etc/conf.* rather than /etc/default, modem locks | |
6 | # will be created in /var/lock, and binaries will go in /sbin. | |
7 | # | |
8 | -# FSSTND=-DFSSTND | |
9 | +FSSTND=-DFSSTND | |
10 | ||
11 | SHELL= /bin/sh | |
12 | CC= gcc | |
13 | ||
14 | #CFLAGS= -g -fpcc-struct-return ${FSSTND} | |
15 | #LFLAGS= -g | |
16 | -CFLAGS= -O3 -fomit-frame-pointer -fpcc-struct-return ${FSSTND} | |
17 | +CFLAGS= $(OPT) -fpcc-struct-return ${FSSTND} | |
18 | LFLAGS= -s | |
19 | ||
20 | -LIBS= -ltermcap | |
21 | +LIBS= -lcurses | |
22 | LLIBS= | |
23 | ||
24 | # where things go | |
25 | -BIN= /sbin | |
26 | -UUBIN= /sbin | |
27 | +BIN= $(TOPDIR)/sbin | |
28 | +UUBIN= $(TOPDIR)/sbin | |
29 | +MANDIR= $(TOPDIR)/usr/share/man/man | |
30 | ||
31 | # what are we making | |
32 | SRC= main.c funcs.c defaults.c table.c utmp2.c | |
33 | @@ -48,9 +49,15 @@ | |
34 | install: | |
35 | -mv $(BIN)/getty $(BIN)/getty- | |
36 | -mv $(UUBIN)/uugetty $(UUBIN)/uugetty- | |
37 | - -cp getty $(BIN) | |
38 | - -cp uugetty $(UUBIN) | |
39 | - chmod 700 $(BIN)/getty $(UUBIN)/uugetty | |
40 | + -install -s -m 0755 getty $(BIN) | |
41 | + -install -s -m 0755 uugetty $(UUBIN) | |
42 | +ifdef FSSTND | |
43 | + mv man/getty.1 man/getty.1x | |
44 | + cat man/getty.1x |\ | |
45 | + sed -e 's,/etc/default/,/etc/conf.,g'> man/getty.1 | |
46 | +endif | |
47 | + install -m 644 man/getty.1 $(MANDIR)1 | |
48 | + install -m 644 man/gettydefs.5 $(MANDIR)5 | |
49 | ||
50 | clean: | |
51 | rm -f *.o core *.out *~ .depend Make.Log Makefile.old | |
52 | diff -Nur getty_ps-2.0.7j/config.h getty_ps-2.0.7j.pld/config.h | |
53 | --- getty_ps-2.0.7j/config.h Sat May 21 07:11:24 1994 | |
54 | +++ getty_ps-2.0.7j.pld/config.h Thu Jun 10 16:30:28 1999 | |
55 | @@ -27,14 +27,14 @@ | |
56 | #define index strchr /* use these instead */ | |
57 | #define rindex strrchr | |
58 | ||
59 | -typedef void sig_t; | |
60 | +/*typedef void sig_t;*/ | |
61 | ||
62 | #ifndef UTMP_FILE | |
63 | -#define UTMP_FILE "/etc/utmp" /* name of the utmp file */ | |
64 | +#define UTMP_FILE "/var/run/utmpx" /* name of the utmp file */ | |
65 | #endif /* UTMP_FILE */ | |
66 | ||
67 | #ifndef WTMP_FILE | |
68 | -#define WTMP_FILE "/var/adm/wtmp" /* FSSTND compliant wtmp file */ | |
69 | +#define WTMP_FILE "/var/log/wtmpx" /* FSSTND compliant wtmp file */ | |
70 | #endif /* WTMP_FILE */ | |
71 | ||
72 | #if 0 | |
73 | @@ -46,8 +46,8 @@ | |
74 | ||
75 | #define ASCIIPID /* PID stored in ASCII */ | |
76 | #define BOTHPID /* ... or perhaps not */ | |
77 | -#define UUCPID 11 /* uid of UUCP account */ | |
78 | -#define LOCK "/usr/spool/uucp/LCK..%s" /* lock file name */ | |
79 | +#define UUCPID "uucp" /* uid of UUCP account */ | |
80 | +#define LOCK "/var/lock/LCK..%s" /* lock file name */ | |
81 | ||
82 | ||
83 | ||
84 | diff -Nur getty_ps-2.0.7j/extern.h getty_ps-2.0.7j.pld/extern.h | |
85 | --- getty_ps-2.0.7j/extern.h Tue May 17 05:38:52 1994 | |
86 | +++ getty_ps-2.0.7j.pld/extern.h Thu Jun 10 16:30:28 1999 | |
87 | @@ -38,12 +38,7 @@ | |
88 | /* Global variables | |
89 | */ | |
90 | ||
91 | -#ifdef MAIN | |
92 | EXTERN char MsgBuf[80]; /* message buffer */ | |
93 | -#else | |
94 | -EXTERN char MsgBuf[]; | |
95 | -#endif /* MAIN */ | |
96 | - | |
97 | EXTERN boolean AutoBaud; /* autobauding requested? */ | |
98 | EXTERN char AutoRate[16]; /* AutoBaud digits buffer */ | |
99 | EXTERN boolean Check; /* check a gettytab file? */ | |
100 | @@ -79,10 +74,6 @@ | |
101 | extern unsigned alarm(), sleep(); | |
102 | extern time_t time(); | |
103 | #endif | |
104 | - | |
105 | -#ifndef STRDUP /* Is There In Truth No Strdup() ? */ | |
106 | -extern char *strdup(); | |
107 | -#endif /* STRDUP */ | |
108 | ||
109 | #ifndef GETUTENT /* How about getutent() ? */ | |
110 | extern struct utmp *getutent(); | |
111 | diff -Nur getty_ps-2.0.7j/funcs.c getty_ps-2.0.7j.pld/funcs.c | |
112 | --- getty_ps-2.0.7j/funcs.c Tue May 17 09:33:36 1994 | |
113 | +++ getty_ps-2.0.7j.pld/funcs.c Thu Jun 10 16:30:28 1999 | |
114 | @@ -70,7 +70,7 @@ | |
115 | char c, n, tbuf[16], ubuf[32]; | |
116 | time_t clock; | |
117 | struct tm *lt, *localtime(); | |
118 | - char *month_name[] = { "January", "February", "March", "April", | |
119 | +static char *month_name[] = { "January", "February", "March", "April", | |
120 | "May", "June", "July", "August", "September", | |
121 | "October", "November", "December" }; | |
122 | ||
123 | @@ -226,8 +226,15 @@ | |
124 | ||
125 | /* set c_cc[] chars to reasonable values | |
126 | */ | |
127 | +#ifdef _POSIX_VDISABLE | |
128 | +#if _POSIX_VDISABLE != -1 | |
129 | for (i=0; i < NCC; i++) | |
130 | - setterm.c_cc[i] = CNUL; | |
131 | + setterm.c_cc[i] = _POSIX_VDISABLE; | |
132 | +#else | |
133 | + for (i=0; i < NCC; i++) | |
134 | + setterm.c_cc[i] = 0; | |
135 | +#endif | |
136 | +#endif | |
137 | setterm.c_cc[VINTR] = Cintr; | |
138 | setterm.c_cc[VQUIT] = CQUIT; | |
139 | setterm.c_cc[VERASE] = Cerase; | |
140 | @@ -402,6 +409,7 @@ | |
141 | } | |
142 | ||
143 | while ((ch = *s++)) { | |
144 | + int i; | |
145 | if (ch == '\\') { | |
146 | switch (*s) { | |
147 | case 'p': /* '\p' == pause */ | |
148 | @@ -424,20 +432,22 @@ | |
149 | break; | |
150 | } | |
151 | } | |
152 | - sprintf(MsgBuf + strlen(MsgBuf), ch < ' ' ? "^%c" : "%c", | |
153 | + /* check if we have enough room for Msg */ | |
154 | + if ((i=strlen(MsgBuf))>sizeof(MsgBuf)-3) { | |
155 | + debug(D_INIT, MsgBuf); | |
156 | + MsgBuf[i=0] = '\0'; | |
157 | + } | |
158 | + sprintf(MsgBuf + i, ch < ' ' ? "^%c" : "%c", | |
159 | ch < ' ' ? ch | 0100 : ch); | |
160 | if (putc(ch, stdout) == EOF) { | |
161 | retval = FAIL; | |
162 | break; | |
163 | } | |
164 | } | |
165 | - strcat(MsgBuf, ") -- "); | |
166 | if(retval == SUCCESS) | |
167 | - strcat(MsgBuf, "OK"); | |
168 | + debug(D_INIT, "%s) -- OK", MsgBuf); | |
169 | else | |
170 | - sprintf(MsgBuf + strlen(MsgBuf), | |
171 | - "Failed: %s", strerror(errno)); | |
172 | - debug(D_INIT, MsgBuf); | |
173 | + debug(D_INIT, "%s) -- Failed: %s", MsgBuf, strerror(errno)); | |
174 | return(retval); | |
175 | } | |
176 | ||
177 | @@ -456,7 +466,7 @@ | |
178 | register int expfail = EXPFAIL; | |
179 | register retval = FAIL; | |
180 | char ch, *p, word[MAXLINE+1], buf[MAXBUF]; | |
181 | - sig_t (*oldalarm)() = NULL; | |
182 | + sig_t oldalarm = NULL; | |
183 | ||
184 | if (strequal(s, "\"\"")) { /* ("") used as a place holder */ | |
185 | debug(D_INIT, "EXPECT: ([nothing])"); | |
186 | @@ -465,7 +475,7 @@ | |
187 | ||
188 | /* look for escape chars in expected word | |
189 | */ | |
190 | - for (p = word; (ch = (*s++ & 0177));) { | |
191 | + for (p = word; (ch = (*s++ & 0177)) && p<&word[MAXLINE+1];) { | |
192 | if (ch == '\\') { | |
193 | if (*s == 'A') { /* spot for AutoBaud digits */ | |
194 | *p++ = AUTOBD; | |
195 | @@ -495,12 +505,24 @@ | |
196 | oldalarm = signal(SIGALRM, expalarm); | |
197 | (void) alarm((unsigned) expfail); | |
198 | ||
199 | - sprintf(MsgBuf, "EXPECT: <%d> (%s), GOT: ", expfail, dprint(word)); | |
200 | + debug(D_INIT, "EXPECT: <%d> (%s)", expfail, dprint(word)); | |
201 | ||
202 | + MsgBuf[0] = '\0'; | |
203 | p = buf; | |
204 | while ((ch = getc(stdin)) != EOF) { | |
205 | - sprintf(MsgBuf + strlen(MsgBuf), ch < ' ' ? "^%c" : "%c", | |
206 | + /* check if we have enough room for Msg */ | |
207 | + if ((i=strlen(MsgBuf))>sizeof(MsgBuf)-3) { | |
208 | + debug(D_INIT, "GOT: %s", MsgBuf); | |
209 | + MsgBuf[i=0] = '\0'; | |
210 | + } | |
211 | + sprintf(MsgBuf + i, ch < ' ' ? "^%c" : "%c", | |
212 | ch < ' ' ? ch | 0100 : ch); | |
213 | + /* check if we have enough room */ | |
214 | + if (p==&buf[MAXBUF]) { | |
215 | + /* oops, move back HALF the buffer */ | |
216 | + p = &buf[MAXBUF/2]; | |
217 | + strcpy(buf,p); | |
218 | + } | |
219 | *p++ = (char) ((int) ch & 0177); | |
220 | *p = '\0'; | |
221 | if (strlen(buf) >= strlen(word)) { | |
222 | @@ -515,7 +537,7 @@ | |
223 | } | |
224 | (void) alarm((unsigned) 0); | |
225 | (void) signal(SIGALRM, oldalarm); | |
226 | - debug(D_INIT, "%s -- %s", MsgBuf, | |
227 | + debug(D_INIT, "GOT: %s -- %s", MsgBuf, | |
228 | (retval == SUCCESS) ? "got it" : "Failed"); | |
229 | return(retval); | |
230 | } | |
231 | @@ -563,8 +585,7 @@ | |
232 | ** expalarm() - called when expect()'s SIGALRM goes off | |
233 | */ | |
234 | ||
235 | -sig_t | |
236 | -expalarm() | |
237 | +sig_t expalarm(int sig) | |
238 | { | |
239 | longjmp(env, 1); | |
240 | } | |
241 | @@ -647,7 +668,7 @@ | |
242 | } | |
243 | if (ch == Erase) { | |
244 | if (count) { | |
245 | - (void) fputs((Erase == '\010' ? | |
246 | + (void) fputs((Erase == '\b' ? | |
247 | " \b" : "\b \b"), stdout); | |
248 | (void) fflush(stdout); | |
249 | --p; | |
250 | @@ -814,10 +835,14 @@ | |
251 | { | |
252 | char *p, *fmt, ch; | |
253 | static char msg[1024]; | |
254 | + int i = 0 ; | |
255 | ||
256 | msg[0] = '\0'; | |
257 | p = word; | |
258 | while ((ch = *p++)) { | |
259 | + /* is the buffer big enough */ | |
260 | + if ((i=strlen(msg)) > sizeof(msg)-7) | |
261 | + break; | |
262 | if (ch == AUTOBD) { | |
263 | strcat(msg, "[speed]"); | |
264 | continue; | |
265 | @@ -827,7 +852,7 @@ | |
266 | } else { | |
267 | fmt = "%c"; | |
268 | } | |
269 | - sprintf(msg + strlen(msg), fmt, ch); | |
270 | + sprintf(msg + i, fmt, ch); | |
271 | } | |
272 | return(msg); | |
273 | } | |
274 | Binary files getty_ps-2.0.7j/getty and getty_ps-2.0.7j.pld/getty differ | |
275 | diff -Nur getty_ps-2.0.7j/getty.h getty_ps-2.0.7j.pld/getty.h | |
276 | --- getty_ps-2.0.7j/getty.h Tue May 17 05:39:06 1994 | |
277 | +++ getty_ps-2.0.7j.pld/getty.h Thu Jun 10 16:30:28 1999 | |
278 | @@ -39,7 +39,6 @@ | |
279 | #include "config.h" | |
280 | #include "extern.h" | |
281 | #include "funcs.h" | |
282 | -#include "mytermio.h" /* SMR - gcc was missing a few definitions */ | |
283 | ||
284 | /* General purpose defines | |
285 | */ | |
286 | diff -Nur getty_ps-2.0.7j/main.c getty_ps-2.0.7j.pld/main.c | |
287 | --- getty_ps-2.0.7j/main.c Fri Apr 26 19:26:03 1996 | |
288 | +++ getty_ps-2.0.7j.pld/main.c Thu Jun 10 16:30:28 1999 | |
289 | @@ -82,8 +82,9 @@ | |
290 | long sec, usec; | |
291 | struct sigaction act; | |
292 | ||
293 | + memset(&act, 0, sizeof(struct sigaction)); | |
294 | act.sa_handler = action; | |
295 | - act.sa_mask = 0; | |
296 | + sigemptyset(&act.sa_mask); | |
297 | act.sa_flags = SA_NOMASK; /* allow own signal to be received */ | |
298 | if(sigaction(SIGALRM, &act, NULL)) /* called by pause() */ | |
299 | Perror("sigaction"); | |
300 | @@ -161,7 +162,7 @@ | |
301 | (void) signal(SIGTERM, sterm); | |
302 | (void) signal(SIGSEGV, ssegv); | |
303 | (void) signal(SIGHUP, shangup); | |
304 | - (void) signal(SIGPIPE, SIG_IGN); | |
305 | + (void) signal(SIGPIPE, SIG_DFL); | |
306 | ||
307 | strcpy(term, "unknown"); /* tty type */ | |
308 | Device = "unknown"; /* tty device */ | |
309 | @@ -178,7 +179,7 @@ | |
310 | delay = 0; /* delay before prompt */ | |
311 | speed = (char *) NULL; | |
312 | clear = TRUE; /* clear the screen */ | |
313 | - login = LOGIN; /* login program */ | |
314 | + loginprog = LOGIN; /* login program */ | |
315 | waitchar = FALSE; /* don't wait for a char */ | |
316 | waitfor = (char *) NULL; /* no waitfor string */ | |
317 | Connect = (char *) NULL; /* no connect string */ | |
318 | @@ -423,7 +424,7 @@ | |
319 | Version = strdup(buf); | |
320 | } | |
321 | } | |
322 | - if((p = defvalue(def, "LOGIN"))) login = p; | |
323 | + if((p = defvalue(def, "LOGIN"))) loginprog = p; | |
324 | if((p = defvalue(def, "ISSUE"))) issue = p; | |
325 | if((p = defvalue(def, "CLEAR")) && (strequal(p, "NO"))) | |
326 | clear = FALSE; | |
327 | @@ -1006,7 +1007,7 @@ | |
328 | Speed = speedtab[i].speed; | |
329 | ||
330 | #ifdef ISSUE | |
331 | - if (clear && *clrscr) { | |
332 | + if (clear && clrscr && *clrscr) { | |
333 | (void) tputs(clrscr, 1, tputc); | |
334 | } | |
335 | fputc('\r', stdout); | |
336 | @@ -1024,8 +1025,8 @@ | |
337 | login_prompt: | |
338 | (void) ioctl(STDIN, TCFLSH, 0); | |
339 | #ifdef FIDO | |
340 | - if (emsi && (strcmp(emsi,"yes") == 0)) | |
341 | - (void) Fputs("**EMSI_REQA77E\r", stdout); | |
342 | + if (emsi && (strcmp(emsi,"yes") == 0)) | |
343 | + (void) Fputs("**EMSI_REQA77E\r", stdout); | |
344 | #endif | |
345 | (void) Fputs(gtab->login, stdout); | |
346 | if(TimeOut > 0) { | |
347 | @@ -1039,7 +1040,7 @@ | |
348 | (void) signal(SIGALRM, SIG_DFL); | |
349 | (void) alarm(0); | |
350 | ||
351 | - login = fido; | |
352 | + loginprog = fido; | |
353 | logerr("Fido Call Detected"); | |
354 | #endif /* FIDO */ | |
355 | case SUCCESS: | |
356 | @@ -1066,14 +1067,14 @@ | |
357 | setenv("TERM", term, TRUE); | |
358 | #endif /* SETTERM */ | |
359 | debug(D_RUN, "execing login"); | |
360 | - (void) execl(login, | |
361 | + (void) execl(loginprog, | |
362 | "login", buf, (char *)NULL); | |
363 | debug(D_RUN, | |
364 | "exec failed: %s; trying with /bin/sh", | |
365 | strerror(errno)); | |
366 | - (void) execl("/bin/sh", "sh", "-c", login, | |
367 | + (void) execl("/bin/sh", "sh", "-c", loginprog, | |
368 | buf, (char *) NULL); | |
369 | - logerr("exec of %s failed: %s", login, | |
370 | + logerr("exec of %s failed: %s", loginprog, | |
371 | strerror(errno)); | |
372 | exit(FAIL); | |
373 | ||
374 | diff -Nur getty_ps-2.0.7j/main.h getty_ps-2.0.7j.pld/main.h | |
375 | --- getty_ps-2.0.7j/main.h Sun Feb 2 16:00:23 1997 | |
376 | +++ getty_ps-2.0.7j.pld/main.h Thu Jun 10 16:31:28 1999 | |
377 | @@ -16,9 +16,10 @@ | |
378 | #include <sys/stat.h> | |
379 | #include <errno.h> | |
380 | #include <stdlib.h> | |
381 | -#include <termcap.h> | |
382 | +#include <ncurses/termcap.h> | |
383 | #include <unistd.h> | |
384 | #include <time.h> | |
385 | +#include <limits.h> | |
386 | ||
387 | #ifdef PWD | |
388 | #include <pwd.h> | |
389 | @@ -89,16 +90,16 @@ | |
390 | EXTERN char *defname; /* defaults file name */ | |
391 | EXTERN boolean clear; /* TRUE, clear screen */ | |
392 | EXTERN char *clrscr; /* string to clear screen with */ | |
393 | -EXTERN char *login; /* login program */ | |
394 | +EXTERN char *loginprog; /* login program */ | |
395 | EXTERN char *init; /* init string */ | |
396 | EXTERN char *waitfor; /* waitfor string */ | |
397 | EXTERN char *Connect; /* connect string */ | |
398 | EXTERN boolean waitchar; /* TRUE, wait for a character */ | |
399 | EXTERN unsigned int delay; /* seconds to delay before the prompt */ | |
400 | EXTERN GTAB *gtab; /* terminal mode */ | |
401 | -EXTERN char devname[MAXLINE + 1]; | |
402 | +EXTERN char devname[PATH_MAX + 1]; | |
403 | /* name of tty device */ | |
404 | -EXTERN char initdevname[MAXLINE + 1]; | |
405 | +EXTERN char initdevname[PATH_MAX + 1]; | |
406 | /* name of init device */ | |
407 | ||
408 | #ifdef ISSUE | |
409 | diff -Nur getty_ps-2.0.7j/mytermio.h getty_ps-2.0.7j.pld/mytermio.h | |
410 | --- getty_ps-2.0.7j/mytermio.h Mon Oct 9 20:49:06 1995 | |
411 | +++ getty_ps-2.0.7j.pld/mytermio.h Thu Jun 10 16:32:54 1999 | |
412 | @@ -5,15 +5,5 @@ | |
413 | ||
414 | #ifdef __linux__ | |
415 | #define CNUL 0 | |
416 | -#define CERASE 127 /* ^? */ | |
417 | -#define CKILL 025 /* ^U */ | |
418 | -#define CINTR 03 /* ^C */ | |
419 | -#define CQUIT 034 /* ^\ */ | |
420 | -#define CSTART 021 /* ^Q */ | |
421 | -#define CSTOP 023 /* ^S */ | |
422 | -#define CEOF 04 /* ^D */ | |
423 | -#define CMIN 06 /* satisfy read at 6 chars */ | |
424 | -#define CTIME 01 /* .1 sec inter-character timer */ | |
425 | - | |
426 | #define SSPEED B9600 /* default speed */ | |
427 | #endif | |
428 | diff -Nur getty_ps-2.0.7j/table.c getty_ps-2.0.7j.pld/table.c | |
429 | --- getty_ps-2.0.7j/table.c Sun Feb 2 16:04:39 1997 | |
430 | +++ getty_ps-2.0.7j.pld/table.c Thu Jun 10 16:30:28 1999 | |
431 | @@ -21,6 +21,7 @@ | |
432 | ||
433 | #include "getty.h" | |
434 | #include "table.h" | |
435 | +#include "mytermio.h" | |
436 | #include <errno.h> | |
437 | ||
438 | ||
439 | diff -Nur getty_ps-2.0.7j/tune.h getty_ps-2.0.7j.pld/tune.h | |
440 | --- getty_ps-2.0.7j/tune.h Sun Feb 2 03:17:01 1997 | |
441 | +++ getty_ps-2.0.7j.pld/tune.h Thu Jun 10 16:30:28 1999 | |
442 | @@ -54,10 +54,11 @@ | |
443 | /* Where to find things | |
444 | */ | |
445 | ||
446 | -#define CONSOLE "/usr/adm/getty.log" /* error log if not using syslog */ | |
447 | #ifndef FSSTND | |
448 | +#define CONSOLE "/var/log/getty" /* error log if not using syslog */ | |
449 | #define DEFAULTS "/etc/default/%s" /* name of defaults file */ | |
450 | #else | |
451 | +#define CONSOLE "/var/log/getty.log" /* error log if not using syslog */ | |
452 | #define DEFAULTS "/etc/conf.%s" /* FSSTND compliant defaults file */ | |
453 | #endif | |
454 | #define ISSUE "/etc/issue" /* name of the issue file; | |
455 | @@ -78,7 +79,7 @@ | |
456 | */ | |
457 | ||
458 | #define MAXDEF 100 /* max # lines in defaults file */ | |
459 | -#define MAXLINE 8192 /* max # chars in a line */ | |
460 | +#define MAXLINE 1024 /* max # chars in a line */ | |
461 | #define MAXID 12 /* max # chars in Gtab Id */ | |
462 | #define MAXLOGIN 80 /* max # chars in Gtab Login */ | |
463 | ||
464 | diff -Nur getty_ps-2.0.7j/utmp2.c getty_ps-2.0.7j.pld/utmp2.c | |
465 | --- getty_ps-2.0.7j/utmp2.c Mon Sep 11 17:55:17 1995 | |
466 | +++ getty_ps-2.0.7j.pld/utmp2.c Thu Jun 10 16:30:28 1999 | |
467 | @@ -16,6 +16,7 @@ | |
468 | static off_t utaddress; /* The file address of the last entry | |
469 | returned by getutent. */ | |
470 | ||
471 | +#if 0 | |
472 | /* kludge for the benefit of getutent() whose semantics differs from the | |
473 | other get..() functions. When set, getutent() will not read the | |
474 | next entry in utmp, but immediatly returns &Ut, and resets the | |
475 | @@ -105,6 +106,7 @@ | |
476 | ||
477 | return (struct utmp *)0; | |
478 | } | |
479 | +#endif | |
480 | ||
481 | /* Back up and overwrite the last entry returned by getutent, | |
482 | * Or append to the file if getutent returned 0. | |
483 | @@ -119,6 +121,7 @@ | |
484 | return ut; | |
485 | } | |
486 | ||
487 | +#if 0 | |
488 | struct utmp *getutline(struct utmp *ut) | |
489 | { | |
490 | if(Fd == -1) | |
491 | @@ -174,3 +177,4 @@ | |
492 | if(Fd != -1) close(Fd); | |
493 | Fd = -1; | |
494 | } | |
495 | +#endif | |
496 | diff -Nur getty_ps-2.0.7j/uufuncs.c getty_ps-2.0.7j.pld/uufuncs.c | |
497 | --- getty_ps-2.0.7j/uufuncs.c Fri Apr 26 17:09:48 1996 | |
498 | +++ getty_ps-2.0.7j.pld/uufuncs.c Thu Jun 10 16:30:28 1999 | |
499 | @@ -8,6 +8,7 @@ | |
500 | #define UUFUNCS | |
501 | #define UUGETTY | |
502 | ||
503 | +#include <pwd.h> | |
504 | #include "main.h" | |
505 | #include "uufuncs.h" | |
506 | #include "debug.h" | |
507 | @@ -79,6 +80,7 @@ | |
508 | #endif /* ASCIIPID */ | |
509 | int getpid(); | |
510 | char *mktemp(); | |
511 | + struct passwd *pw; | |
512 | ||
513 | debug(D_LOCK, "makelock(%s) called", name); | |
514 | ||
515 | @@ -102,6 +104,14 @@ | |
516 | (void) write(fd, (char *)&pid, sizeof(pid)); | |
517 | #endif /* ASCIIPID */ | |
518 | (void) close(fd); | |
519 | + | |
520 | + /* change owner of link */ | |
521 | + pw = getpwnam(UUCPID); | |
522 | + if (pw==NULL || chown(temp,pw->pw_uid,pw->pw_gid)<0) { | |
523 | + debug(D_LOCK, "lock NOT made -- chown failed"); | |
524 | + (void) unlink(temp); | |
525 | + return(FAIL); | |
526 | + } | |
527 | ||
528 | /* link it to the lock file | |
529 | */ |