summaryrefslogtreecommitdiffstats
path: root/usr.sbin/adduser
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2002-03-05 17:23:45 +0000
committermillert <millert@openbsd.org>2002-03-05 17:23:45 +0000
commit518d82b22a95220d700a9c38a3c3a70f78a64d1f (patch)
tree9c0c23626d84f61bdb808e36828ebedbb718d6f3 /usr.sbin/adduser
parentstyle(9) for the example; Alexander Yurchenko (diff)
downloadwireguard-openbsd-518d82b22a95220d700a9c38a3c3a70f78a64d1f.tar.xz
wireguard-openbsd-518d82b22a95220d700a9c38a3c3a70f78a64d1f.zip
Don't delete ptmp if we didn't create it ourselves; Brian Poole
Diffstat (limited to 'usr.sbin/adduser')
-rw-r--r--usr.sbin/adduser/adduser.perl6
-rw-r--r--usr.sbin/adduser/rmuser.perl4
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl
index f9f94c175ae..ba66d903644 100644
--- a/usr.sbin/adduser/adduser.perl
+++ b/usr.sbin/adduser/adduser.perl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
-# $OpenBSD: adduser.perl,v 1.36 2002/02/23 18:54:55 espie Exp $
+# $OpenBSD: adduser.perl,v 1.37 2002/03/05 17:23:45 millert Exp $
#
# Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
# All rights reserved.
@@ -89,7 +89,7 @@ sub variables {
$group = "/etc/group";
$pwd_mkdb = "pwd_mkdb -p"; # program for building passwd database
$encryptionmethod = "blowfish";
- $rcsid = '$OpenBSD: adduser.perl,v 1.36 2002/02/23 18:54:55 espie Exp $';
+ $rcsid = '$OpenBSD: adduser.perl,v 1.37 2002/03/05 17:23:45 millert Exp $';
# List of directories where shells located
@path = ('/bin', '/usr/bin', '/usr/local/bin');
@@ -1535,7 +1535,7 @@ sub cleanup {
}
END {
- if (-e $etc_ptmp && defined PTMP) {
+ if (-e $etc_ptmp && defined(fileno(PTMP))) {
close PTMP;
unlink($etc_ptmp) || warn "Error: unable to remove $etc_ptmp: $!\nPlease verify that $etc_ptmp no longer exists!\n";
}
diff --git a/usr.sbin/adduser/rmuser.perl b/usr.sbin/adduser/rmuser.perl
index 0e97f722364..e5feebed107 100644
--- a/usr.sbin/adduser/rmuser.perl
+++ b/usr.sbin/adduser/rmuser.perl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# -*- perl -*-
#
-# $OpenBSD: rmuser.perl,v 1.4 2001/09/04 07:47:09 deraadt Exp $
+# $OpenBSD: rmuser.perl,v 1.5 2002/03/05 17:23:45 millert Exp $
#
# Copyright 1995, 1996 Guy Helmer, Madison, South Dakota 57042.
# All rights reserved.
@@ -51,7 +51,7 @@ $atjob_dir = "/var/at/jobs";
#$debug = 1;
END {
- if (-e $passwd_tmp) {
+ if (-e $passwd_tmp && defined(fileno(TMP_PW))) {
unlink($passwd_tmp) ||
warn "\n${whoami}: warning: couldn't unlink $passwd_tmp ($!)\n\tPlease investigate, as this file should not be left in the filesystem\n";
}