Attempted 'login' command can log user off
Tony Birnseth
tonyb at tektools.UUCP
Fri Dec 12 14:34:23 AEST 1986
Index: /bin/csh 4.3BSD
Description:
On systems where port contention may be high, csh causes unnecessary
logout if the execl() of /bin/login fails. Since having /bin/login
world executable has certain secrurity implications, it is just plain
unkind to force a user to loose their session if the execl() fails.
Repeat by:
Make /bin/login not executable by the world.
% login sysadmin
(logged out here! must now try to get another port or redial
through a slow modem pool)
Fix:
Remove the untty() and exit(), replacing them with an informational
message.
Apply the following diffs to sh.func.c and add -DTEK_BUGS to 'DEFS'
in the Makefile.
*** /tmp/,RCSt1027852 Thu Dec 11 17:03:03 1986
--- sh.func.c Thu Dec 11 16:58:59 1986
***************
*** 179,184
rechist();
(void) signal(SIGTERM, parterm);
execl("/bin/login", "login", v[1], 0);
untty();
exit(1);
}
--- 179,191 -----
rechist();
(void) signal(SIGTERM, parterm);
execl("/bin/login", "login", v[1], 0);
+ #ifdef TEK_BUGS
+ /*
+ * Since ports may be in high demand, it is much nicer to give the
+ * user the choice rather than drop them cause the exec failed.
+ */
+ printf("execl of /bin/login failed, logout and re-login!\n");
+ #else /* ! TEK_BUGS */
untty();
exit(1);
#endif /* TEK_BUGS */
***************
*** 181,186
execl("/bin/login", "login", v[1], 0);
untty();
exit(1);
}
#ifdef NEWGRP
--- 188,194 -----
#else /* ! TEK_BUGS */
untty();
exit(1);
+ #endif /* TEK_BUGS */
}
#ifdef NEWGRP
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list