On Wed, Jan 11, 2006 at 06:30:01AM -0800, Gisle Aas wrote:

> ==== //depot/perl/mg.c#402 (text) ====
> Index: perl/mg.c
> --- perl/mg.c#401~26781~      2006-01-11 04:11:03.000000000 -0800
> +++ perl/mg.c 2006-01-11 06:23:28.000000000 -0800
> @@ -1004,15 +1004,9 @@
>       break;
>      case '(':
>       sv_setiv(sv, (IV)PL_gid);
> -#ifdef HAS_GETGROUPS
> -     Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_gid);
> -#endif
>       goto add_groups;
>      case ')':
>       sv_setiv(sv, (IV)PL_egid);
> -#ifdef HAS_GETGROUPS
> -     Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_egid);
> -#endif

Those two parts aren't correct, are they? Because it's possible for your
actual group not to be in the list of groups for that user. This is with
a perl that predates your change. 'm' is just a wrapper that sets real IDs to
effective IDs then execs the rest of ARGV.

$ ls -l m groups.pl 
-rwxr-xr-x    1 nick     nick           55 Jan 11 16:38 groups.pl
-rwxr-sr-x    1 nick     ftp          5487 Jan 11 16:41 m
$ cat groups.pl 
#!/usr/bin/perl
$a = $);
printf ">%d< >%s<\n", $a, $a;
$ ./groups.pl 
>1000< >1000 30 29 25 4 1000<
$ ./m groups.pl 
>102< >102 30 29 25 4 1000<


So I can end up with my effective or real IDs not in the list.

Nicholas Clark

Reply via email to