Code

update: databases will be created with root:adm 640 permissions
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Sep 2008 12:19:37 +0000 (12:19 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Sep 2008 12:19:37 +0000 (12:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12448 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server
gosa-si/modules/DBsqlite.pm

index f2f26ada805ec0df82fe9684ed65a776e1a25d62..8848ebef7d570ba77505c5db455b9f0ada1be337 100755 (executable)
@@ -101,6 +101,9 @@ our $forground;
 our $cfg_file;
 our ($ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password, $ldap_server_dn);
 our $known_modules;
+our $root_uid;
+our $adm_gid;
+
 
 # specifies the verbosity of the daemon_log
 $verbose = 0 ;
@@ -3135,8 +3138,8 @@ if ($server_headURL =~ /\/tag\// ||
 }
 
 # Prepare log file
-my $root_uid = getpwnam('root');
-my $adm_gid = getgrnam('adm');
+$root_uid = getpwnam('root');
+$adm_gid = getgrnam('adm');
 chmod(0640, $log_file);
 chown($root_uid, $adm_gid, $log_file);
 
index 3505dbb68573ec2060a767189b9b977c69509306..3b702376ab3a0e0464377db31b624dd05d6172b0 100644 (file)
@@ -23,11 +23,14 @@ sub new {
        }
     my $self = {dbh=>undef,db_name=>undef,db_lock=>undef,db_lock_handle=>undef};
     my $dbh = DBI->connect("dbi:SQLite:dbname=$db_name", "", "", {RaiseError => 1, AutoCommit => 1});
+    chmod(0640, $db_name);
+    chown($main::root_uid, $main::adm_gid, $db_name);
+
     $self->{dbh} = $dbh;
     $self->{db_name} = $db_name;
     $self->{db_lock} = $lock;
-    bless($self,$class);
 
+    bless($self,$class);
     return($self);
 }