OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Thomas Lotterer
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   05-May-2004 15:10:24
  Branch: OPENPKG_2_0_SOLID                Handle: 2004050514102400

  Added files:              (Branch: OPENPKG_2_0_SOLID)
    openpkg-src/kolab       kolab.patch
  Modified files:           (Branch: OPENPKG_2_0_SOLID)
    openpkg-src/kolab       kolab.spec

  Log:
    MFC: SA-2004.019-kolab

  Summary:
    Revision    Changes     Path
    1.1.2.1     +219 -0     openpkg-src/kolab/kolab.patch
    1.24.2.3    +4  -2      openpkg-src/kolab/kolab.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/kolab/kolab.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1.2.1 kolab.patch
  --- /dev/null 2004-05-05 15:10:24.000000000 +0200
  +++ kolab.patch       2004-05-05 15:10:24.000000000 +0200
  @@ -0,0 +1,219 @@
  +This patch is based on "diff -u -d -u -d -r1.17.2.1 -r1.17.2.2"
  +o with cosmetics (commented code cleanup) removed
  +o rootpw in slapd.conf remains plain text
  +o user and groups names replaced by variables for %install substitution
  +
  +--- kolab.orig       2004-05-03 10:36:04.000000000 +0200
  ++++ kolab    2004-05-03 10:36:04.000000000 +0200
  +@@ -56,6 +56,51 @@
  + sub PROTOCOLOP_EXTENDEDREQ          () { 0x18 }
  + sub PROTOCOLOP_EXTENDEDRESP         () { 0x19 }
  + 
  ++my %config_files = (
  ++      "$kolab_prefix/etc/kolab/session_vars.php.template" => 
"$kolab_prefix/var/kolab/www/admin/include/session_vars.php",
  ++      "$kolab_prefix/etc/kolab/main.cf.template" => 
"$kolab_prefix/etc/postfix/main.cf",
  ++      "$kolab_prefix/etc/kolab/master.cf.template" => 
"$kolab_prefix/etc/postfix/master.cf",
  ++      "$kolab_prefix/etc/kolab/saslauthd.conf.template" => 
"$kolab_prefix/etc/sasl/saslauthd.conf",
  ++      "$kolab_prefix/etc/kolab/imapd.conf.template" => 
"$kolab_prefix/etc/imapd/imapd.conf",
  ++      "$kolab_prefix/etc/kolab/httpd.conf.template" => 
"$kolab_prefix/etc/apache/apache.conf",
  ++      "$kolab_prefix/etc/kolab/legacy.conf.template" => 
"$kolab_prefix/etc/apache/legacy.conf",
  ++      "$kolab_prefix/etc/kolab/php.ini.template" => 
"$kolab_prefix/etc/apache/php.ini",
  ++      "$kolab_prefix/etc/kolab/proftpd.conf.template" => 
"$kolab_prefix/etc/proftpd/proftpd.conf",
  ++      "$kolab_prefix/etc/kolab/slapd.conf.template" => 
"$kolab_prefix/etc/openldap/slapd.conf");
  ++
  ++my %permissions = (
  ++      "$kolab_prefix/var/kolab/www/admin/include/session_vars.php" => 0640,
  ++      "$kolab_prefix/etc/postfix/main.cf" => 0640,
  ++      "$kolab_prefix/etc/postfix/master.cf" => 0640,
  ++      "$kolab_prefix/etc/sasl/saslauthd.conf" => 0600,
  ++      "$kolab_prefix/etc/imapd/imapd.conf" => 0640,
  ++      "$kolab_prefix/etc/apache/apache.conf" => 0640,
  ++      "$kolab_prefix/etc/apache/legacy.conf" => 0640,
  ++      "$kolab_prefix/etc/apache/php.ini" => 0640,
  ++      "$kolab_prefix/etc/proftpd/proftpd.conf" => 0640,
  ++      "$kolab_prefix/etc/openldap/slapd.conf" => 0640,
  ++      "$kolab_prefix/etc/postfix/transport" => 0640,
  ++      "$kolab_prefix/etc/imapd/cyrus.conf" => 0640,
  ++      "$kolab_prefix/etc/imapd/imapd.group" => 0640,
  ++      "$kolab_prefix/etc/postfix/virtual" => 0640);
  ++
  ++my %ownership = (
  ++      "$kolab_prefix/var/kolab/www/admin/include/session_vars.php" => 
"@l_musr@:@l_nusr@",
  ++      "$kolab_prefix/etc/postfix/main.cf" => "@l_susr@:@l_susr@",
  ++      "$kolab_prefix/etc/postfix/master.cf" => "@l_susr@:@l_susr@",
  ++      "$kolab_prefix/etc/sasl/saslauthd.conf" => "@l_musr@:@l_musr@",
  ++      "$kolab_prefix/etc/imapd/imapd.conf" => "@l_musr@:@l_rusr@",
  ++      "$kolab_prefix/etc/apache/apache.conf" => "@l_musr@:@l_nusr@",
  ++      "$kolab_prefix/etc/apache/legacy.conf" => "@l_musr@:@l_nusr@",
  ++      "$kolab_prefix/etc/apache/php.ini" => "@l_musr@:@l_nusr@",
  ++      "$kolab_prefix/etc/proftpd/proftpd.conf" => "@l_musr@:@l_nusr@",
  ++      "$kolab_prefix/etc/openldap/slapd.conf" => "@l_musr@:@l_musr@",
  ++      "$kolab_prefix/etc/postfix/transport" => "@l_susr@:@l_susr@",
  ++      "$kolab_prefix/etc/imapd/cyrus.conf" => "@l_musr@:@l_musr@",
  ++      "$kolab_prefix/etc/imapd/imapd.group" => "@l_musr@:@l_rusr@",
  ++      "$kolab_prefix/etc/postfix/virtual" => "@l_susr@:@l_susr@");
  ++
  ++
  + 
  + #############
  + # FUNCTIONS #
  +@@ -208,12 +253,27 @@
  +   return $string;
  + }
  + 
  ++
  ++sub fixup {
  ++   my $file = shift;
  ++   my $key = shift;
  ++   
  ++   $opt_v && print "fixing perms of $file\n";
  ++
  ++   (my $owner, my $group) = split(/:/, $ownership{$key}, 2);
  ++   my $uid = (getpwnam($owner))[2];
  ++   my $gid = (getgrnam($group))[2];
  ++   chmod($permissions{$key}, $file);
  ++   chown($uid,$gid,$file);
  ++}
  ++
  ++
  + # build ( <template name> , <new config file name> )
  + sub build {
  +    my $templ = $_[0];
  +    my $conf = $_[1];
  +-   my $uid = (getpwnam("kolab"))[2];
  +-   my $gid = (getgrnam("kolab"))[2];
  ++   my $uid = (getpwnam("@l_susr@"))[2];
  ++   my $gid = (getgrnam("@l_sgrp@"))[2];
  +    $opt_v && print "creating new $conf from $templ\n";
  + 
  +    # make a copy of the last config file to detect differences
  +@@ -224,7 +284,10 @@
  +    }
  + 
  +    my $template = IO::File->new($templ, "r") || die "could not open $templ";
  +-   my $config = IO::File->new($kolab_prefix."/etc/kolab/.tmp", "w+") || die "could 
