bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils-8.2 bug-fix-only release coming soon


From: Ludovic Courtès
Subject: Re: coreutils-8.2 bug-fix-only release coming soon
Date: Sat, 05 Dec 2009 00:08:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi,

Jim Meyering <address@hidden> writes:

> Ludovic Courtès wrote:
>> The latest build has all the output:
>> http://hydra.nixos.org/build/171993/log/raw .
>
> Thanks for investigating.
>
>> Regarding ‘chgrp/basic’, the test finds groups='30000 65534'.  However,
>> 65534 corresponds to ‘nogroup’.  (The build process runs under a special
>> user, typically:
>>
>>   $ id nixbld1
>>   uid=30001(nixbld1) gid=65534(nogroup) groups=30000(nixbld),65534(nogroup)
>
> It looks like there is something different
> about NixOS, since normally when a user U is a member
> of a group G, and U runs "chown U:G file", that command succeeds.

After some time investigating (with help from Lluís Battle), here’s a
snippet to reproduce the problem:

--8<---------------cut here---------------start------------->8---
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int
main (int argc, char *argv[])
{
  int err;

  assert (setegid (30000) /* nixbld */ == 0);
  assert (seteuid (30001) /* nixbld1 */ == 0);
  assert (creat ("foo", O_RDWR) >= 0);
  err = chown ("foo", -1, 65534 /* nogroup */);
  if (err)
    perror ("chgrp");

  return 0;
}
--8<---------------cut here---------------end--------------->8---

The problem is that egid == 30000.  id(1) sees group 65534 from
getpwuid(3) or similar.  However, under ‘_POSIX_CHOWN_RESTRICTED’, the
chown(2) call above fails with EPERM.  QED.

I’m not sure what should be done from there...

Thanks,
Ludo’.

Attachment: pgpOnlRVOhC1B.pgp
Description: PGP signature


reply via email to

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