]> err.no Git - systemd/commitdiff
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 5b3e337643d13a0c1cdaf38f9bb39a76a18a153f..c05c157575aa084716afab0f413c147f791bded3 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;