savannah-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-cvs] administration/infra/bin sv_cvs_root_etc.pl


From: Sylvain Beucler
Subject: [Savannah-cvs] administration/infra/bin sv_cvs_root_etc.pl
Date: Thu, 10 Feb 2005 05:31:17 -0500

CVSROOT:        /cvsroot/administration
Module name:    administration
Branch:         
Changes by:     Sylvain Beucler <address@hidden>        05/02/10 10:31:17

Modified files:
        infra/bin      : sv_cvs_root_etc.pl 

Log message:
        Only copy the relevant group information in /etc. Indeed, the CVS proxy 
takes the first group that contains the current user, which makes it set a 
wrong GID.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/administration/administration/infra/bin/sv_cvs_root_etc.pl.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: administration/infra/bin/sv_cvs_root_etc.pl
diff -u administration/infra/bin/sv_cvs_root_etc.pl:1.2 
administration/infra/bin/sv_cvs_root_etc.pl:1.3
--- administration/infra/bin/sv_cvs_root_etc.pl:1.2     Mon Jan 10 19:38:44 2005
+++ administration/infra/bin/sv_cvs_root_etc.pl Thu Feb 10 10:31:15 2005
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -T
 # Copies /etc/passwd and /etc/group in each project cvs root
 #
-# Copyright (C) 2004  Sylvain Beucler
+# Copyright (C) 2004, 2005  Sylvain Beucler
 #
 # This file is part of Savane.
 # 
@@ -58,11 +58,11 @@
 ##
 
 open(PASSWD, "< /etc/passwd");
-my @passwd = <PASSWD>;
+my @passwd_lines = <PASSWD>;
 close(PASSWD);
 
 open(GROUP, "< /etc/group");
-my @group = <GROUP>;
+my @group_lines = <GROUP>;
 close(GROUP);
 
 
@@ -76,6 +76,8 @@
 #    ($uid > 1000) 1 : 0;
 #} @passwd;
 
+my %group_content;
+# Builds the groups hash
 # Add www members to each webgroup
 map {
     my ($name, $x, $gid, $userlist) = split(":", $_);
@@ -84,7 +86,8 @@
        $userlist = ($userlist) ? "$userlist,$www_members" : $www_members;
        $_ = join(":", $name, $x, $gid, $userlist) . "\n";
     }
-} @group;
+    $group_content{$name} = $_;
+} @group_lines;
 
 # Debug
 # grep { print $_; } @group;
@@ -94,8 +97,8 @@
 # Copying
 ##
 
-my $passwd_content = join('', @passwd);
-my $group_content = join('', @group);
+my $passwd_content = join('', @passwd_lines);
+#my $group_content = join('', @group_lines);
 
 my $passwd_mtime = (stat("/etc/passwd"))[9];
 my $group_mtime = (stat("/etc/group"))[9];
@@ -113,7 +116,8 @@
     my $repos_group = "/savannah/cvsroot/$project_name/etc/group";
     my $repos_group_mtime = (stat($repos_group))[9];
     if (!$repos_group_mtime || $repos_group_mtime < $group_mtime) {
-       copy($group_content, $repos_group);
+       copy($group_content{$project_name}
+            .$group_content{"web".$project_name}, $repos_group);
     }
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]