Re: NULL loc in posix_acl_truncate

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

 



Vijay Bellur <vbellur@xxxxxxxxxx> 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@
manu@xxxxxxxxxx



[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux