gluster-devel
[Top][All Lists]
Advanced

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

Re: [Gluster-devel] NULL loc in posix_acl_truncate


From: Emmanuel Dreyfus
Subject: Re: [Gluster-devel] NULL loc in posix_acl_truncate
Date: Sat, 26 May 2012 16:20:10 +0200
User-agent: MacSOUP/2.7 (unregistered for 1953 days)

Vijay Bellur <address@hidden> wrote:

> I don't think it is a f-style problem. I do not get a EPERM with the 
> testcase that you posted for qa39. Can you please provide a bigger bt?

Here is a minimal test case that reproduces the problem at mine. Run it
as un unprivilegied user in a directory you on which you have write
access:

$ pwd
/pfs/manu/xinstall
$ ls -ld .
drwxr-xr-x  4 manu  manu  512 May 26 16:17 .
$ id
uid=500(manu) gid=500(manu) groups=500(manu),0(wheel)
$ ./test
test: fchmod failed: Permission denied


#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <err.h>
#include <errno.h>
#include <sysexits.h>
#include <sys/stat.h>

#define TESTFILE "testfile"

int
main(void)
{
        int fd;
        char buf[16384];

        if ((unlink(TESTFILE) == -1) && (errno != ENOENT))
                err(EX_OSERR, "unlink failed");

        if ((fd = open(TESTFILE, O_CREAT|O_EXCL|O_RDWR, 0600)) == -1)
                err(EX_OSERR, "open failed");

        if (write(fd, buf, sizeof(buf)) != sizeof(buf))
                err(EX_OSERR, "write failed");

        if (fchmod(fd, 0555) == -1)
                err(EX_OSERR, "fchmod failed");

        if (close(fd) == -1)
                err(EX_OSERR, "close failed");

        return EX_OK;
}


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubzx@
address@hidden



reply via email to

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