[Slim-Checkins] r10017 - /trunk/server/slimserver.pl
dsully at svn.slimdevices.com
dsully at svn.slimdevices.com
Sun Sep 24 09:35:02 PDT 2006
Author: dsully
Date: Sun Sep 24 09:35:02 2006
New Revision: 10017
URL: http://svn.slimdevices.com?rev=10017&view=rev
Log:
Bug: N/A
Description: Windows doesn't have getpw*
Modified:
trunk/server/slimserver.pl
Modified: trunk/server/slimserver.pl
URL: http://svn.slimdevices.com/trunk/server/slimserver.pl?rev=10017&r1=10016&r2=10017&view=diff
==============================================================================
--- trunk/server/slimserver.pl (original)
+++ trunk/server/slimserver.pl Sun Sep 24 09:35:02 2006
@@ -853,6 +853,11 @@
sub changeEffectiveUserAndGroup {
+ # Windows doesn't have getpwnam, and the uid is always 0.
+ if ($^O eq 'MSWin32') {
+ return;
+ }
+
# Don't allow the server to be started as root.
# MySQL can't be run as root, and it's generally a bad idea anyways.
#
@@ -860,7 +865,7 @@
my $testUser = 'slimserver';
my $uid = getpwnam($testUser);
- if ($^O ne 'MSWin32' && $> == 0 && !$uid || $uid != 0) {
+ if ($> == 0 && (!defined $uid || $uid == 0)) {
# Don't allow the server to be started as root.
# MySQL can't be run as root, and it's generally a bad idea anyways.
More information about the checkins
mailing list