[6580] in Athena Bugs
vax 7.2F: /bin/login
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Tue Dec 11 16:46:07 1990
From: vanharen@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Tue, 11 Dec 90 16:45:53 EST
System name: fries
Type and version: CVAXSTAR 7.2F (1 update(s) to same version)
Display type: SM
What were you trying to do?
Compile it with gcc.
Also, set it up so that remote logins are restricted to users
listed in /etc/passwd{,.local}.
(See Software_Suggestions, trn 410.)
What's wrong:
If compiled with gcc, login dies due to trying to write into a
read-only string.
Patches:
Below is a context diff on login.c. Changes include putting
comments around statements after #endif's, the fix to the
writable-strings problem, and no_remote support (#ifdef'ed on
NOREMOTE, though I recommend removing these #ifdef's, since
no_create is not #ifdef'ed, and I think that this should be a
supported configuration for private ws's -- but I digress).
==============================================================================
21c21
< #endif not lint
---
> #endif /* not lint */
25c25
< #endif not lint
---
> #endif /* not lint */
38c38
< #endif !VFS
---
> #endif /* !VFS */
86c86
< #endif VFS
---
> #endif /* VFS */
113a114,116
> #ifdef NOREMOTE
> char noremote[] = "/etc/noremote";
> #endif
145c148
< #endif POSIX
---
> #endif /* POSIX */
189a193,195
> #ifdef NOREMOTE
> int no_remote = FALSE; /* True if /etc/noremote exists */
> #endif
209a216,218
> #ifdef NOREMOTE
> FILE *nrfd;
> #endif
218c227
< #endif !VFS
---
> #endif /* !VFS */
334a344,346
> #ifdef NOREMOTE
> no_remote = !access(noremote, F_OK);
> #endif
397a410
> #ifndef NOREMOTE
398a412,416
> #else
> if (inhibitflag
> || (no_remote
> && (hflag || rflag || kflag || Kflag)))
> {
399a418,430
> fprintf(stderr, "You are not allowed to login here.\n");
>
> if ((nrfd = fopen(noremote, "r")) != 0) {
> while ((c = getc(nrfd)) != EOF)
> putchar(c);
> fflush(stdout);
> fclose(nrfd);
> }
>
> errorprtflag = TRUE;
> goto leavethis;
> }
> #endif
670c701
< #endif VFS
---
> #endif /* VFS */
723c754
< #endif !VFS
---
> #endif /* !VFS */
768a800,805
> #ifdef NOREMOTE
> else {
> syslog(LOG_INFO, "User %s logged in on %s", pwd->pw_name, tty);
> }
> #endif
>
780c817
< #endif VFS
---
> #endif /* VFS */
1106c1143
< #endif ultrix
---
> #endif /* ultrix */
1297c1334
< #endif notdef
---
> #endif /* notdef */
1301c1338
< #endif notdef
---
> #endif /* notdef */
1647c1684
< char *wgfile;
---
> char wgfile[15];
1649c1686
< wgfile = "/tmp/wg.XXXXXX";
---
> strcpy(wgfile, "/tmp/wg.XXXXXX");