Module Name:    src
Committed By:   riastradh
Date:           Wed Feb 26 15:44:57 UTC 2020

Modified Files:
        src/libexec/getty: getty.8 main.c

Log Message:
uugetty is no more


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/libexec/getty/getty.8
cvs rdiff -u -r1.66 -r1.67 src/libexec/getty/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/getty/getty.8
diff -u src/libexec/getty/getty.8:1.18 src/libexec/getty/getty.8:1.19
--- src/libexec/getty/getty.8:1.18	Wed May 29 15:02:12 2013
+++ src/libexec/getty/getty.8	Wed Feb 26 15:44:57 2020
@@ -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 @@ The
 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 @@ does not exist.
 .Sh SEE ALSO
 .Xr login 1 ,
 .Xr ioctl 2 ,
-.Xr pidlock 3 ,
 .Xr ttyaction 3 ,
 .Xr tty 4 ,
 .Xr gettytab 5 ,

Index: src/libexec/getty/main.c
diff -u src/libexec/getty/main.c:1.66 src/libexec/getty/main.c:1.67
--- src/libexec/getty/main.c:1.66	Tue Jan 10 21:08:15 2017
+++ src/libexec/getty/main.c	Wed Feb 26 15:44:57 2020
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #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 @@ struct	utsname kerninfo;
 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 @@ static void	xputs(const char *);
 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 @@ main(int argc, char *argv[], char *envp[
 		(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 @@ main(int argc, char *argv[], char *envp[
 		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 @@ main(int argc, char *argv[], char *envp[
 				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 @@ main(int argc, char *argv[], char *envp[
 		(void)signal(SIGINT, SIG_IGN);
 		if (NX && *NX)
 			tname = NX;
-		if (uugetty)
-			(void)unlink(lockfile);
 	}
 }
 

Reply via email to