To whom it may concern:
I am attempting to run slimserver 6.5.1 on a freeBSD 6.2-RELEASE
machine.
In summary, when the slimserver script is run as a particular user; it
complains that the user cannot access directories that are in fact
owned by that user with permissions 755.
The details are below. Any help would be appreciated.
When I run:
/usr/local/slimserver/slimserver.pl --user slimserv --group slimserv
I get:
mkdir /var: Permission denied at
/usr/local/slimserver/Slim/Utils/Prefs.pm line 415
I put a few print statements into Prefs.pm to try to understand what
was happening. They start at line 403 and are as follows:
print $path . "\n";
print "real uid is " . $< . "\n";
print "euid is " . $> . "\n";
print "real gid is " . $( . "\n";
print "egid is " . $) . "\n";
if (!-d $path) {
print $path . " Is not a regular dir\n";
}
Now when I run:
/usr/local/slimserver/slimserver.pl --user slimserv --group slimserv
I get:
/var/db/slimserver/playlists
real uid is 0
euid is 104
real gid is 0 5 0 104
egid is 104 5 0 104
/var/db/slimserver/playlists Is not a regular dir
mkdir /var: Permission denied at
/usr/local/slimserver/Slim/Utils/Prefs.pm line 419
This surprises me because the user "slimserv" is uid and gid 104, and
they own the directory /var/db/slimserver/playlists. They also own
slimserver with read write execute access to both directories.
Here's proof:
[EMAIL PROTECTED]:../Temp> ls -aloh /var/db/slimserver/
total 8
drwxr-xr-x 4 slimserv slimserv - 512B May 11 12:00 .
drwxr-xr-x 11 root wheel - 512B May 11 17:05 ..
drwxr-xr-x 2 slimserv slimserv - 512B May 11 12:00 cache
drwxr-xr-x 2 slimserv slimserv - 512B May 11 15:55 playlists
-rw-r--r-- 1 slimserv slimserv - 0B May 11 12:00
slimserver.conf
Slimserv also has read and execute access to var and db as shown
below:
[EMAIL PROTECTED]:../var> ls -aloh /var
total 46
drwxr-xr-x 23 root wheel - 512B May 6 09:04 .
drwxr-xr-x 11 root wheel - 512B May 11 17:05 db
Interestingly, I can produce the same effect with a small perl script:
#!/usr/bin/perl
use File::Path;
use Carp::Heavy;
$> = 104;
$path ="/var/db/slimserver/playlists";
if (-r $path) {
print "File is readable by euid\n";
}
if (!-d $path) {
print $path . " is NOT a regular dir\n";
}
if (-d $path) {
print $path . " is a regular dir\n";
}
$newdir = $path . "/test";
mkpath($newdir);
It produces:
[EMAIL PROTECTED]:../Temp> ./test.pl
/var/db/slimserver/playlists is NOT a regular dir
mkdir /var: Permission denied at ./test.pl line 16
I can't understand why the user slimserv does not have access. Could
this have something to do with perl's security model since uid and euid
are not the same?
Any help would be appreciated.
Thanks,
Andrew
--
andrewcrouse
------------------------------------------------------------------------
andrewcrouse's Profile: http://forums.slimdevices.com/member.php?userid=11527
View this thread: http://forums.slimdevices.com/showthread.php?t=35195
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/unix