chiark / gitweb /
util_unlink_secure(): chmod() before chown()
authorKay Sievers <kay.sievers@vrfy.org>
Tue, 8 Dec 2009 17:44:45 +0000 (18:44 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 8 Dec 2009 17:44:45 +0000 (18:44 +0100)
libudev/libudev-util-private.c

index 5b3e337..c05c157 100644 (file)
@@ -114,8 +114,8 @@ int util_unlink_secure(struct udev *udev, const char *filename)
 {
        int err;
 
-       chmod(filename, 0000);
        chown(filename, 0, 0);
+       chmod(filename, 0000);
        err = unlink(filename);
        if (errno == ENOENT)
                err = 0;