[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Savannah-cvs] administration/infra/bin sv_gatekpr.pl
From: |
Sylvain Beucler |
Subject: |
[Savannah-cvs] administration/infra/bin sv_gatekpr.pl |
Date: |
Thu, 13 Jan 2005 10:02:29 -0500 |
CVSROOT: /cvsroot/administration
Module name: administration
Branch:
Changes by: Sylvain Beucler <address@hidden> 05/01/13 14:25:04
Modified files:
infra/bin : sv_gatekpr.pl
Log message:
Keys are now recreated permanently, and output is 2>/dev/null
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/administration/administration/infra/bin/sv_gatekpr.pl.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: administration/infra/bin/sv_gatekpr.pl
diff -u administration/infra/bin/sv_gatekpr.pl:1.3
administration/infra/bin/sv_gatekpr.pl:1.4
--- administration/infra/bin/sv_gatekpr.pl:1.3 Wed Jan 12 21:31:32 2005
+++ administration/infra/bin/sv_gatekpr.pl Thu Jan 13 14:25:04 2005
@@ -25,23 +25,21 @@
use Setuid;
use Fcntl ':flock';
+# Get the projects with active download area
+# We use "!= 0" to get a behavior consistent with the Savane backend
my @projects = GetDB("groups, group_type",
"status='A' AND groups.use_download!='0' AND
group_type.can_use_download!='0' AND groups.is_public='1' AND groups.type =
group_type.type_id",
"unix_group_name");
umask 0022; # first '0' is for Perl octal mode
-my $group_mtime = (stat("/etc/group"))[9];
-
# Process active public projects
for my $project_name (sort @projects) {
chomp($project_name);
- my $keyring = "/home/gatekpr/projects/$project_name/pugring.gpg";
- my $keyring_mtime = (stat($keyring))[9];
- if (!$keyring_mtime || $keyring_mtime < $group_mtime) {
- CreateDownloadKeyring($project_name);
- }
+ # Always recreated, since the user can update his key without changing
+ # his groups membership
+ CreateDownloadKeyring($project_name);
}
## Create a keyring for the download area for this group
@@ -105,7 +103,10 @@
# child
Setuid::libc_setgid (65534) || die "can't setgid";
Setuid::libc_setuid ($uid) || die "can't suid";
- # system(('/bin/mkdir', '-p', "/home/gatekpr/projects/$group/"));
+ # Needed to avoid output when user's key is malformed.
+ # We need to update the gpg keys counters and give the
+ # user feedbck in a way or another, though.
+ open(STDERR, "> /dev/null");
exec (@gpg_args) || return 1;
}
}