diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-03-05 17:23:46 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-03-05 17:23:46 +0000 |
commit | 96495af16ab9fe12e249c317dc4de675ecb784ad (patch) | |
tree | 4f6df317b71d9535e28d89e71dc40f1e6af9d1aa | |
parent | 758c44b25cccdb193746352a25a8cd999968669f (diff) |
Don't delete ptmp if we didn't create it ourselves; Brian Poole
-rw-r--r-- | usr.sbin/adduser/adduser.perl | 6 | ||||
-rw-r--r-- | usr.sbin/adduser/rmuser.perl | 4 |
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"; } |