summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorelad <elad@NetBSD.org>2005-09-10 21:29:36 +0000
committerelad <elad@NetBSD.org>2005-09-10 21:29:36 +0000
commit83057dc7ccffb4faf4b87d4c70a0b7eeb17fbd5e (patch)
tree41555354ec0bf9f8bdd20d1f3d96dab6d9167e31 /libexec
parent85b45789bf8dac6db65c5e1fb8cc283056b3db6a (diff)
Don't chown/unlink uninitialized lockfile if not uugetty.
From Dr. Wolfgang Stukenbrock, PR/31040.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/getty/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index 03bd966cf98..320a58f6d2d 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.48 2005/06/01 15:50:00 lukem Exp $ */
+/* $NetBSD: main.c,v 1.49 2005/09/10 21:29:36 elad Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "from: @(#)main.c 8.1 (Berkeley) 6/20/93";
#else
-__RCSID("$NetBSD: main.c,v 1.48 2005/06/01 15:50:00 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.49 2005/09/10 21:29:36 elad Exp $");
#endif
#endif /* not lint */
@@ -276,7 +276,8 @@ main(int argc, char *argv[])
syslog(LOG_ERR, "%s: can't create lockfile", ttyn);
exit(1);
}
- (void) chown(lockfile, ttyowner, 0);
+ if (uugetty)
+ (void) chown(lockfile, ttyowner, 0);
login_tty(i);
}
}
@@ -434,7 +435,8 @@ main(int argc, char *argv[])
signal(SIGINT, SIG_IGN);
if (NX && *NX)
tname = NX;
- unlink(lockfile);
+ if (uugetty)
+ unlink(lockfile);
}
}