[interchange-cvs] interchange - heins modified lib/Vend/File.pm
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Thu Apr 10 10:17:00 2003
User: heins
Date: 2003-04-10 14:16:02 GMT
Modified: lib/Vend File.pm
Log:
* Allow read access for Vend::admin to $Global::RunDir. This allows
reading the PID file and default location of access log.
Revision Changes Path
2.8 +8 -3 interchange/lib/Vend/File.pm
rev 2.8, prev_rev 2.7
Index: File.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/File.pm,v
retrieving revision 2.7
retrieving revision 2.8
diff -u -r2.7 -r2.8
--- File.pm 5 Apr 2003 08:43:05 -0000 2.7
+++ File.pm 10 Apr 2003 14:16:02 -0000 2.8
@@ -1,6 +1,6 @@
# Vend::File - Interchange file functions
#
-# $Id: File.pm,v 2.7 2003/04/05 08:43:05 danb Exp $
+# $Id: File.pm,v 2.8 2003/04/10 14:16:02 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -52,7 +52,7 @@
use Vend::Util;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK $errstr);
-$VERSION = substr(q$Revision: 2.7 $, 10);
+$VERSION = substr(q$Revision: 2.8 $, 10);
sub writefile {
my($file, $data, $opt) = @_;
@@ -665,7 +665,12 @@
absolute_or_relative($fn)
)
{
- $status = $write ? check_user_write($fn) : check_user_read($fn);
+ if($Vend::admin and ! $write and $fn =~ /^$Global::RunDir/) {
+ $status = 1;
+ }
+ else {
+ $status = $write ? check_user_write($fn) : check_user_read($fn);
+ }
}
if($status and $Global::FileControl) {
$status &= file_control($fn, $write, 1, caller(0))