The following message appears when attempting to edit a topic:
TWiki detected an internal error - please check your TWiki logs and webserver logs for more information.
RCS: failed to create path: File exists
The following lines appeared in /var/log/audit/audit.log:
type=AVC msg=audit(1137739459.945:9317662): avc: denied { getattr } for pid=21461 comm="edit" name=var dev=dm-0 ino=5003713 scontext=root:system_r:httpd_sys_script_t tcontext=system_u:object_r:var_t tclass=dir
type=SYSCALL msg=audit(1137739459.945:9317662): arch=40000003 syscall=195 success=no exit=-13 a0=93598a0 a1=917d0c8 a2=568ff4 a3=93598a0 items=1 pid=21461 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 comm="edit" exe="/usr/bin/perl"
type=AVC_PATH msg=audit(1137739459.945:9317662): path="/var"
type=PATH msg=audit(1137739459.945:9317662): item=0 name="/var" inode=5003713 dev=fd:00 mode=040755 ouid=0 ogid=0 rdev=00:00
Problem tracked to sub _mkPathTo in lib/Store/RcsFile.pm.
Attempt to stat first directory in path using -e $path (in this case, /var) is rejected by SELinux so directory appears not to exist. _mkPathTo then attempts to create the directory and reports failure.
Could change SELinux permissions, but better if Dakar works out of the box.
This code works:
sub _mkPathTo {
use File::Path;
use File::Basename;
my $file = shift;
my $path = dirname($file);
eval { mkpath($path, 0, $TWiki::cfg{RCS}{dirPermission}) };
if ($@) {
throw Error::Simple("RCS: failed to create ${path}: $!");
}
}
Thanks John
SVN 8407
CC