Re: qa39 crash

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

 



On Tue, May 01, 2012 at 10:29:22PM -0700, Anand Avati wrote:
> Can you confirm if this fixes (obvious bug) -

I do not crash anymore, but I spotted another bug, I do not know if
it is related: removing owner write access to a non empty file open 
with write access fails with EPERMo

Here is my test case. It works fine with glusterfs-3.2.6 but fchmod()
fails with EPERM on 3.3.0qa39

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

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

        if ((fd = open("test.tmp", O_RDWR|O_CREAT, 0644)) == -1)
                err(EX_OSERR, "fopen failed");

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

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

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

        return EX_OK;
}



-- 
Emmanuel Dreyfus
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