savannah-cvs
[Top][All Lists]
Advanced

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

[Savannah-cvs] administration/infra/savane/bin sv_users


From: Elfyn McBratney
Subject: [Savannah-cvs] administration/infra/savane/bin sv_users
Date: Tue, 14 Sep 2004 21:03:58 -0400

CVSROOT:        /cvsroot/administration
Module name:    administration
Branch:         
Changes by:     Elfyn McBratney <address@hidden>        04/09/15 00:29:48

Modified files:
        infra/savane/bin: sv_users 

Log message:
        add set{gr,pw}ent() calls, add missing $user_id and clean up a little.

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

Patches:
Index: administration/infra/savane/bin/sv_users
diff -u administration/infra/savane/bin/sv_users:1.2 
administration/infra/savane/bin/sv_users:1.3
--- administration/infra/savane/bin/sv_users:1.2        Tue Sep 14 23:45:36 2004
+++ administration/infra/savane/bin/sv_users    Wed Sep 15 00:29:48 2004
@@ -2,7 +2,7 @@
 # This file is part of the Savane project
 # <http://gna.org/projects/savane/>
 #
-# $Id: sv_users,v 1.2 2004/09/14 23:45:36 beu Exp $
+# $Id: sv_users,v 1.3 2004/09/15 00:29:48 beu Exp $
 #
 #  Copyright 2001      (c) Loic Dachary <loic--at--gnu.org> (sv_cvs.pl)
 #            2003-2004 (c) Mathieu Roy <yeupou--at--gnu.org> 
@@ -192,6 +192,7 @@
 #    To limit the number of request, we use only one very long SQL request.
 
 my @www_groups;
+
 if ($subversions) { 
     # sv.gnu.org specific, related to the special group www 
     my @type1 = GetGroupList("type='1' AND status='A'", "unix_group_name");
@@ -221,8 +222,7 @@
        # If the user picked use_cvsadmin, we add him in the anoncvs group
        # to allow him to edit files in CVSROOT. 
        # (yes, this group name is no longer pertinent)
-       #print "DBG - user $user (group $group) is mashed" if !exists 
$db_user{$user};
-       my ($u,$e,$r,$a,$g,$s,$un,$use_cvsadmin) = @{$db_user{$user}};
+       #my ($u,$e,$r,$a,$g,$s,$un,$use_cvsadmin) = @{$db_user{$user}};
 
        # address@hidden 2004-01-10:
        # It is insecure to allow writing in CVSROOT
@@ -281,6 +281,8 @@
 my %etc_password;
 my @etc_users;
 my $etc_password_maxid = -1;
+
+setpwent();
 while (my @entry = getpwent()) {
     push(@etc_users, $entry[0]);
  
@@ -311,6 +313,8 @@
 my %etc_group_bygroup;
 my %etc_group;
 my $etc_group_maxid = -1;
+
+setgrent();
 while(my @entry = getgrent()) {
     $etc_group_bygroup{$entry[0]} = [ @entry ];  
     
@@ -347,6 +351,7 @@
 my %seen_in_etc;
 my @only_in_db;
 my @well_known;
+
 foreach my $user (@etc_users) { 
     $seen_in_etc{$user} = 1;
 }
@@ -390,15 +395,22 @@
 
     # We only create an account for project's members
     if (exists($db_user_group{$user})) {
-       
-       my ($user_id, $user_name, $email, $realname, $authorized_keys,
-           $gpg_keys, $status, $unix_status, $use_cvsadmin) = 
@{$db_user{$user}};
+       my ($user_id,
+           $user_name,
+           $email,
+           $realname,
+           $authorized_keys,
+           $gpg_keys,
+           $status,
+           $unix_status,
+           $use_cvsadmin,
+           $user_id) = @{$db_user{$user}};
+
        my $home = GetUserHome($user);
        my $groups = join ",", @{$db_user_group{$user}};
        my $ssh_keys_count = 0;
        my $gpg_keys_count = 0;
 
-
        print "DBG create: $user belongs to $groups\n" if $debug;
        unless ($debug) {
 
@@ -410,7 +422,9 @@
            mkdir($home);
            mkdir("$home/.ssh");
            mkdir("$home/.gnupg");
-           system(('/usr/bin/touch', "$home/.savannah", 
"$home/.ssh/authorized_keys"));
+           system(('/usr/bin/touch',
+                   "$home/.savannah",
+                   "$home/.ssh/authorized_keys"));
 
            # Create a proper account
            # (this should be done after the building of the home dir,
@@ -455,7 +469,6 @@
            "[$script] %c ---- $useradd $user ($etc_password_maxid, $email, 
$home, $ssh_keys_count ssh keys) $groups\n",
            localtime;
     }
-
 }
 
 print LOG strftime "[$script] %c - account creation done\n", localtime;




reply via email to

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