NEWS.stable: log cherry-pick [e446f25]->[c092018] relocatable-shell: Update suggested...
[gnulib.git] / lib / write-any-file.c
index af489bc..1cd0b79 100644 (file)
@@ -1,6 +1,6 @@
 /* Determine whether we can write any file.
 
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
 
 #include "write-any-file.h"
 #include "priv-set.h"
+#include "root-uid.h"
 
 #include <unistd.h>
 
@@ -40,7 +41,7 @@ can_write_any_file (void)
       can = (priv_set_ismember (PRIV_FILE_DAC_WRITE) == 1);
 #else
       /* In traditional Unix, only root can unlink directories.  */
-      can = (geteuid () == 0);
+      can = (geteuid () == ROOT_UID);
 #endif
       can_write = can;
       initialized = true;