tag 530635 patch pending thanks On Wed, 2009-05-27 at 01:09 +0200, Jonas Smedegaard wrote: > On Wed, May 27, 2009 at 12:21:14AM +0200, Frank Lin PIAT wrote: > >On Tue, 2009-05-26 at 10:25 -0400, Brent S. Elmer Ph.D. wrote: > >> > >> When I try to upgrade from 1.8.2 to 1.8.3 I get the following error: > >> > >> # moin-mass-migrate > >> Processing moin wiki at localhost/profitwiki as user www-data ... > >> failed to set egid 33 33: Bad file descriptor at > >> /usr/sbin/moin-mass-migrate line 38, <$list> line 13. > >> Processing moin wiki at localhost/profitwiki as user www-data failed with > >> code 2304 > > > >The problem seems to occur if the user account specified in > >/etc/moin/wikilist is member of some other groups that www-data. > > That script is based on (and nearly identical to) a similar script in > the ikiwiki package, so we should probably make Joey Hess aware of this, > perhaps even clone this bug for ikiwiki? What do you think?
Joey has 4 new commits (all related to this bug). The first one fix the error: http://git.ikiwiki.info/?p=ikiwiki;a=commit;h=c00890a2f033aa36dd5d88f8d3bdd5b7a927a687 up to http://git.ikiwiki.info/?p=ikiwiki;a=commit;h=5807f1de04aa7d3910e7f694e0d1e5613d8f5b41 Patch applied. Regards, Franklin
>From bacfae2d576a2acafa3705e7ca3429bd3eb4e0b3 Mon Sep 17 00:00:00 2001 From: Frank Lin PIAT <fp...@klabs.be> Date: Wed, 27 May 2009 08:07:48 +0200 Subject: [PATCH] Fix moin-mass-migrate error setting egid using NSS. This patch is a port of Joey Hess work for ikiwiki-mass-rebuild. --- debian/changelog | 9 +++++++++ debian/moin-mass-migrate | 20 ++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f1290e2..1e8f5be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +moin (1.8.3-2~PRERELEASE) UNRELEASED; urgency=low + + [ Frank Lin PIAT ] + * Fix an error in moin-mass-migrate, when setuid account belongs to a + group through NSS (ldap, psql). Closes: #530635. Thanks to Joey Hess + for the patch (initially targeted to ikiwiki-mass-rebuild). + + -- Frank Lin PIAT <fp...@klabs.be> Wed, 27 May 2009 07:55:30 +0200 + moin (1.8.3-1) unstable; urgency=high [ Frank Lin PIAT ] diff --git a/debian/moin-mass-migrate b/debian/moin-mass-migrate index 2a2dc4c..44e0539 100755 --- a/debian/moin-mass-migrate +++ b/debian/moin-mass-migrate @@ -17,6 +17,23 @@ sub supplemental_groups { return @list; } +sub samelists { + my %a=map { $_ => 1 } split(' ', shift()); + my %b=map { $_ => 1 } split(' ', shift()); + + foreach my $i (keys %b) { + if (! exists $a{$i}) { + return 0; + } + } + foreach my $i (keys %a) { + if (! exists $b{$i}) { + return 0; + } + } + return 1; +} + sub processline { my $user=shift; my $url=shift; @@ -33,8 +50,7 @@ sub processline { if (! $pid) { my ($uuid, $ugid) = (getpwnam($user))[2, 3]; my $grouplist=join(" ", $ugid, $ugid, supplemental_groups($user)); - $)=$grouplist; - if ($!) { + if (! samelists(($)=$grouplist), $grouplist)) { die "failed to set egid $grouplist: $!"; } $(=$ugid; -- 1.6.2.4