mirror of
https://github.com/GnoConsortium/gno.git
synced 2025-01-04 22:30:42 +00:00
Merge pull request #4 from ksherlock/tmterm-login
/bin/login tmterm compatibility
This commit is contained in:
commit
8e8cb4800f
@ -153,6 +153,17 @@ int permit_passwd = 0;
|
|||||||
* -f is used to skip a second login authentication
|
* -f is used to skip a second login authentication
|
||||||
* -h is used by other servers to pass the name of the remote
|
* -h is used by other servers to pass the name of the remote
|
||||||
* host to login so that it may be placed in utmp and wtmp
|
* host to login so that it may be placed in utmp and wtmp
|
||||||
|
*
|
||||||
|
* The TMTerm NDA expects the GNO 2.0.4 multi-user update login.
|
||||||
|
* The commandline passed is:
|
||||||
|
* login -Ph TMTERM root TERM=vt100
|
||||||
|
*
|
||||||
|
* -P Suppress the password prompt and log the user in without one.
|
||||||
|
* This switch will have no effect unless a user name is given on
|
||||||
|
* the command line and the user has root priviledges or is logging
|
||||||
|
* in as himself.
|
||||||
|
*
|
||||||
|
* this is equivalent to -f
|
||||||
*/
|
*/
|
||||||
*full_hostname = '\0';
|
*full_hostname = '\0';
|
||||||
domain = NULL;
|
domain = NULL;
|
||||||
@ -163,8 +174,11 @@ int permit_passwd = 0;
|
|||||||
|
|
||||||
fflag = hflag = pflag = 0;
|
fflag = hflag = pflag = 0;
|
||||||
uid = getuid();
|
uid = getuid();
|
||||||
while ((ch = getopt(argc, argv, "fh:p")) != EOF)
|
while ((ch = getopt(argc, argv, "fh:pP")) != EOF)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
|
#ifdef __GNO__
|
||||||
|
case 'P':
|
||||||
|
#endif
|
||||||
case 'f':
|
case 'f':
|
||||||
fflag = 1;
|
fflag = 1;
|
||||||
break;
|
break;
|
||||||
@ -181,6 +195,7 @@ int permit_passwd = 0;
|
|||||||
case 'p':
|
case 'p':
|
||||||
pflag = 1;
|
pflag = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
if (!uid)
|
if (!uid)
|
||||||
@ -430,6 +445,15 @@ int permit_passwd = 0;
|
|||||||
/* Destroy environment unless user has requested its preservation. */
|
/* Destroy environment unless user has requested its preservation. */
|
||||||
if (!pflag)
|
if (!pflag)
|
||||||
environ = envinit;
|
environ = envinit;
|
||||||
|
|
||||||
|
#ifdef __GNO__
|
||||||
|
// set parameters from the command line.
|
||||||
|
for (cnt = 1; cnt < argc; ++cnt)
|
||||||
|
{
|
||||||
|
(void)putenv(argv[cnt]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
(void)setenv("HOME", pwd->pw_dir, 1);
|
(void)setenv("HOME", pwd->pw_dir, 1);
|
||||||
(void)setenv("SHELL", pwd->pw_shell, 1);
|
(void)setenv("SHELL", pwd->pw_shell, 1);
|
||||||
if (term[0] == '\0')
|
if (term[0] == '\0')
|
||||||
|
Loading…
Reference in New Issue
Block a user