projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fts: add #if guards so that the fts_lgpl module still builds
[gnulib.git]
/
lib
/
write-any-file.c
diff --git
a/lib/write-any-file.c
b/lib/write-any-file.c
index
d016177
..
8492ac8
100644
(file)
--- a/
lib/write-any-file.c
+++ b/
lib/write-any-file.c
@@
-2,10
+2,10
@@
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 2007 Free Software Foundation, Inc.
- This program is free software
;
you can redistribute it and/or modify
+ 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
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2, or (at your option)
- any later version.
+ the Free Software Foundation; either version
3 of the License, or
+
(at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-13,8
+13,7
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
/* Written by Paul Eggert. */
@@
-34,10
+33,11
@@
bool
can_write_any_file (void)
{
static bool initialized;
can_write_any_file (void)
{
static bool initialized;
- static bool can;
+ static bool can
_write
;
if (! initialized)
{
if (! initialized)
{
+ bool can = false;
#if defined PRIV_EFFECTIVE && defined PRIV_FILE_DAC_WRITE
priv_set_t *pset = priv_allocset ();
if (pset)
#if defined PRIV_EFFECTIVE && defined PRIV_FILE_DAC_WRITE
priv_set_t *pset = priv_allocset ();
if (pset)
@@
-47,13
+47,13
@@
can_write_any_file (void)
&& priv_ismember (pset, PRIV_FILE_DAC_WRITE));
priv_freeset (pset);
}
&& priv_ismember (pset, PRIV_FILE_DAC_WRITE));
priv_freeset (pset);
}
- else
#else
/* In traditional Unix, only root can unlink directories. */
can = (geteuid () == 0);
#endif
#else
/* In traditional Unix, only root can unlink directories. */
can = (geteuid () == 0);
#endif
+ can_write = can;
initialized = true;
}
initialized = true;
}
- return can;
+ return can
_write
;
}
}