not open $conf";
  ++   my $config = IO::File->new($kolab_prefix."/etc/kolab/.tmp", "w+", 0600) || die 
"could not open $conf";
  ++   
  ++   fixup($kolab_prefix."/etc/kolab/.tmp", $conf);
  ++
  +    while (<$template>) {
  +       if (/[EMAIL PROTECTED](\S+)[EMAIL PROTECTED]/) {
  +          if ($configdata{$1}) {
  +@@ -239,8 +302,13 @@
  +    undef $template;
  +    undef $config;
  +    move($kolab_prefix."/etc/kolab/.tmp", $conf);
  +-   chown($uid,$gid,$conf);
  + 
  ++   # find all copies of config files
  ++   foreach $mask (keys %ownership) {
  ++      @filelist = map { glob($_) } $mask.".*";
  ++      chmod(0600,@filelist);
  ++   }
  ++  
  +    # find out about changes   
  +    if (!$opt_o && -f $conf.".old") {
  +          my $rc = `diff -q $conf $conf.old`;
  +@@ -273,23 +341,6 @@
  +    my $section="";
  +    my $ldapobject;
  +    my $mesg;
  +-   my %config_files = (
  +-      "$kolab_prefix/etc/kolab/session_vars.php.template" => 
"$kolab_prefix/var/kolab/www/admin/include/session_vars.php",
  +-
  +-      "$kolab_prefix/etc/kolab/main.cf.template" => 
"$kolab_prefix/etc/postfix/main.cf",
  +-      "$kolab_prefix/etc/kolab/master.cf.template" => 
"$kolab_prefix/etc/postfix/master.cf",
  +-
  +-      "$kolab_prefix/etc/kolab/saslauthd.conf.template" => 
"$kolab_prefix/etc/sasl/saslauthd.conf",
  +-
  +-      "$kolab_prefix/etc/kolab/imapd.conf.template" => 
"$kolab_prefix/etc/imapd/imapd.conf",
  +-
  +-      "$kolab_prefix/etc/kolab/httpd.conf.template" => 
"$kolab_prefix/etc/apache/apache.conf",
  +-      "$kolab_prefix/etc/kolab/legacy.conf.template" => 
"$kolab_prefix/etc/apache/legacy.conf",
  +-      "$kolab_prefix/etc/kolab/php.ini.template" => 
"$kolab_prefix/etc/apache/php.ini",
  +-
  +-      "$kolab_prefix/etc/kolab/proftpd.conf.template" => 
"$kolab_prefix/etc/proftpd/proftpd.conf",
  +-
  +-      "$kolab_prefix/etc/kolab/slapd.conf.template" => 
"$kolab_prefix/etc/openldap/slapd.conf");
  + 
  +    dolog("generating new config");
  +    
  +@@ -320,14 +371,13 @@
  +    foreach $key (keys %config_files) {
  +       build($key, $config_files{$key});
  +    }
  +-   my $uid = (getpwnam("kolab"))[2];
  +-   my $gid = (getgrnam("kolab"))[2];
  + 
  +    # put together the transport map for postfix
  +    my $configname="$kolab_prefix/etc/postfix/transport";
  +    copy($configname, $configname.".old");
  +-   chown($uid,$gid,$configname.".old");
  +    copy("$kolab_prefix/etc/kolab/transport.template", $configname);
  ++   fixup($configname, $configname);
  ++
  +    my $transport = IO::File->new($configname, "a")
  +         || die "could not write to postfix transport map";
  +    $mesg = $ldap->search(base=> "k=kolab,".$configdata{'base_dn'}, scope=> 'sub', 
filter=> "(objectclass=*)")
  +@@ -344,7 +394,6 @@
  +    }
  +    undef $ldapobject;
  +    undef $transport;
  +-   system("chown root.root $kolab_prefix/etc/postfix/*"); 
  +    system("$postmap $kolab_prefix/etc/postfix/transport");
  +    if (!$opt_o) {
  +       if (-f $configname.".old") {
  +@@ -361,9 +410,9 @@
  +       || die "could not open imapd cyrus.conf template";
  +    $configname = "$kolab_prefix/etc/imapd/cyrus.conf";
  +    copy($configname, $configname.".old");
  +-   chown($uid,$gid,$configname.".old");
  +    $opt_v && printf "creating new $configname from cyrus.conf.template\n";
  +    my $cyrusconf = IO::File->new($configname,"w") || die "could not open 
$configname";
  ++   fixup($configname, $configname);
  +    while (<$cyrustemplate>) {
  +       if (/[EMAIL PROTECTED]@{3}/ && ($configdata{"cyrus-imap"} =~ /true/i)) {
  +          $_ = "imap cmd=\"imapd -C $kolab_prefix/etc/imapd/imapd.conf\" 
listen=\"143\" prefork=0\n";
  +@@ -385,7 +434,6 @@
  +    }
  +    undef $cyrustemplate;
  +    undef $cyrusconf;
  +-   chown($uid,$gid,$configname);
  +    if (!$opt_o) {
  +      if (-f $configname.".old") {
  +         my $rc = `diff -q $configname $configname.old`;
  +@@ -400,8 +448,8 @@
  +    # collect group information from LDAP
  +    $configname = "$kolab_prefix/etc/imapd/imapd.group";
  +    copy($configname, $configname.".old");
  +-   chown($uid,$gid,$configname.".old");
  +    copy("$kolab_prefix/etc/kolab/imapd.group.template", $configname);
  ++   fixup($configname, $configname);
  +    my $groupconf = IO::File->new($configname, "a")
  +         || die "could not write to $configname";
  +    my $count = 60000;
  +@@ -422,7 +470,6 @@
  +    }
  +    undef $ldapobject;
  +    undef $groupconf;
  +-   chown($uid,$gid,$configname);
  +    if (!$opt_o) {
  +       if (-f $configname.".old") {
  +          my $rc = `diff -q $configname $configname.old`;
  +@@ -554,6 +601,7 @@
  +    #$configname2 = "$kolab_prefix/etc/postfix/aliases";
  +    copy("$kolab_prefix/etc/kolab/virtual.template",$configname);
  +    #copy("$kolab_prefix/etc/kolab/aliases.template",$configname2);
  ++   fixup($configname, $configname);
  +    my $virtual = IO::File->new($configname, "a") || die "could not write to 
$configname";
  +    #my $aliasdb = IO::File->new($configname2, "a") || die "could not write to 
$configname2";
  +    $mesg = $ldap->search(base=> $configdata{'base_dn'}, scope=> 'sub', filter=> 
'(mail=*)');
  +@@ -582,7 +630,6 @@
  +    } elsif ($opt_v) { print "warning: could not find any aliases in ldap\n"; }
  +    $virtual->close;
  +    #$aliasdb->close;
  +-   system("chown root.root $kolab_prefix/etc/postfix/*"); 
  +    system("$postmap $configname");
  +    #system("$newaliases");
  +    if (!$opt_o && -f $configname.old) {
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/kolab/kolab.spec
  ============================================================================
  $ cvs diff -u -r1.24.2.2 -r1.24.2.3 kolab.spec
  --- openpkg-src/kolab/kolab.spec      21 Apr 2004 09:39:08 -0000      1.24.2.2
  +++ openpkg-src/kolab/kolab.spec      5 May 2004 13:10:24 -0000       1.24.2.3
  @@ -41,7 +41,7 @@
   Group:        Mail
   License:      GPL
   Version:      20040217
  -Release:      2.0.1
  +Release:      2.0.2
   
   #   package options
   %option       with_genuine   no
  @@ -50,6 +50,7 @@
   Source0:      
http://www.erfrakon.de/projects/kolab/download/kolab-server-%{V_ei_maj}/src/kolab-%{V_ei_eng}-%{V_ei_adm}.src.rpm
   Source1:      ftp://ftp.zfos.org/brew/kolab/DST/cfkolab-%{V_cf}.tar.bz2
   Source2:      rc.kolab
  +Patch0:       kolab.patch
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -63,7 +64,7 @@
   PreReq:       imapd >= 2.2.3-2.0.0, imapd::with_group = yes
   PreReq:       apache >= 1.3.29-2.0.0, apache::with_gdbm_ndbm = yes, 
apache::with_mod_auth_ldap = yes, apache::with_mod_dav = yes, apache::with_mod_php = 
yes, apache::with_mod_php_gdbm = yes, apache::with_mod_php_gettext = yes, 
apache::with_mod_php_imap = yes, apache::with_mod_php_openldap = yes, 
apache::with_mod_php_xml = yes, apache::with_mod_php_pear = yes, apache::with_mod_ssl 
= yes
   %if "%{with_genuine}" == "no"
  -PreReq:       perl-kolab, perl-db
  +PreReq:       perl-kolab >= 5.8.3-2.0.2, perl-db
   %endif
   AutoReq:      no
   AutoReqProv:  no
  @@ -107,6 +108,7 @@
           admin/kolab/index.php
   %else
       %{l_gzip} -c -d kolab-%{V_ei_maj}.tar.gz | %{l_tar} xf -
  +    %patch -p0
       %{l_shtool} subst \
           -e "s;^\(# kolab_bootstrap Version .*\);\1, OpenPKG 
kolab-%{version}-%{release}, kolab-ei=%{V_ei_maj}.%{V_ei_min}, engine=%{V_ei_eng}, 
admin=%{V_ei_adm};" \
           kolab_bootstrap
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to