CVS commit: src/libexec/getty
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(); - 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) -
CVS commit: src/libexec/getty
Module Name:src Committed By: christos Date: Tue Jan 10 21:08:16 UTC 2017 Modified Files: src/libexec/getty: main.c Log Message: need for chmod To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 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/main.c diff -u src/libexec/getty/main.c:1.65 src/libexec/getty/main.c:1.66 --- src/libexec/getty/main.c:1.65 Wed Mar 16 20:21:04 2016 +++ src/libexec/getty/main.c Tue Jan 10 16:08:15 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.65 2016/03/17 00:21:04 christos Exp $ */ +/* $NetBSD: main.c,v 1.66 2017/01/10 21:08:15 christos Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -40,13 +40,14 @@ __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.65 2016/03/17 00:21:04 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.66 2017/01/10 21:08:15 christos Exp $"); #endif #endif /* not lint */ #include #include #include +#include #include #include
CVS commit: src/libexec/getty
Module Name:src Committed By: christos Date: Thu Mar 17 00:21:04 UTC 2016 Modified Files: src/libexec/getty: main.c Log Message: Add volatile for gcc 5 To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 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/main.c diff -u src/libexec/getty/main.c:1.64 src/libexec/getty/main.c:1.65 --- src/libexec/getty/main.c:1.64 Mon Aug 12 09:54:33 2013 +++ src/libexec/getty/main.c Wed Mar 16 20:21:04 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.64 2013/08/12 13:54:33 joerg Exp $ */ +/* $NetBSD: main.c,v 1.65 2016/03/17 00:21:04 christos 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.64 2013/08/12 13:54:33 joerg Exp $"); +__RCSID("$NetBSD: main.c,v 1.65 2016/03/17 00:21:04 christos Exp $"); #endif #endif /* not lint */ @@ -183,7 +183,8 @@ int main(int argc, char *argv[], char *envp[]) { const char *progname; - int repcnt = 0, failopenlogged = 0, first_time = 1; + int repcnt = 0, failopenlogged = 0; + volatile int first_time = 1; struct rlimit limit; struct passwd *pw; int rval;
CVS commit: src/libexec/getty
Module Name:src Committed By: aymeric Date: Thu Feb 12 07:32:09 UTC 2015 Modified Files: src/libexec/getty: ttys.5 Log Message: Fix previous commit by using tty00 as an example of dialin peripheral instead of dialout dty00. Thanks to mrg@ for pointing it out. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/libexec/getty/ttys.5 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/ttys.5 diff -u src/libexec/getty/ttys.5:1.19 src/libexec/getty/ttys.5:1.20 --- src/libexec/getty/ttys.5:1.19 Wed Nov 12 21:56:48 2014 +++ src/libexec/getty/ttys.5 Thu Feb 12 07:32:09 2015 @@ -1,4 +1,4 @@ -.\ $NetBSD: ttys.5,v 1.19 2014/11/12 21:56:48 aymeric Exp $ +.\ $NetBSD: ttys.5,v 1.20 2015/02/12 07:32:09 aymeric Exp $ .\ .\ Copyright (c) 1985, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -199,7 +199,7 @@ program must be run for changes in those # root login on console at 1200 baud console /usr/libexec/getty std.1200 vt100 on secure # dialup at 1200 baud, no root logins -dty00 /usr/libexec/getty d1200 dialup on # 555-1234 +tty00 /usr/libexec/getty d1200 dialup on # 555-1234 # Mike's terminal: hp2621 ttyh0 /usr/libexec/getty std.9600 hp2621-nl on # 457 Evans # John's terminal: vt100
CVS commit: src/libexec/getty
Module Name:src Committed By: aymeric Date: Wed Nov 12 21:56:48 UTC 2014 Modified Files: src/libexec/getty: ttys.5 Log Message: update the example to use dty00 instead of ttyd0 to reflect a current practice To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/libexec/getty/ttys.5 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/ttys.5 diff -u src/libexec/getty/ttys.5:1.18 src/libexec/getty/ttys.5:1.19 --- src/libexec/getty/ttys.5:1.18 Sat Apr 21 12:27:28 2012 +++ src/libexec/getty/ttys.5 Wed Nov 12 21:56:48 2014 @@ -1,4 +1,4 @@ -.\ $NetBSD: ttys.5,v 1.18 2012/04/21 12:27:28 roy Exp $ +.\ $NetBSD: ttys.5,v 1.19 2014/11/12 21:56:48 aymeric Exp $ .\ .\ Copyright (c) 1985, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -199,7 +199,7 @@ program must be run for changes in those # root login on console at 1200 baud console /usr/libexec/getty std.1200 vt100 on secure # dialup at 1200 baud, no root logins -ttyd0 /usr/libexec/getty d1200 dialup on # 555-1234 +dty00 /usr/libexec/getty d1200 dialup on # 555-1234 # Mike's terminal: hp2621 ttyh0 /usr/libexec/getty std.9600 hp2621-nl on # 457 Evans # John's terminal: vt100
CVS commit: src/libexec/getty
Module Name:src Committed By: joerg Date: Mon Aug 12 13:54:33 UTC 2013 Modified Files: src/libexec/getty: main.c Log Message: Use __dead. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 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/main.c diff -u src/libexec/getty/main.c:1.63 src/libexec/getty/main.c:1.64 --- src/libexec/getty/main.c:1.63 Sun Aug 11 09:16:42 2013 +++ src/libexec/getty/main.c Mon Aug 12 13:54:33 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.63 2013/08/11 09:16:42 martin Exp $ */ +/* $NetBSD: main.c,v 1.64 2013/08/12 13:54:33 joerg 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.63 2013/08/11 09:16:42 martin Exp $); +__RCSID($NetBSD: main.c,v 1.64 2013/08/12 13:54:33 joerg Exp $); #endif #endif /* not lint */ @@ -137,7 +137,7 @@ static void clearscreen(void); sigjmp_buf timeout; -static void +__dead static void /*ARGSUSED*/ dingdong(int signo) { @@ -149,7 +149,7 @@ dingdong(int signo) sigjmp_buf intrupt; -static void +__dead static void /*ARGSUSED*/ interrupt(int signo) { @@ -161,7 +161,7 @@ interrupt(int signo) /* * Action to take when getty is running too long. */ -static void +__dead static void /*ARGSUSED*/ timeoverrun(int signo) {
CVS commit: src/libexec/getty
Module Name:src Committed By: martin Date: Sun Aug 11 09:16:42 UTC 2013 Modified Files: src/libexec/getty: main.c Log Message: Fix another automatic variable that is life both pre- and post the siglongjmp (which gcc calls might be clobbered) by marking it volatile: on some machines, this value might end up in a register loaded before the sigsetjmp, but not preserved by the siglongjmp later. Fixes the VAX build. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 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/main.c diff -u src/libexec/getty/main.c:1.62 src/libexec/getty/main.c:1.63 --- src/libexec/getty/main.c:1.62 Sun Aug 11 05:48:56 2013 +++ src/libexec/getty/main.c Sun Aug 11 09:16:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.62 2013/08/11 05:48:56 dholland Exp $ */ +/* $NetBSD: main.c,v 1.63 2013/08/11 09:16:42 martin 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.62 2013/08/11 05:48:56 dholland Exp $); +__RCSID($NetBSD: main.c,v 1.63 2013/08/11 09:16:42 martin Exp $); #endif #endif /* not lint */ @@ -183,13 +183,14 @@ int main(int argc, char *argv[], char *envp[]) { const char *progname; - const char *tname; int repcnt = 0, failopenlogged = 0, first_time = 1; struct rlimit limit; struct passwd *pw; int rval; - /* gcc 4.5 claims longjmp can clobber this, but I don't see how */ + /* 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); openlog(getty, LOG_PID, LOG_AUTH); @@ -294,7 +295,6 @@ main(int argc, char *argv[], char *envp[ gettable(default, defent); gendefaults(); - tname = default; if (argc 1) tname = argv[1]; for (;;) {
CVS commit: src/libexec/getty
Module Name:src Committed By: dholland Date: Sun Aug 11 16:36:30 UTC 2013 Modified Files: src/libexec/getty: subr.c Log Message: Don't try to estrdup() NULL; thanks martin@ To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/libexec/getty/subr.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/subr.c diff -u src/libexec/getty/subr.c:1.34 src/libexec/getty/subr.c:1.35 --- src/libexec/getty/subr.c:1.34 Sun Aug 11 05:42:41 2013 +++ src/libexec/getty/subr.c Sun Aug 11 16:36:30 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr.c,v 1.34 2013/08/11 05:42:41 dholland Exp $ */ +/* $NetBSD: subr.c,v 1.35 2013/08/11 16:36:30 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = from: @(#)subr.c 8.1 (Berkeley) 6/4/93; #else -__RCSID($NetBSD: subr.c,v 1.34 2013/08/11 05:42:41 dholland Exp $); +__RCSID($NetBSD: subr.c,v 1.35 2013/08/11 16:36:30 dholland Exp $); #endif #endif /* not lint */ @@ -137,7 +137,7 @@ setdefaults(void) for (sp = gettystrs; sp-field; sp++) if (!sp-value) - sp-value = estrdup(sp-defalt); + sp-value = sp-defalt ? estrdup(sp-defalt) : NULL; for (np = gettynums; np-field; np++) if (!np-set) np-value = np-defalt;
CVS commit: src/libexec/getty
Module Name:src Committed By: dholland Date: Sun Aug 11 05:42:41 UTC 2013 Modified Files: src/libexec/getty: Makefile extern.h gettytab.h init.c main.c subr.c Log Message: Pass WARNS=5. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/libexec/getty/Makefile cvs rdiff -u -r1.6 -r1.7 src/libexec/getty/extern.h cvs rdiff -u -r1.16 -r1.17 src/libexec/getty/gettytab.h cvs rdiff -u -r1.17 -r1.18 src/libexec/getty/init.c cvs rdiff -u -r1.60 -r1.61 src/libexec/getty/main.c cvs rdiff -u -r1.33 -r1.34 src/libexec/getty/subr.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/Makefile diff -u src/libexec/getty/Makefile:1.19 src/libexec/getty/Makefile:1.20 --- src/libexec/getty/Makefile:1.19 Wed Feb 3 15:34:43 2010 +++ src/libexec/getty/Makefile Sun Aug 11 05:42:41 2013 @@ -1,8 +1,6 @@ -# $NetBSD: Makefile,v 1.19 2010/02/03 15:34:43 roy Exp $ +# $NetBSD: Makefile,v 1.20 2013/08/11 05:42:41 dholland Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/4/93 -WARNS?= 2 # XXX: many const sign-compare issues - PROG= getty SRCS= main.c init.c subr.c DPADD+= ${LIBUTIL} ${LIBTERMINFO} Index: src/libexec/getty/extern.h diff -u src/libexec/getty/extern.h:1.6 src/libexec/getty/extern.h:1.7 --- src/libexec/getty/extern.h:1.6 Thu Aug 7 09:46:41 2003 +++ src/libexec/getty/extern.h Sun Aug 11 05:42:41 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.6 2003/08/07 09:46:41 agc Exp $ */ +/* $NetBSD: extern.h,v 1.7 2013/08/11 05:42:41 dholland Exp $ */ /* * Copyright (c) 1993 @@ -34,17 +34,17 @@ struct delayval; int adelay(int, struct delayval *); -char *autobaud(void); +const char *autobaud(void); int delaybits(void); -void edithost(char *); +void edithost(const char *); void gendefaults(void); int getent(char *, char *); int getflag(char *); long getnum(char *); char *getstr(char *, char **); -void gettable(char *, char *); +void gettable(const char *, char *); void makeenv(char *[]); -char *portselector(void); +const char *portselector(void); void set_ttydefaults(int); void setchars(void); void setdefaults(void); Index: src/libexec/getty/gettytab.h diff -u src/libexec/getty/gettytab.h:1.16 src/libexec/getty/gettytab.h:1.17 --- src/libexec/getty/gettytab.h:1.16 Thu Nov 16 04:31:24 2006 +++ src/libexec/getty/gettytab.h Sun Aug 11 05:42:41 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: gettytab.h,v 1.16 2006/11/16 04:31:24 christos Exp $ */ +/* $NetBSD: gettytab.h,v 1.17 2013/08/11 05:42:41 dholland Exp $ */ /* * Copyright (c) 1983, 1993, 1994 @@ -35,20 +35,20 @@ * Getty description definitions. */ struct gettystrs { - char *field; /* name to lookup in gettytab */ - char *defalt; /* value we find by looking in defaults */ + const char *field; /* name to lookup in gettytab */ + const char *defalt; /* value we find by looking in defaults */ char *value; /* value that we find there */ }; struct gettynums { - char *field; /* name to lookup */ + const char *field; /* name to lookup */ long defalt; /* number we find in defaults */ long value; /* number we find there */ int set; /* we actually got this one */ }; struct gettyflags { - char *field; /* name to lookup */ + const char *field; /* name to lookup */ char invrt; /* name existing in gettytab -- false */ char defalt; /* true/false in defaults */ char value; /* true/false flag */ Index: src/libexec/getty/init.c diff -u src/libexec/getty/init.c:1.17 src/libexec/getty/init.c:1.18 --- src/libexec/getty/init.c:1.17 Mon Dec 3 09:54:24 2007 +++ src/libexec/getty/init.c Sun Aug 11 05:42:41 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.17 2007/12/03 09:54:24 isaki Exp $ */ +/* $NetBSD: init.c,v 1.18 2013/08/11 05:42:41 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = from: @(#)init.c 8.1 (Berkeley) 6/4/93; #else -__RCSID($NetBSD: init.c,v 1.17 2007/12/03 09:54:24 isaki Exp $); +__RCSID($NetBSD: init.c,v 1.18 2013/08/11 05:42:41 dholland Exp $); #endif #endif /* not lint */ @@ -44,6 +44,7 @@ __RCSID($NetBSD: init.c,v 1.17 2007/12/ * Melbourne getty. */ +#include stddef.h #include termios.h #include gettytab.h @@ -55,92 +56,92 @@ extern char hostname[]; #define M(a) ((char *)tmode.c_cc[a]) struct gettystrs gettystrs[] = { - { nx }, /* next table */ - { cl }, /* screen clear characters */ - { im }, /* initial message */ - { lm, login: }, /* login message */ - { er, M(VERASE) }, /* erase character */ - { kl, M(VKILL) }, /* kill character */ - { et, M(VEOF) }, /* eof chatacter (eot) */ - { pc, }, /* pad character */ - { tt }, /* terminal type */ - { ev }, /* environment */ - { lo, _PATH_LOGIN }, /* login program */ - { hn, hostname }, /* host name */ - { he }, /* host name edit */ - { in, M(VINTR) }, /* interrupt char */ - { qu, M(VQUIT) }, /* quit char */ - { xn, M(VSTART) }, /* XON (start) char */ - { xf,
CVS commit: src/libexec/getty
Module Name:src Committed By: dholland Date: Sun Aug 11 05:48:56 UTC 2013 Modified Files: src/libexec/getty: main.c Log Message: Use siglongjmp to jump out of signal handlers. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 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/main.c diff -u src/libexec/getty/main.c:1.61 src/libexec/getty/main.c:1.62 --- src/libexec/getty/main.c:1.61 Sun Aug 11 05:42:41 2013 +++ src/libexec/getty/main.c Sun Aug 11 05:48:56 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.61 2013/08/11 05:42:41 dholland Exp $ */ +/* $NetBSD: main.c,v 1.62 2013/08/11 05:48:56 dholland 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.61 2013/08/11 05:42:41 dholland Exp $); +__RCSID($NetBSD: main.c,v 1.62 2013/08/11 05:48:56 dholland Exp $); #endif #endif /* not lint */ @@ -135,7 +135,7 @@ const unsigned char partab[] = { static void clearscreen(void); -jmp_buf timeout; +sigjmp_buf timeout; static void /*ARGSUSED*/ @@ -144,10 +144,10 @@ dingdong(int signo) (void)alarm(0); (void)signal(SIGALRM, SIG_DFL); - longjmp(timeout, 1); + siglongjmp(timeout, 1); } -jmp_buf intrupt; +sigjmp_buf intrupt; static void /*ARGSUSED*/ @@ -155,7 +155,7 @@ interrupt(int signo) { (void)signal(SIGINT, interrupt); - longjmp(intrupt, 1); + siglongjmp(intrupt, 1); } /* @@ -357,7 +357,7 @@ main(int argc, char *argv[], char *envp[ if (IM *IM) putf(IM); oflush(); - if (setjmp(timeout)) { + if (sigsetjmp(timeout, 1)) { tmode.c_ispeed = tmode.c_ospeed = 0; (void)tcsetattr(0, TCSANOW, tmode); exit(1); @@ -455,7 +455,7 @@ getname(void) /* * Interrupt may happen if we use CBREAK mode */ - if (setjmp(intrupt)) { + if (sigsetjmp(intrupt, 1)) { (void)signal(SIGINT, SIG_IGN); return (0); }
CVS commit: src/libexec/getty
Module Name:src Committed By: wiz Date: Wed May 29 15:02:12 UTC 2013 Modified Files: src/libexec/getty: getty.8 Log Message: - Add the actual binary to `FILES' section; - bump date. From Bug Hunting. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/libexec/getty/getty.8 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.17 src/libexec/getty/getty.8:1.18 --- src/libexec/getty/getty.8:1.17 Thu Aug 7 09:46:42 2003 +++ src/libexec/getty/getty.8 Wed May 29 15:02:12 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: getty.8,v 1.17 2003/08/07 09:46:42 agc Exp $ +.\ $NetBSD: getty.8,v 1.18 2013/05/29 15:02:12 wiz Exp $ .\ .\ Copyright (c) 1980, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\ .\ from: @(#)getty.8 8.1 (Berkeley) 6/4/93 .\ -.Dd December 12, 1998 +.Dd May 29, 2013 .Dt GETTY 8 .Os .Sh NAME @@ -145,6 +145,7 @@ of processes that dial out on that tty. .Bl -tag -width /var/spool/lock/LCK..ttyXX -compact .It Pa /etc/gettytab .It Pa /etc/ttys +.It Pa /usr/libexec/getty .It Pa /var/spool/lock/LCK..ttyXX .El .Sh DIAGNOSTICS
CVS commit: src/libexec/getty
Module Name:src Committed By: christos Date: Sun Nov 4 21:14:59 UTC 2012 Modified Files: src/libexec/getty: main.c Log Message: remove useless include (sys/stat.h) and add useful one (stdio.h) To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 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/main.c diff -u src/libexec/getty/main.c:1.59 src/libexec/getty/main.c:1.60 --- src/libexec/getty/main.c:1.59 Thu Jun 28 04:55:10 2012 +++ src/libexec/getty/main.c Sun Nov 4 16:14:59 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.59 2012/06/28 08:55:10 roy Exp $ */ +/* $NetBSD: main.c,v 1.60 2012/11/04 21:14:59 christos Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -40,13 +40,11 @@ __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.59 2012/06/28 08:55:10 roy Exp $); +__RCSID($NetBSD: main.c,v 1.60 2012/11/04 21:14:59 christos Exp $); #endif #endif /* not lint */ #include sys/param.h -#include sys/stat.h -#include termios.h #include sys/ioctl.h #include sys/resource.h #include sys/utsname.h @@ -58,10 +56,12 @@ __RCSID($NetBSD: main.c,v 1.59 2012/06/ #include pwd.h #include setjmp.h #include signal.h +#include stdio.h #include stdlib.h #include string.h #include syslog.h #include term.h +#include termios.h #include time.h #include ttyent.h #include unistd.h
CVS commit: src/libexec/getty
Module Name:src Committed By: roy Date: Thu Jun 28 08:55:10 UTC 2012 Modified Files: src/libexec/getty: main.c Log Message: Don't attempt to parse a termcap/terminfo string ourselves; always use tputs(3). To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 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/main.c diff -u src/libexec/getty/main.c:1.58 src/libexec/getty/main.c:1.59 --- src/libexec/getty/main.c:1.58 Wed Feb 3 15:34:43 2010 +++ src/libexec/getty/main.c Thu Jun 28 08:55:10 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.58 2010/02/03 15:34:43 roy Exp $ */ +/* $NetBSD: main.c,v 1.59 2012/06/28 08:55:10 roy 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.58 2010/02/03 15:34:43 roy Exp $); +__RCSID($NetBSD: main.c,v 1.59 2012/06/28 08:55:10 roy Exp $); #endif #endif /* not lint */ @@ -173,11 +173,12 @@ timeoverrun(int signo) static int getname(void); static void oflush(void); static void prompt(void); -static void putchr(int); +static int putchr(int); static void putf(const char *); -static void putpad(const char *); static void xputs(const char *); +#define putpad(s) tputs(s, 1, putchr) + int main(int argc, char *argv[], char *envp[]) { @@ -566,43 +567,6 @@ getname(void) } static void -putpad(const char *s) -{ - int pad = 0; - speed_t ospd = cfgetospeed(tmode); - - if (isdigit((unsigned char)*s)) { - while (isdigit((unsigned char)*s)) { - pad *= 10; - pad += *s++ - '0'; - } - pad *= 10; - if (*s == '.' isdigit((unsigned char)s[1])) { - pad += s[1] - '0'; - s += 2; - } - } - - xputs(s); - /* - * If no delay needed, or output speed is - * not comprehensible, then don't try to delay. - */ - if (pad == 0) - return; - - /* - * Round up by a half a character frame, and then do the delay. - * Too bad there are no user program accessible programmed delays. - * Transmitting pad characters slows many terminals down and also - * loads the system. - */ - pad = (pad * ospd + 5) / 10; - while (pad--) - putchr(*PC); -} - -static void xputs(const char *s) { while (*s) @@ -612,7 +576,7 @@ xputs(const char *s) char outbuf[OBUFSIZ]; size_t obufcnt = 0; -static void +static int putchr(int cc) { unsigned char c; @@ -627,8 +591,9 @@ putchr(int cc) outbuf[obufcnt++] = c; if (obufcnt = OBUFSIZ) oflush(); - } else - (void)write(STDOUT_FILENO, c, 1); + return 1; + } + return write(STDOUT_FILENO, c, 1); } static void
CVS commit: src/libexec/getty
Module Name:src Committed By: mbalmer Date: Sat Jul 4 13:24:09 UTC 2009 Modified Files: src/libexec/getty: main.c Log Message: Remove an old workaround from SCCS times (%M% would insert the filename). To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 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/main.c diff -u src/libexec/getty/main.c:1.56 src/libexec/getty/main.c:1.57 --- src/libexec/getty/main.c:1.56 Sun Jul 20 01:09:07 2008 +++ src/libexec/getty/main.c Sat Jul 4 13:24:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.56 2008/07/20 01:09:07 lukem Exp $ */ +/* $NetBSD: main.c,v 1.57 2009/07/04 13:24:09 mbalmer 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.56 2008/07/20 01:09:07 lukem Exp $); +__RCSID($NetBSD: main.c,v 1.57 2009/07/04 13:24:09 mbalmer Exp $); #endif #endif /* not lint */ @@ -677,8 +677,7 @@ case 'd': (void)time(t); (void)strftime(db, sizeof(db), - /* SCCS eats %M% */ - %l:%M %p on %A, %d %B %Y, localtime(t)); + %l:%M%p on %A, %d %B %Y, localtime(t)); xputs(db); break;