2012-03-21 00:34:57 +04:00
|
|
|
/* $NetBSD: lock.c,v 1.32 2012/03/20 20:34:58 matt Exp $ */
|
1994-12-22 04:06:58 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
1994-12-22 04:06:58 +03:00
|
|
|
* Copyright (c) 1980, 1987, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Bob Toxen.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 15:13:06 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-03-21 12:45:37 +03:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1997-10-19 08:15:39 +04:00
|
|
|
#include <sys/cdefs.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#ifndef lint
|
2008-07-21 18:19:20 +04:00
|
|
|
__COPYRIGHT("@(#) Copyright (c) 1980, 1987, 1993\
|
|
|
|
The Regents of the University of California. All rights reserved.");
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#ifndef lint
|
1994-12-22 04:06:58 +03:00
|
|
|
#if 0
|
|
|
|
static char sccsid[] = "@(#)lock.c 8.1 (Berkeley) 6/6/93";
|
|
|
|
#endif
|
2012-03-21 00:34:57 +04:00
|
|
|
__RCSID("$NetBSD: lock.c,v 1.32 2012/03/20 20:34:58 matt Exp $");
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/time.h>
|
1995-06-27 04:16:17 +04:00
|
|
|
#include <signal.h>
|
1995-05-02 05:22:58 +04:00
|
|
|
|
|
|
|
#include <err.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <pwd.h>
|
2004-03-17 20:01:31 +03:00
|
|
|
#include <errno.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <stdio.h>
|
1996-05-07 22:32:22 +04:00
|
|
|
#include <stdlib.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <string.h>
|
1995-05-02 05:22:58 +04:00
|
|
|
#include <termios.h>
|
1998-04-02 14:25:09 +04:00
|
|
|
#include <time.h>
|
1996-05-07 22:32:22 +04:00
|
|
|
#include <unistd.h>
|
2008-03-30 19:30:15 +04:00
|
|
|
|
|
|
|
#ifdef USE_PAM
|
|
|
|
#include <security/pam_appl.h>
|
|
|
|
#include <security/openpam.h> /* for openpam_ttyconv() */
|
|
|
|
#endif
|
|
|
|
|
1997-10-19 08:15:39 +04:00
|
|
|
#ifdef SKEY
|
|
|
|
#include <skey.h>
|
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2008-03-30 19:30:15 +04:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
#define TIMEOUT 15
|
|
|
|
|
2007-02-07 17:11:30 +03:00
|
|
|
int main(int, char **);
|
2004-03-17 20:54:25 +03:00
|
|
|
|
2007-12-15 22:44:37 +03:00
|
|
|
static void bye(int) __dead;
|
2004-03-17 20:54:25 +03:00
|
|
|
static void hi(int);
|
2007-12-15 22:44:37 +03:00
|
|
|
static void quit(int) __dead;
|
1997-10-19 08:15:39 +04:00
|
|
|
#ifdef SKEY
|
2004-03-17 20:54:25 +03:00
|
|
|
static int skey_auth(const char *);
|
1997-10-19 08:15:39 +04:00
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2004-03-17 20:54:25 +03:00
|
|
|
static struct timeval timeout;
|
|
|
|
static struct timeval zerotime;
|
|
|
|
static struct termios tty, ntty;
|
|
|
|
static int notimeout; /* no timeout at all */
|
|
|
|
static long nexttime; /* keep the timeout time */
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-10-19 08:15:39 +04:00
|
|
|
int
|
2004-03-17 20:54:25 +03:00
|
|
|
main(int argc, char **argv)
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
|
|
|
struct passwd *pw;
|
|
|
|
struct timeval timval;
|
|
|
|
struct itimerval ntimer, otimer;
|
|
|
|
struct tm *timp;
|
1995-06-07 20:09:53 +04:00
|
|
|
time_t curtime;
|
2004-03-17 20:54:25 +03:00
|
|
|
int ch, usemine;
|
|
|
|
long sectimeout;
|
1998-07-26 19:23:39 +04:00
|
|
|
char *ap, *mypw, *ttynam;
|
|
|
|
const char *tzn;
|
2004-03-17 20:54:25 +03:00
|
|
|
uid_t uid = getuid();
|
1998-07-06 10:45:41 +04:00
|
|
|
char hostname[MAXHOSTNAMELEN + 1], s[BUFSIZ], s1[BUFSIZ];
|
2008-03-30 19:30:15 +04:00
|
|
|
#ifdef USE_PAM
|
|
|
|
pam_handle_t *pamh = NULL;
|
|
|
|
static const struct pam_conv pamc = { &openpam_ttyconv, NULL };
|
|
|
|
int pam_err;
|
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2004-03-17 20:54:25 +03:00
|
|
|
if ((pw = getpwuid(getuid())) == NULL)
|
|
|
|
errx(1, "unknown uid %lu.", (u_long)uid);
|
1998-07-05 12:22:36 +04:00
|
|
|
|
1999-06-27 14:00:36 +04:00
|
|
|
notimeout = 0;
|
1993-03-21 12:45:37 +03:00
|
|
|
sectimeout = TIMEOUT;
|
|
|
|
mypw = NULL;
|
|
|
|
usemine = 0;
|
1994-06-30 07:49:43 +04:00
|
|
|
|
1999-06-27 14:00:36 +04:00
|
|
|
while ((ch = getopt(argc, argv, "npt:")) != -1)
|
1998-07-05 12:22:36 +04:00
|
|
|
switch ((char)ch) {
|
1999-06-27 14:00:36 +04:00
|
|
|
case 'n':
|
|
|
|
notimeout = 1;
|
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
case 't':
|
2006-05-11 16:02:08 +04:00
|
|
|
errno = 0;
|
2004-03-17 20:54:25 +03:00
|
|
|
if (((sectimeout = strtol(optarg, &ap, 0)) == LONG_MAX
|
|
|
|
|| sectimeout == LONG_MIN)
|
|
|
|
&& errno == ERANGE)
|
|
|
|
err(1, "illegal timeout value: %s", optarg);
|
|
|
|
if (optarg == ap || *ap || sectimeout <= 0)
|
1995-05-02 05:22:58 +04:00
|
|
|
errx(1, "illegal timeout value: %s", optarg);
|
2004-03-17 20:54:25 +03:00
|
|
|
if (sectimeout >= INT_MAX / 60)
|
|
|
|
errx(1, "too large timeout value: %ld",
|
|
|
|
sectimeout);
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
|
|
|
case 'p':
|
|
|
|
usemine = 1;
|
2008-03-30 19:30:15 +04:00
|
|
|
#ifndef USE_PAM
|
1993-03-21 12:45:37 +03:00
|
|
|
mypw = strdup(pw->pw_passwd);
|
2002-11-16 18:59:26 +03:00
|
|
|
if (!mypw)
|
|
|
|
err(1, "strdup");
|
2008-03-30 19:30:15 +04:00
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
|
|
|
case '?':
|
|
|
|
default:
|
|
|
|
(void)fprintf(stderr,
|
2004-07-13 15:55:02 +04:00
|
|
|
"usage: %s [-np] [-t timeout]\n", getprogname());
|
1993-03-21 12:45:37 +03:00
|
|
|
exit(1);
|
1998-07-05 12:22:36 +04:00
|
|
|
}
|
2008-03-30 19:30:15 +04:00
|
|
|
|
|
|
|
#if defined(USE_PAM) || defined(SKEY)
|
|
|
|
if (! usemine) { /* -p with PAM or S/key needs privs */
|
|
|
|
#endif
|
|
|
|
if (setuid(uid) == -1) /* discard privs */
|
|
|
|
err(1, "setuid failed");
|
|
|
|
#if defined(USE_PAM) || defined(SKEY)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-03-17 20:54:25 +03:00
|
|
|
timeout.tv_sec = (int)sectimeout * 60;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2004-03-17 20:54:25 +03:00
|
|
|
if (tcgetattr(STDIN_FILENO, &tty) < 0) /* get information for header */
|
|
|
|
err(1, "tcgetattr failed");
|
1993-03-21 12:45:37 +03:00
|
|
|
gethostname(hostname, sizeof(hostname));
|
1998-07-05 12:22:36 +04:00
|
|
|
hostname[sizeof(hostname) - 1] = '\0';
|
2004-03-17 20:54:25 +03:00
|
|
|
if (!(ttynam = ttyname(STDIN_FILENO)))
|
|
|
|
err(1, "ttyname failed");
|
|
|
|
if (gettimeofday(&timval, NULL) == -1)
|
|
|
|
err(1, "gettimeofday failed");
|
1995-06-07 20:09:53 +04:00
|
|
|
curtime = timval.tv_sec;
|
2004-03-17 20:54:25 +03:00
|
|
|
nexttime = timval.tv_sec + ((int)sectimeout * 60);
|
1995-06-07 20:09:53 +04:00
|
|
|
timp = localtime(&curtime);
|
1993-03-21 12:45:37 +03:00
|
|
|
ap = asctime(timp);
|
1998-12-19 22:30:57 +03:00
|
|
|
#ifdef __SVR4
|
|
|
|
tzn = tzname[0];
|
|
|
|
#else
|
1993-03-21 12:45:37 +03:00
|
|
|
tzn = timp->tm_zone;
|
1998-12-19 22:30:57 +03:00
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2004-03-17 20:54:25 +03:00
|
|
|
if (signal(SIGINT, quit) == SIG_ERR)
|
|
|
|
err(1, "signal failed");
|
|
|
|
if (signal(SIGQUIT, quit) == SIG_ERR)
|
|
|
|
err(1, "signal failed");
|
1995-05-02 05:22:58 +04:00
|
|
|
ntty = tty; ntty.c_lflag &= ~ECHO;
|
2004-03-17 20:54:25 +03:00
|
|
|
if (tcsetattr(STDIN_FILENO, TCSADRAIN, &ntty) == -1)
|
|
|
|
err(1, "tcsetattr");
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2008-03-30 19:30:15 +04:00
|
|
|
if (!usemine) {
|
1993-03-21 12:45:37 +03:00
|
|
|
/* get key and check again */
|
|
|
|
(void)printf("Key: ");
|
|
|
|
if (!fgets(s, sizeof(s), stdin) || *s == '\n')
|
1997-10-19 08:15:39 +04:00
|
|
|
quit(0);
|
1993-03-21 12:45:37 +03:00
|
|
|
(void)printf("\nAgain: ");
|
|
|
|
/*
|
|
|
|
* Don't need EOF test here, if we get EOF, then s1 != s
|
|
|
|
* and the right things will happen.
|
|
|
|
*/
|
|
|
|
(void)fgets(s1, sizeof(s1), stdin);
|
|
|
|
(void)putchar('\n');
|
|
|
|
if (strcmp(s1, s)) {
|
1995-05-02 05:22:58 +04:00
|
|
|
(void)printf("\alock: passwords didn't match.\n");
|
2004-03-17 20:54:25 +03:00
|
|
|
(void)tcsetattr(STDIN_FILENO, TCSADRAIN, &tty);
|
1993-03-21 12:45:37 +03:00
|
|
|
exit(1);
|
|
|
|
}
|
1997-05-17 23:47:50 +04:00
|
|
|
s[0] = '\0';
|
1993-03-21 12:45:37 +03:00
|
|
|
mypw = s1;
|
|
|
|
}
|
2008-03-30 19:30:15 +04:00
|
|
|
#ifdef USE_PAM
|
|
|
|
if (usemine) {
|
|
|
|
pam_err = pam_start("lock", pw->pw_name, &pamc, &pamh);
|
|
|
|
if (pam_err != PAM_SUCCESS)
|
|
|
|
err(1, "pam_start: %s", pam_strerror(NULL, pam_err));
|
|
|
|
}
|
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/* set signal handlers */
|
2004-03-17 20:54:25 +03:00
|
|
|
if (signal(SIGINT, hi) == SIG_ERR)
|
|
|
|
err(1, "signal failed");
|
|
|
|
if (signal(SIGQUIT, hi) == SIG_ERR)
|
|
|
|
err(1, "signal failed");
|
|
|
|
if (signal(SIGTSTP, hi) == SIG_ERR)
|
|
|
|
err(1, "signal failed");
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1999-06-27 14:00:36 +04:00
|
|
|
if (notimeout) {
|
2004-03-17 20:54:25 +03:00
|
|
|
if (signal(SIGALRM, hi) == SIG_ERR)
|
|
|
|
err(1, "signal failed");
|
|
|
|
(void)printf("lock: %s on %s. no timeout.\n"
|
|
|
|
"time now is %.20s%s%s",
|
1999-06-27 14:00:36 +04:00
|
|
|
ttynam, hostname, ap, tzn, ap + 19);
|
|
|
|
}
|
|
|
|
else {
|
2004-03-17 20:54:25 +03:00
|
|
|
if (signal(SIGALRM, bye) == SIG_ERR)
|
|
|
|
err(1, "signal failed");
|
1999-06-27 14:00:36 +04:00
|
|
|
|
|
|
|
ntimer.it_interval = zerotime;
|
|
|
|
ntimer.it_value = timeout;
|
2004-03-17 20:54:25 +03:00
|
|
|
if (setitimer(ITIMER_REAL, &ntimer, &otimer) == -1)
|
|
|
|
err(1, "setitimer failed");
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1999-06-27 14:00:36 +04:00
|
|
|
/* header info */
|
2004-03-17 20:54:25 +03:00
|
|
|
(void)printf("lock: %s on %s. timeout in %ld minutes\n"
|
|
|
|
"time now is %.20s%s%s",
|
|
|
|
ttynam, hostname, sectimeout, ap, tzn, ap + 19);
|
1999-06-27 14:00:36 +04:00
|
|
|
}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
for (;;) {
|
2008-03-30 19:30:15 +04:00
|
|
|
#ifdef USE_PAM
|
|
|
|
if (usemine) {
|
|
|
|
pam_err = pam_authenticate(pamh, 0);
|
|
|
|
if (pam_err == PAM_SUCCESS)
|
|
|
|
break;
|
|
|
|
goto tryagain;
|
|
|
|
}
|
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
(void)printf("Key: ");
|
|
|
|
if (!fgets(s, sizeof(s), stdin)) {
|
|
|
|
clearerr(stdin);
|
1997-10-19 08:15:39 +04:00
|
|
|
hi(0);
|
2004-03-17 20:01:31 +03:00
|
|
|
goto tryagain;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
2008-05-24 23:26:14 +04:00
|
|
|
#ifndef USE_PAM
|
1993-03-21 12:45:37 +03:00
|
|
|
if (usemine) {
|
|
|
|
s[strlen(s) - 1] = '\0';
|
1994-06-30 07:49:43 +04:00
|
|
|
#ifdef SKEY
|
|
|
|
if (strcasecmp(s, "s/key") == 0) {
|
|
|
|
if (skey_auth(pw->pw_name))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
if (!strcmp(mypw, crypt(s, mypw)))
|
|
|
|
break;
|
|
|
|
}
|
2008-05-24 23:26:14 +04:00
|
|
|
else
|
|
|
|
#endif
|
|
|
|
if (!strcmp(s, s1))
|
|
|
|
break;
|
1995-05-02 05:22:58 +04:00
|
|
|
(void)printf("\a\n");
|
2008-03-30 19:30:15 +04:00
|
|
|
tryagain:
|
2004-03-17 20:54:25 +03:00
|
|
|
if (tcsetattr(STDIN_FILENO, TCSADRAIN, &ntty) == -1
|
|
|
|
&& errno != EINTR)
|
|
|
|
err(1, "tcsetattr failed");
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
2008-03-30 19:30:15 +04:00
|
|
|
#ifdef USE_PAM
|
|
|
|
if (usemine) {
|
|
|
|
(void)pam_end(pamh, pam_err);
|
|
|
|
}
|
|
|
|
#endif
|
1997-10-19 08:15:39 +04:00
|
|
|
quit(0);
|
|
|
|
/* NOTREACHED */
|
2004-03-17 20:54:25 +03:00
|
|
|
return 0;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
1994-06-30 07:49:43 +04:00
|
|
|
#ifdef SKEY
|
|
|
|
/*
|
|
|
|
* We can't use libskey's skey_authenticate() since it
|
|
|
|
* handles signals in a way that's inappropriate
|
|
|
|
* for our needs. Instead we roll our own.
|
|
|
|
*/
|
2004-03-17 20:54:25 +03:00
|
|
|
static int
|
|
|
|
skey_auth(const char *user)
|
1994-06-30 07:49:43 +04:00
|
|
|
{
|
2000-07-29 12:40:38 +04:00
|
|
|
char s[128];
|
|
|
|
const char *ask;
|
1994-06-30 07:49:43 +04:00
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
if (!skey_haskey(user) && (ask = skey_keyinfo(user))) {
|
2004-03-17 20:54:25 +03:00
|
|
|
(void)printf("\n[%s]\nResponse: ", ask);
|
1994-06-30 07:49:43 +04:00
|
|
|
if (!fgets(s, sizeof(s), stdin) || *s == '\n')
|
|
|
|
clearerr(stdin);
|
|
|
|
else {
|
|
|
|
s[strlen(s) - 1] = '\0';
|
|
|
|
if (skey_passcheck(user, s) != -1)
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
} else
|
2004-03-17 20:54:25 +03:00
|
|
|
(void)printf("Sorry, you have no s/key.\n");
|
1994-06-30 07:49:43 +04:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-03-17 20:54:25 +03:00
|
|
|
static void
|
2012-03-21 00:34:57 +04:00
|
|
|
hi(int dummy)
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
|
|
|
struct timeval timval;
|
|
|
|
|
1999-06-27 14:00:36 +04:00
|
|
|
if (notimeout)
|
|
|
|
(void)printf("lock: type in the unlock key.\n");
|
2004-03-17 20:54:25 +03:00
|
|
|
else {
|
|
|
|
if (gettimeofday(&timval, NULL) == -1)
|
|
|
|
err(1, "gettimeofday failed");
|
|
|
|
(void)printf("lock: type in the unlock key. "
|
2008-12-29 04:26:46 +03:00
|
|
|
"timeout in %lld:%lld minutes\n",
|
|
|
|
(long long)(nexttime - timval.tv_sec) / 60,
|
|
|
|
(long long)(nexttime - timval.tv_sec) % 60);
|
2004-03-17 20:54:25 +03:00
|
|
|
}
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
2004-03-17 20:54:25 +03:00
|
|
|
static void
|
|
|
|
quit(int dummy)
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
|
|
|
(void)putchar('\n');
|
2004-03-17 20:54:25 +03:00
|
|
|
(void)tcsetattr(STDIN_FILENO, TCSADRAIN, &tty);
|
1993-03-21 12:45:37 +03:00
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
2004-03-17 20:54:25 +03:00
|
|
|
static void
|
|
|
|
bye(int dummy)
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
2004-03-17 20:54:25 +03:00
|
|
|
(void)tcsetattr(STDIN_FILENO, TCSADRAIN, &tty);
|
1993-03-21 12:45:37 +03:00
|
|
|
(void)printf("lock: timeout\n");
|
|
|
|
exit(1);
|
|
|
|
}
|