stracing the installation of sudo package, trips the bug on a chown()
call. From the strace'd code I've got a stripped down minimal C program
below reliably breaks it the same way.  Definitely due to the hard
linked file and chown32 system call on the file on unionfs. Got some
hard evidence now.  C code below:

#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

void main(void)
{
        int fd;

        fd = open("/usr/bin/sudoedit.dpkg-new", O_WRONLY|O_CREAT|O_EXCL, 0);
        fchown(fd, 0, 0);
        fchmod(fd, 04755);
        close(fd);
        link("/usr/bin/sudoedit", "/usr/bin/sudoedit.dpkg-tmp");
        rename("/usr/bin/sudoedit.dpkg-new", "/usr/bin/sudoedit");
        link("/./usr/bin/sudoedit", "/usr/bin/sudo.dpkg-new");
        chown("/usr/bin/sudo.dpkg-new", 0, 0);
}

Incidentally, removing the fchown and fchmod from above and the bug goes
away.

-- 
BUG ON crash probably due to unionfs when installing sudo update with dpkg
https://bugs.launchpad.net/bugs/224754
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to