[pve-devel] r4913 - pve-access-control/trunk

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Jul 19 10:10:51 CEST 2010


Author: dietmar
Date: 2010-07-19 08:10:51 +0000 (Mon, 19 Jul 2010)
New Revision: 4913

Modified:
   pve-access-control/trunk/AccessControl.pm
   pve-access-control/trunk/ChangeLog
Log:
	(file_set_contents): correctly emit exception if print/close fails


Modified: pve-access-control/trunk/AccessControl.pm
===================================================================
--- pve-access-control/trunk/AccessControl.pm	2010-07-19 08:08:16 UTC (rev 4912)
+++ pve-access-control/trunk/AccessControl.pm	2010-07-19 08:10:51 UTC (rev 4913)
@@ -117,8 +117,8 @@
     eval {
 	my $fh = IO::File->new($tmpname, "w", $perm);
 	die "unable to open file '$tmpname' - $!\n" if !$fh;
-	print $fh $data;
-	close $fh;
+	die "unable to write '$tmpname' - $!\n" unless print $fh $data;
+	die "closing file '$tmpname' failed - $!\n" unless close $fh;
     };
     my $err = $@;
 

Modified: pve-access-control/trunk/ChangeLog
===================================================================
--- pve-access-control/trunk/ChangeLog	2010-07-19 08:08:16 UTC (rev 4912)
+++ pve-access-control/trunk/ChangeLog	2010-07-19 08:10:51 UTC (rev 4913)
@@ -2,6 +2,7 @@
 
 	* AccessControl.pm (authenticate_user_domain): always add timeout
 	after failed auth
+	(file_set_contents): correctly emit exception if print/close fails
 
 2010-07-19  Seth Lauzon <seth.lauzon at gmail.com>
 



More information about the pve-devel mailing list