Paul Eggert
e59703a1d6
New file.
2006-01-02 06:34:32 +00:00
Paul Eggert
968bee81e8
(gl_MACROS): Require gl_FUNC_LCHMOD.
...
Don't require gl_CHDIR_SAFER.
2006-01-02 06:34:13 +00:00
Paul Eggert
c225633528
Include lchmod.h, lchmod.c.
...
(make_dir_parents): Use lchown rather than chown, and
lchmod rather than chmod.
2006-01-02 06:33:12 +00:00
Paul Eggert
c432136c3c
(sort invocation): Clarify that by default a blank is a space or a tab.
2005-12-29 21:45:32 +00:00
Paul Eggert
b4c0a12e3b
(sort invocation): Clarify that a blank is a space
...
or a tab.
2005-12-29 21:44:35 +00:00
Jim Meyering
00b8d64531
add src/system.h
2005-12-29 15:03:57 +00:00
Jim Meyering
c414f983b4
.
2005-12-28 10:27:47 +00:00
Jim Meyering
72f81e727d
*** empty log message ***
2005-12-28 10:27:34 +00:00
Jim Meyering
aac8ce8261
(EXTRA_DIST): Add .x-sc_prohibit_assert_without_use.
2005-12-28 10:26:58 +00:00
Jim Meyering
04354518e1
(sc_obsolete_symbols): Prohibit use of O_NDELAY.
...
(sc_prohibit_assert_without_use): New rule.
(syntax-check-rules): Add it to the list.
(CVS_LIST): Define in terms of $(srcdir).
2005-12-28 10:26:10 +00:00
Jim Meyering
67e065e79d
Don't include <assert.h>; it wasn't used.
2005-12-28 10:22:41 +00:00
Paul Eggert
eb330d2584
chdir-related fixes
2005-12-27 08:00:42 +00:00
Paul Eggert
3f11d67a56
(wipename): Use similar open flags to other places we open directories.
...
Don't bother trying to open dir for writing, since POSIX prohibits it.
2005-12-27 08:00:12 +00:00
Paul Eggert
40ea51a322
(fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
...
| O_NOFOLLOW too, for consistency with other dir-openers.
Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
(is_empty_dir): Likewise.
2005-12-27 07:59:27 +00:00
Paul Eggert
da4c548bbb
(restricted_chown):
...
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2005-12-27 07:59:00 +00:00
Paul Eggert
97fe820f88
(save_cwd): Don't bother trying to open directory
...
for write access: POSIX says that must fail.
2005-12-27 07:57:14 +00:00
Paul Eggert
ee7334652f
(rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
...
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
Fall back on chown if open failed with EACCES.
2005-12-27 07:56:33 +00:00
Paul Eggert
0d7468cabd
(defined_S_IFMT): New macro.
...
Include stat-macros.h.
Include stdlib.h, for abort().
Don't include stdio.h or assert.h; no longer needed.
(same_file_type): Don't assume S_IFMT is defined, as POSIX
does not require this. Don't assume S_IFCHR and S_IFBLK have
their usual sort of bit pattern.
(fchmod_new): Open with O_NOCTTY for as well, for minor
improvement on hosts where that matters. Don't bother to assert,
since the caller (in this source file) checks the same thing.
Discard any errno from a close failure, for consistency with other
code.
2005-12-27 07:55:50 +00:00
Paul Eggert
cc4d59e9cd
(diropen): Don't bother trying to open directory for write access:
...
POSIX says that must fail.
2005-12-27 07:55:03 +00:00
Paul Eggert
8846a6bfdd
(chdir_no_follow): Don't bother trying to open directory for write
...
access: POSIX says that must fail.
2005-12-27 07:54:37 +00:00
Paul Eggert
a2c8ec26a4
(cdb_free): Don't bother trying to open directory
...
for write access: POSIX says that must fail.
(cdb_free): Open with O_NOCTTY | O_NONBLOCK as
well, for minor improvements on hosts that lack O_DIRECTORY.
2005-12-27 07:53:50 +00:00
Jim Meyering
edf69af317
(chdir_no_follow): Move declaration of local,
...
sb2, `down' into the scope where it is used.
Note that on some systems this function also fails when DIR
is a writable-yet-unreadable directory.
2005-12-26 18:53:58 +00:00
Jim Meyering
078800a00b
*** empty log message ***
2005-12-26 18:53:46 +00:00
Paul Eggert
7cffc5f20e
chdir-safer.c still needs unistd.h
2005-12-25 21:40:01 +00:00
Paul Eggert
f7a0d07623
Whoops; don't remove the include for unistd.h, since it defines fchdir.
2005-12-25 21:38:43 +00:00
Paul Eggert
11eedd84d3
chdir-safer cleanup
2005-12-25 21:35:51 +00:00
Paul Eggert
8b9f6b163a
(chdir_no_follow): Don't include stdio.h, assert.h,
...
unistd.h, fcntl--.h; not needed.
(O_DIRECTORY): Define if not already defined.
(chdir_no_follow): Revamp describing comment to match code more
closely. Redo use of internal vars to avoid lint complaints.
Work even if directory is writeable but not readable.
Open with O_DIRECTORY | O_NOCTTY, for benefit of hosts that
don't have O_NOFOLLOW. Use O_NONBLOCK (POSIX spelling) rather
than O_NDELAY. Don't bother invoking fstat if open does not
dereference symlink, since the result isn't used then.
Don't assume file descriptor is positive; it might be zero
now that we no longer include fcntl--.h (we don't need fcntl--.h
since we immediately close the descriptor).
2005-12-25 21:35:38 +00:00
Paul Eggert
532cf2ac33
(FCHMOD_SAFER_H): Remove: it was misnamed, and wasn't needed anyay.
2005-12-25 21:35:21 +00:00
Jim Meyering
735fb62c0f
*** empty log message ***
2005-12-25 17:34:04 +00:00
Jim Meyering
d789e78a75
(chdir_no_follow): Remove unnecessary test of S_ISDIR (sb_init.st_mode).
2005-12-25 17:33:57 +00:00
Jim Meyering
f9f6078432
(TESTS): Add p-thru-slink
2005-12-23 18:17:39 +00:00
Jim Meyering
dc217ce9c2
New file. Test for today's mkdir-p.c fix.
2005-12-23 18:16:40 +00:00
Jim Meyering
7916560259
*** empty log message ***
2005-12-23 18:15:38 +00:00
Jim Meyering
5d3118175f
(make_dir_parents): Use chdir_no_follow only
...
if we've just created the directory.
2005-12-23 18:15:33 +00:00
Jim Meyering
bdf801ef29
*** empty log message ***
2005-12-23 17:14:37 +00:00
Jim Meyering
7616f9171a
*** empty log message ***
2005-12-23 12:00:37 +00:00
Jim Meyering
2eab9d93fc
(chdir_no_follow): Rewrite to use fchdir even
...
when O_NOFOLLOW is not defined. Suggested by Eric Blake.
2005-12-23 12:00:26 +00:00
Jim Meyering
867dbd1591
*** empty log message ***
2005-12-23 08:28:19 +00:00
Jim Meyering
bd80c2e5a7
(O_NOFOLLOW): Define, if necessary.
2005-12-23 08:28:14 +00:00
Jim Meyering
6ed15904b1
(O_NOFOLLOW): Define.
2005-12-23 08:27:44 +00:00
Jim Meyering
bda1fc0aa4
*** empty log message ***
2005-12-22 15:43:25 +00:00
Jim Meyering
23490f81f8
*** empty log message ***
2005-12-22 15:42:17 +00:00
Jim Meyering
b5bfbe2385
redirect stderr to /dev/full, too (to suppress write error diagnostic)
2005-12-22 15:40:00 +00:00
Jim Meyering
2bd65173c2
*** empty log message ***
2005-12-22 14:36:22 +00:00
Jim Meyering
b6c621211b
Include "fcntl--.h" and "unistd--.h", to map open
...
and dup to open_safer and dup_safer, respectively.
(openat_permissive): Fix typo in comment.
2005-12-22 14:34:20 +00:00
Jim Meyering
1e1938032b
.
2005-12-21 10:23:51 +00:00
Jim Meyering
3114855498
*** empty log message ***
2005-12-21 10:21:20 +00:00
Jim Meyering
9eb2e69d62
Require gl_CHDIR_SAFER.
2005-12-21 10:21:04 +00:00
Jim Meyering
05eb4556c8
.
2005-12-21 09:48:41 +00:00
Jim Meyering
a7c7b483f1
*** empty log message ***
2005-12-21 09:43:44 +00:00