[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug or feature? rmuser leaves /etc/ptmp file



On Sun, Jun 09, 2002 at 11:52:45AM -0700, OpenBSD baby wrote:
> If you do an "rmuser" for a user that doesn't exist,
> it creates, but doesn't erase, the /etc/ptmp file
> when done, locking any future add/remove user functions.

  Looks like a bug.
  
  Try the attached patch.

-- 
 __  /*-      Frank DENIS (Jedi/Sector One) <j@42-Networks.Com>     -*\  __
 \ '/    <a href="http://www.PureFTPd.Org/";> Secure FTP Server </a>    \' /
  \/  <a href="http://www.Jedi.Claranet.Fr/";> Misc. free software </a>  \/
--- usr/sbin/rmuser.orig	Sun Jun  9 11:58:05 2002
+++ usr/sbin/rmuser	Sun Jun  9 21:11:51 2002
@@ -51,7 +51,7 @@
 #$debug = 1;
 
 END {
-    if (-e $passwd_tmp && defined(fileno(NEW_PW))) {
+    if (-e $passwd_tmp) {
 	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";
     }