Date: Sat, 7 Oct 2000 03:15:54 +0200 (CEST) From: mbendiks@eunet.no To: FreeBSD-gnats-submit@freebsd.org Subject: bin/21806: [patches] Request: Make default lock(1) no timeout Message-ID: <200010070115.DAA04388@suiram.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 21806 >Category: bin >Synopsis: lock(1) currently defaults to 15 minute timeout >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Oct 06 21:40:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Marius Bendiksen >Release: FreeBSD 4.1-RELEASE i386 >Organization: n/a >Environment: not relevant. >Description: Since O'Brien introduced the ability to do no-timeout, we have still been stuck with the default of 15 minutes. I would propose to change it to no timeout; however, this probably conflicts with POLA, hence, I leave people with the patches and a decision for them to make. >How-To-Repeat: > lock -p lock: /dev/ttyv2 on suiram.no.no. timeout in 15 minutes time now is Sat Oct 7 03:13:47 CEST 2000 Key: >Fix: Following unified diff (4 line context) in /usr/src/usr.bin --- lock.c.orig Wed Sep 27 01:27:08 2000 +++ lock.c Wed Sep 27 01:36:08 2000 @@ -51,10 +51,9 @@ /* * Lock a terminal up until the given key is entered, until the root * password is entered, or the given interval times out. * - * Timeout interval is by default TIMEOUT, it can be changed with - * an argument of the form -time where time is in minutes + * Timeout interval is by default disabled. */ #include <sys/param.h> #include <sys/stat.h> @@ -70,10 +69,8 @@ #include <syslog.h> #include <unistd.h> #include <varargs.h> -#define TIMEOUT 15 - void quit(), bye(), hi(); static void usage __P((void)); struct timeval timeout; @@ -99,15 +96,16 @@ char *crypt(), *ttyname(); openlog("lock", LOG_ODELAY, LOG_AUTH); - sectimeout = TIMEOUT; + sectimeout = 0; mypw = NULL; usemine = 0; - no_timeout = 0; + no_timeout = 1; while ((ch = getopt(argc, argv, "npt:")) != -1) switch((char)ch) { case 't': + no_timeout = 0; if ((sectimeout = atoi(optarg)) <= 0) errx(1, "illegal timeout value"); break; case 'p': @@ -116,8 +114,9 @@ errx(1, "unknown uid %d", getuid()); mypw = strdup(pw->pw_passwd); break; case 'n': + /*obsolete*/ no_timeout = 1; break; case '?': default: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010070115.DAA04388>