From owner-freebsd-bugs Fri Oct 6 21:40:12 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A55B337B66E for ; Fri, 6 Oct 2000 21:40:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id VAA72664; Fri, 6 Oct 2000 21:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from port294.megapop.eunet.no (port294.megapop.eunet.no [193.91.253.44]) by hub.freebsd.org (Postfix) with ESMTP id BEE7837B503 for ; Fri, 6 Oct 2000 21:34:20 -0700 (PDT) Received: (from suiram@localhost) by suiram.freebsd.org (8.9.3/8.9.3) id DAA04388; Sat, 7 Oct 2000 03:15:54 +0200 (CEST) (envelope-from suiram) Message-Id: <200010070115.DAA04388@suiram.freebsd.org> Date: Sat, 7 Oct 2000 03:15:54 +0200 (CEST) From: mbendiks@eunet.no Reply-To: mbendiks@eunet.no To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/21806: [patches] Request: Make default lock(1) no timeout Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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 #include @@ -70,10 +69,8 @@ #include #include #include -#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