Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/getty uugetty is no more



details:   https://anonhg.NetBSD.org/src/rev/cac6afc0ce54
branches:  trunk
changeset: 745251:cac6afc0ce54
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Feb 26 15:44:57 2020 +0000

description:
uugetty is no more

diffstat:

 libexec/getty/getty.8 |  22 +++-------------------
 libexec/getty/main.c  |  48 +++---------------------------------------------
 2 files changed, 6 insertions(+), 64 deletions(-)

diffs (171 lines):

diff -r cde73b53184f -r cac6afc0ce54 libexec/getty/getty.8
--- a/libexec/getty/getty.8     Wed Feb 26 10:06:08 2020 +0000
+++ b/libexec/getty/getty.8     Wed Feb 26 15:44:57 2020 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: getty.8,v 1.18 2013/05/29 15:02:12 wiz Exp $
+.\"    $NetBSD: getty.8,v 1.19 2020/02/26 15:44:57 riastradh Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -33,8 +33,7 @@
 .Dt GETTY 8
 .Os
 .Sh NAME
-.Nm getty ,
-.Nm uugetty
+.Nm getty
 .Nd set terminal modes for system access
 .Sh SYNOPSIS
 .Nm
@@ -42,11 +41,6 @@
 .Ar type
 .Op Ar tty
 .Oc
-.Nm uugetty
-.Oo
-.Ar type
-.Op Ar tty
-.Oc
 .Sh DESCRIPTION
 The
 .Nm
@@ -133,20 +127,11 @@
 program can be set to timeout after some interval,
 which will cause dial up lines to hang up
 if the login name is not entered reasonably quickly.
-.Pp
-The
-.Nm uugetty
-program is the same, except that it uses
-.Xr pidlock 3
-to respect the locks in
-.Pa /var/spool/lock
-of processes that dial out on that tty.
 .Sh FILES
-.Bl -tag -width /var/spool/lock/LCK..ttyXX -compact
+.Bl -tag -width /usr/libexec/getty -compact
 .It Pa /etc/gettytab
 .It Pa /etc/ttys
 .It Pa /usr/libexec/getty
-.It Pa /var/spool/lock/LCK..ttyXX
 .El
 .Sh DIAGNOSTICS
 .Bl -diag
@@ -164,7 +149,6 @@
 .Sh SEE ALSO
 .Xr login 1 ,
 .Xr ioctl 2 ,
-.Xr pidlock 3 ,
 .Xr ttyaction 3 ,
 .Xr tty 4 ,
 .Xr gettytab 5 ,
diff -r cde73b53184f -r cac6afc0ce54 libexec/getty/main.c
--- a/libexec/getty/main.c      Wed Feb 26 10:06:08 2020 +0000
+++ b/libexec/getty/main.c      Wed Feb 26 15:44:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.66 2017/01/10 21:08:15 christos Exp $       */
+/*     $NetBSD: main.c,v 1.67 2020/02/26 15:44:57 riastradh Exp $      */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "from: @(#)main.c       8.1 (Berkeley) 6/20/93";
 #else
-__RCSID("$NetBSD: main.c,v 1.66 2017/01/10 21:08:15 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.67 2020/02/26 15:44:57 riastradh Exp $");
 #endif
 #endif /* not lint */
 
@@ -99,8 +99,7 @@
 char   name[LOGIN_NAME_MAX];
 char   dev[] = _PATH_DEV;
 char   ttyn[32];
-char   lockfile[512];
-uid_t  ttyowner;
+uid_t  ttyowner = 0;
 char   *rawttyn;
 
 #define        OBUFSIZ         128
@@ -183,15 +182,12 @@
 int
 main(int argc, char *argv[], char *envp[])
 {
-       const char *progname;
        int repcnt = 0, failopenlogged = 0;
        volatile int first_time = 1;
        struct rlimit limit;
-       struct passwd *pw;
        int rval;
        /* this is used past the siglongjmp, so make sure it is not cached
           in registers that might become invalid. */
-       volatile int uugetty = 0;
        const char * volatile tname = "default";
 
        (void)signal(SIGINT, SIG_IGN);
@@ -202,18 +198,6 @@
                (void)strlcpy(hostname, "Amnesiac", sizeof(hostname));
        (void)uname(&kerninfo);
 
-       progname = getprogname();
-       if (progname[0] == 'u' && progname[1] == 'u')
-               uugetty = 1;
-
-       /*
-        * Find id of uucp login (if present) so we can chown tty properly.
-        */
-       if (uugetty && (pw = getpwnam("uucp")))
-               ttyowner = pw->pw_uid;
-       else
-               ttyowner = 0;
-
        /*
         * Limit running time to deal with broken or dead lines.
         */
@@ -238,23 +222,6 @@
                rawttyn = argv[2];
                (void)strlcpy(ttyn, dev, sizeof(ttyn));
                (void)strlcat(ttyn, argv[2], sizeof(ttyn));
-               if (uugetty)  {
-                       (void)chown(ttyn, ttyowner, 0);
-                       (void)strlcpy(lockfile, _PATH_LOCK,
-                               sizeof(lockfile));
-                       (void)strlcat(lockfile, argv[2],
-                               sizeof(lockfile));
-                       /*
-                        * wait for lockfiles to go away before we try
-                        * to open
-                        */
-                       if (pidlock(lockfile, 0, 0, 0) != 0)  {
-                               syslog(LOG_ERR,
-                                       "%s: can't create lockfile", ttyn);
-                               exit(1);
-                       }
-                       (void)unlink(lockfile);
-               }
                if (strcmp(argv[0], "+") != 0) {
                        (void)chown(ttyn, ttyowner, 0);
                        (void)chmod(ttyn, 0600);
@@ -277,13 +244,6 @@
                                repcnt++;
                                (void)sleep(60);
                        }
-                       if (uugetty && pidlock(lockfile, 0, 0, 0) != 0)  {
-                               syslog(LOG_ERR, "%s: can't create lockfile",
-                                       ttyn);
-                               exit(1);
-                       }
-                       if (uugetty)
-                               (void)chown(lockfile, ttyowner, 0);
                        (void)login_tty(i);
                }
        }
@@ -441,8 +401,6 @@
                (void)signal(SIGINT, SIG_IGN);
                if (NX && *NX)
                        tname = NX;
-               if (uugetty)
-                       (void)unlink(lockfile);
        }
 }
 



Home | Main Index | Thread Index | Old Index