steffen: server/kolabd/kolabd kolab_bootstrap,1.12,1.13

cvs at intevation.de cvs at intevation.de
Tue Apr 12 14:12:58 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolabd/kolabd
In directory doto:/tmp/cvs-serv24191/kolabd

Modified Files:
	kolab_bootstrap 
Log Message:
fix for Issue681 (nobody/calendar password for slave)

Index: kolab_bootstrap
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/kolab_bootstrap,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- kolab_bootstrap	5 Apr 2005 20:17:44 -0000	1.12
+++ kolab_bootstrap	12 Apr 2005 12:12:56 -0000	1.13
@@ -678,8 +678,8 @@
     print "Nobody object not found, please check your input\n";
     goto SLAVESTART;
   }
-  my $entry = $mesg->entry(0);
-  $php_pw = $entry->get_value( 'userPassword' );
+  #my $entry = $mesg->entry(0);
+  #$php_pw = $entry->get_value( 'userPassword' );
 
   $calendar_dn = "cn=calendar,cn=internal,$base_dn";
   $mesg = $ldap->search(base=> $php_dn, scope=> 'exact', filter=> "(objectclass=*)");
@@ -687,8 +687,8 @@
     print "Calendar object not found, please check your input\n";
     goto SLAVESTART;
   }
-  $entry = $mesg->entry(0);
-  $calendar_pw = $entry->get_value( 'userPassword' );
+  #$entry = $mesg->entry(0);
+  #$calendar_pw = $entry->get_value( 'userPassword' );
 
   $mesg = $ldap->search(base=> "k=kolab,$base_dn", scope=> 'exact',
 			filter=> "(objectClass=*)");
@@ -699,16 +699,28 @@
   my $kolabhosts = $mesg->entry(0)->get_value( 'kolabhost', asref => 1 );
   foreach(@$kolabhosts) {
     if( lc($_) eq lc($fqdn) ) {
-      goto SLAVEOK;
+	goto SLAVEOK;
     }
   }
   print "$fqdn is not listed on the master, please correct that and try again\n";
   goto SLAVESTART;
-
  SLAVEOK:
 
   my $master_host = $ldapuri->host();
 
+  print "Reading nobody and calendar passwords from master, please type in master's root-password when asked\n";
+  open( CONF, "ssh -C $master_host 'cat $kolab_prefix/etc/kolab/kolab.conf'|");
+  my $conf;
+  $conf .= $_ while(<CONF>);
+  close(CONF);
+  $conf =~ /php_pw : (.*)/;
+  $php_pw = $1;
+  $conf =~ /calendar_pw : (.*)/;
+  $calendar_pw = $1;
+
+  (print "Error reading nobody password" && goto SLAVESTART) unless( $php_pw );
+  (print "Error reading calendar password" && goto SLAVESTART) unless( $calendar_pw );
+
   $fd = IO::File->new($kolab_config, "w+") || die "could not open $kolab_config";
   print $fd "fqdnhostname : $fqdn\n";
   print $fd "is_master : $is_master\n";
@@ -819,6 +831,8 @@
   print $fd "ldap_master_uri : $ldap_uri\n";
   print $fd "php_dn : $php_dn\n";
   print $fd "php_pw : $php_pw\n";
+  print $fd "calendar_dn : $calendar_dn\n";
+  print $fd "calendar_pw : $calendar_pw\n";
   undef $fd;
   print "done modifying $kolab_config\n\n";
   chmod 0600, $kolab_config;





More information about the commits mailing list