Jim Meyering
415dddb568
*** empty log message ***
2006-04-17 20:53:20 +00:00
Paul Eggert
ade4e95345
(openat_needs_fchdir) [defined __OPENAT_PREFIX]:
...
Turn this into a macro that always returns true.
2006-04-17 20:48:23 +00:00
Paul Eggert
39448a239a
(futimens): glibc futimesat messes up if /proc isn't mounted.
2006-04-15 07:39:46 +00:00
Jim Meyering
ca094485f9
*** empty log message ***
2006-04-14 20:33:42 +00:00
Jim Meyering
52f9cd6688
remove SPACEs before TAB
2006-04-14 16:36:34 +00:00
Jim Meyering
ea26299816
*** empty log message ***
2006-04-14 16:35:44 +00:00
Jim Meyering
47d0eb8722
(fts_open): Don't allocate parent if *argv==NULL. Patch from glibc.
2006-04-14 16:35:41 +00:00
Jim Meyering
8085d02998
(fts_build): Free `head' before returning NULL, in two places,
...
to avoid leaks. Patch from glibc.
2006-04-14 16:26:15 +00:00
Jim Meyering
d657c35562
(fts_build): Remove just-#if-0'd code and the code that
...
declares and sets cderrno.
2006-04-14 16:21:21 +00:00
Jim Meyering
091c012089
(fts_build): #if-0-out a block of unused code. Patch via glibc.
2006-04-14 16:11:01 +00:00
Paul Eggert
52bb8bdd10
Don't use wchar_t or wctype_t; update comment.
2006-04-13 22:17:17 +00:00
Paul Eggert
3125c35bc7
(RE_DUP_MAX): Update comment to match current implementation.
2006-04-13 22:16:58 +00:00
Paul Eggert
372285b207
(init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
...
is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
2006-04-13 22:16:43 +00:00
Paul Eggert
e0637b5b68
Port to Interix.
2006-04-12 20:15:30 +00:00
Paul Eggert
2fc455e2d5
Include <inttypes.h> and <stdint.h> if they exist.
2006-04-12 20:13:13 +00:00
Paul Eggert
368bc94656
Don't include <inttypes.h> or <stdint.h>, since
...
fsusage.h now does that. Include fsusage.h first, to test interface.
Prefer statvfs if it works, since it's blessed by POSIX. Attempt
at most one method (the old code could have generated decls that
didn't conform to C89, not that this was ever exercised).
2006-04-12 20:13:00 +00:00
Jim Meyering
ba75c95164
remove useless spaces before TABs
2006-04-10 19:15:08 +00:00
Paul Eggert
72021730a8
Import latest regex module from gnulib.
2006-04-10 06:46:07 +00:00
Jim Meyering
a35fc49153
.
2006-03-26 12:33:28 +00:00
Jim Meyering
864c4c28af
*** empty log message ***
2006-03-26 12:20:59 +00:00
Jim Meyering
8773d59d55
(base_name): New semantics - malloc the result.
...
Preserve // when it is special.
Preserve relative files that look like drive letters.
(base_len): Preserve // when it is special.
(last_component): New method, similar to old base_name semantics.
2006-03-26 12:20:46 +00:00
Jim Meyering
8132c6e76e
(dir_len): Determine when drive letters need a subsequent slash.
...
Preserve // when it is special.
(dir_name): Don't append dot when drive letter is absolute.
[TEST_DIRNAME]: Move into a full-blown gnulib test.
2006-03-26 12:20:24 +00:00
Jim Meyering
ba0f1e7d7f
(FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
...
[FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a drive prefix.
(IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
(last_component): New method.
2006-03-26 12:20:06 +00:00
Jim Meyering
7029f979e5
(strip_trailing_slashes): Use last_component, not base_name.
...
Strip redundant slashes from ///.
2006-03-26 12:18:51 +00:00
Jim Meyering
cb916337dc
(file_name_concat): s/base_name/last_component/
2006-03-26 12:16:11 +00:00
Jim Meyering
bfbe80d004
(check_extension, numbered_backup): s/base_name/last_component/
2006-03-26 12:15:59 +00:00
Jim Meyering
4ecf233b95
(same_name): s/base_name/last_component/
2006-03-26 12:14:16 +00:00
Jim Meyering
7cf97ab1ff
*** empty log message ***
2006-03-19 18:27:55 +00:00
Jim Meyering
164d936ac2
Work even in a chroot where d_ino values for entries in "/"
...
don't match the stat.st_ino values for the same names.
(__getcwd): When no d_ino value matches the target inode
number, iterate through all entries again, using lstat instead.
Reported by Kenshi Muto in http://bugs.debian.org/355810 .
2006-03-19 18:27:51 +00:00
Jim Meyering
e233777dbe
(__getcwd): Clarify a comment.
...
Use memcpy in place of a call to strcpy.
2006-03-19 17:18:32 +00:00
Paul Eggert
7202bc0610
regex fixes for future POSIX and --without-included-regex.
2006-03-17 07:35:25 +00:00
Paul Eggert
d01c74cabd
(regoff_t) [defined _REGEX_LARGE_OFFSETS]:
...
Typedef to long int, not to off_t, as POSIX will likely change
in that direction.
2006-03-17 07:33:40 +00:00
Jim Meyering
de33c6c49d
.
2006-03-12 22:47:35 +00:00
Jim Meyering
4798c23152
*** empty log message ***
2006-03-12 22:05:59 +00:00
Jim Meyering
f497e71465
*** empty log message ***
2006-03-12 22:03:37 +00:00
Jim Meyering
5ff988ec22
(leave_dir): If cycle-check's saved dev-ino pair matches
...
that of the current directory (which we're about to chdir ".." out of),
then save the dev-ino of the parent, instead.
2006-03-12 22:03:17 +00:00
Jim Meyering
ac1e215dc2
*** empty log message ***
2006-03-12 22:02:12 +00:00
Jim Meyering
275d9242ff
(SAME_INODE): Remove definition.
2006-03-12 22:02:03 +00:00
Jim Meyering
fa44d25fdb
Include "same-inode.h".
...
(CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
2006-03-12 22:01:29 +00:00
Jim Meyering
6ae28d0eb5
(SAME_INODE): Remove definition.
...
Include "same-inode.h", instead.
2006-03-12 21:59:55 +00:00
Jim Meyering
1ccf35a5e3
(SAME_INODE): Remove definition.
...
Include "same-inode.h", instead.
2006-03-12 21:59:29 +00:00
Jim Meyering
dc73889ce6
(SAME_INODE): New file/macro.
2006-03-12 20:45:31 +00:00
Paul Eggert
99db964248
Remove asctime_r, ctime_r, and let m4 specify the sources.
2006-03-12 08:07:34 +00:00
Paul Eggert
be8d40f7e7
(asctime_r, ctime_r): Remove.
2006-03-12 08:06:00 +00:00
Paul Eggert
9c4784e50e
(libcoreutils_a_SOURCES): Remove time_r.c, time_r.h,
...
as this is now done in m4.
2006-03-12 08:05:22 +00:00
Jim Meyering
0c0d4f5707
.
2006-02-27 10:54:09 +00:00
Jim Meyering
d3ae5ba2b4
*** empty log message ***
2006-02-27 10:52:48 +00:00
Jim Meyering
51fd587ca6
*** empty log message ***
2006-02-27 10:52:01 +00:00
Jim Meyering
0374086247
*** empty log message ***
2006-02-27 10:51:36 +00:00
Jim Meyering
021990a737
(libcoreutils_a_SOURCES): Add base64.h and base64.c.
2006-02-27 10:49:40 +00:00
Paul Eggert
6870eeeaff
(AT_FDCWD): Work around a bug in Solaris 9 and 10, where
...
AT_FDCWD exceeds INT_MAX.
2006-02-21 06:42:29 +00:00
Jim Meyering
3f7e0c2173
.
2006-02-20 13:00:54 +00:00
Jim Meyering
74699a2b52
*** empty log message ***
2006-02-16 23:10:27 +00:00
Jim Meyering
1ec610ba19
Include lstat.h, so that uses of lstat are converted
...
to uses of rpl_lstat, e.g., on Solaris 9. Otherwise, programs like
du (which now uses the openat-enabled fts and hence fstatat) would
mistakenly fail to dereference a symlink-to-directory specified
with a trailing slash.
2006-02-16 23:10:01 +00:00
Paul Eggert
05e61daca4
Sync from gnulib.
2006-02-14 23:08:59 +00:00
Paul Eggert
de107e9110
Fix typo in previous checkin: I deleted a '2' by mistake.
2006-02-11 00:36:08 +00:00
Paul Eggert
b455780a19
(close_stdout): Don't assume 'bool' converts nonzero
...
ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2006-02-08 00:08:38 +00:00
Jim Meyering
9a8fc54523
*** empty log message ***
2006-02-02 21:25:10 +00:00
Jim Meyering
b88d20f978
Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
...
failure on deficient systems, and simplify gnulib lgpl dependencies.
(rpl_lstat): Rewrite to use stat() in place of the
xmalloc/lstat combination. Based on a patch from Bruno Haible.
2006-02-02 21:25:06 +00:00
Paul Eggert
32aba5ac50
(L_): Renamed from L. All uses changed.
2006-01-27 18:41:50 +00:00
Paul Eggert
da953b9d22
Sync stdbool from gnulib.
2006-01-26 21:01:56 +00:00
Paul Eggert
a768b3ebec
Merge stdbool from gnulib; we're still not quite there yet.
2006-01-25 18:32:46 +00:00
Paul Eggert
1a9e9d670d
(true, false) [defined __BEOS__]: undef, as before.
...
(_Bool) [!@HAVE__BOOL@ && defined __GNUC__]: Use an enum
rather than a #define.
2006-01-25 18:32:19 +00:00
Jim Meyering
e2c3daca96
.
2006-01-25 08:05:45 +00:00
Jim Meyering
292e0cdfa6
Remove useless parentheses in cpp directive.
2006-01-25 07:44:28 +00:00
Jim Meyering
0a42446129
*** empty log message ***
2006-01-25 07:43:20 +00:00
Jim Meyering
d433382eaa
Remove useless parentheses in cpp directive.
2006-01-25 07:43:17 +00:00
Paul Eggert
a30a9a3ec4
Import from gnulib.
2006-01-24 07:52:03 +00:00
Jim Meyering
4cf7d77126
*** empty log message ***
2006-01-23 15:06:42 +00:00
Jim Meyering
e17e330140
Remove unused definition of N_.
2006-01-23 15:06:37 +00:00
Paul Eggert
7c364b54fc
(quotearg_buffer_restyled): Add "default: break;"
...
to pacify gcc -Wswitch-default.
2006-01-22 08:46:54 +00:00
Jim Meyering
3173cb27dd
.
2006-01-21 11:17:19 +00:00
Jim Meyering
d55e2d8528
(openat_needs_fchdir): New function.
2006-01-17 17:43:10 +00:00
Jim Meyering
88df081621
*** empty log message ***
2006-01-17 17:42:57 +00:00
Jim Meyering
264f1bc3cd
(openat_needs_fchdir): Declare it.
2006-01-17 17:42:53 +00:00
Jim Meyering
e9f0c42afc
*** empty log message ***
2006-01-17 17:24:38 +00:00
Jim Meyering
a28b096d7f
[struct FTS] (fts_cwd_fd): New member.
...
[struct FTS] (fts_rft): Remove now-unused member.
[struct FTS] (fts_cycle.state): Improve comment.
2006-01-17 17:24:29 +00:00
Jim Meyering
c1994c16c2
Rewrite fts.c not to change the current working directory,
...
by using openat, fstatat, fdopendir, etc..
[! _LIBC]: Include "openat.h" and "unistd--.h".
(HAVE_OPENAT_SUPPORT): Define.
[_LIBC] (fchdir): Don't undef or define; no longer used.
(FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
Now, this `function' always succeeds, and consumes its file descriptor
parameter -- so callers must not close such FDs. Update callers.
(diropen_fd, opendirat, cwd_advance_fd): New functions.
(diropen): Add parameter, SP. Adjust all callers.
Implement using diropen_fd, rather than open.
(fts_open): Initialize new member, fts_cwd_fd.
Remove fts_rft-setting code.
(fts_close): Close fts_cwd_fd, if necessary.
(__opendir2): Define in terms of opendir or opendirat,
depending on whether the FST_NOCHDIR flag is set.
(fts_build): Since fts_safe_changedir consumes its FD, and since
this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
and close the dup'd file descriptor upon failure.
(fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
(fts_safe_changedir): Tweak semantics to reflect that this function
now calls cwd_advance_fd and hence consumes its FD argument.
2006-01-17 17:24:14 +00:00
Jim Meyering
7dabfc7e73
.
2006-01-12 08:40:34 +00:00
Jim Meyering
c27afc1a04
*** empty log message ***
2006-01-12 07:55:40 +00:00
Jim Meyering
b78b7818af
Remove useless parentheses in cpp directives, so that
...
this file passes coreutils' `make syntax-check' tests.
2006-01-12 07:55:36 +00:00
Paul Eggert
9b6eae76de
Import from gnulib.
2006-01-12 07:21:34 +00:00
Paul Eggert
ea58c1150c
Add stdint_.h.
2006-01-12 07:21:19 +00:00
Paul Eggert
518d041db8
Adjust to md5 changes in gnulib, and make sha1 etc. more consistent
...
with md5.
2006-01-12 07:19:50 +00:00
Paul Eggert
3f83336726
(struct sha512_ctx): Use a word buffer, not a byte buffer, so that we
...
don't need to worry about alignment.
2006-01-12 07:18:39 +00:00
Paul Eggert
a60af3a64f
(struct sha256_ctx): Use a word buffer, not a byte buffer, so that we
...
don't need to worry about alignment. All uses changed.
2006-01-12 07:18:13 +00:00
Paul Eggert
25962cd489
(struct sha1_ctx): Use a word buffer, not a byte buffer,
...
so that we don't need to worry about alignment. All uses changed.
This merges the 2005-10-28 md5 change into sha1.
2006-01-12 07:17:51 +00:00
Paul Eggert
1834ba06ac
Fix commentary to match md5 better. Adjust to .h file changes.
2006-01-12 07:17:25 +00:00
Paul Eggert
3024d13d7e
(__attribute__): Remove; unused.
2006-01-12 07:16:33 +00:00
Paul Eggert
7354a360be
Fix commentary typos.
...
(alignof, UNALIGNED_P): No need for a GCC-specific version.
2006-01-12 07:16:21 +00:00
Paul Eggert
71b4960878
(BUILT_SOURCES, EXTRA_DIST, stdint.h, MOSTLYCLEANFILES):
...
Add gnulib snippet.
2006-01-12 07:16:07 +00:00
Paul Eggert
aa038250c3
Add stdint.h.
2006-01-12 07:15:48 +00:00
Jim Meyering
4eafb9d163
*** empty log message ***
2006-01-11 22:11:49 +00:00
Jim Meyering
50114df430
*** empty log message ***
2006-01-11 21:32:56 +00:00
Jim Meyering
108b46760a
*** empty log message ***
2006-01-11 21:00:42 +00:00
Jim Meyering
cf6281916b
(fts_stat): When following a symlink-to-directory,
...
don't interpret all stat-fails+lstat-succeeds as indicating a
dangling symlink. That can also happen at least for ELOOP.
The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2006-01-11 21:00:36 +00:00
Jim Meyering
f9574570b3
*** empty log message ***
2006-01-11 16:30:08 +00:00
Jim Meyering
08e4a9a00e
(fts_open): Put new (2006-01-04) maxarglen declaration and uses in their
...
own block, so pre-c99 compilers don't object.
2006-01-11 16:29:35 +00:00
Jim Meyering
f84dc6ccfc
*** empty log message ***
2006-01-11 16:19:06 +00:00
Jim Meyering
614235c849
[!_LIBC]: Include "fcntl--.h", to map open to open_safer.
2006-01-11 16:18:39 +00:00
Jim Meyering
dc9da6bde0
*** empty log message ***
2006-01-11 13:33:03 +00:00
Jim Meyering
0e42486491
(fchmodat, fchownat): Declare.
...
(chmodat, lchmodat): Define convenience functions.
(chownat, lchownat): Likewise.
2006-01-11 13:32:47 +00:00
Jim Meyering
9cbd6c0366
(fchownat): New function.
2006-01-11 13:32:03 +00:00
Jim Meyering
c6749127ca
(fchmodat): New file and function.
2006-01-11 13:30:31 +00:00
Jim Meyering
06df842f61
*** empty log message ***
2006-01-11 10:07:22 +00:00
Jim Meyering
d1fe298155
(OP): Remove useless space-before-TAB.
2006-01-11 10:07:13 +00:00
Paul Eggert
e06993903e
Sync from gnulib.
2006-01-10 20:13:35 +00:00
Paul Eggert
388f158acf
Update copyright year.
2006-01-10 20:05:53 +00:00
Paul Eggert
00eeaec5f2
Remove stray "lib/"s in previous change.
2006-01-10 20:01:34 +00:00
Paul Eggert
d11af4159e
Sync from gnulib.
2006-01-10 17:47:56 +00:00
Jim Meyering
71520b31c0
*** empty log message ***
2006-01-10 11:55:20 +00:00
Jim Meyering
58e925ce5f
Avoid the double-free (first in fts_read, second in fts_close) that
...
would occur when an `active' directory is made inaccessible (e.g.,
via chmod a-x) during a traversal.
(fts_read): After a failed fchdir, update sp->fts_cur
before returning. Reproduce this failure by
mkdir -p a/b; cd a; chmod a-x . b
Reported by Stavros Passas.
2006-01-10 11:55:13 +00:00
Jim Meyering
e774de2be6
*** empty log message ***
2006-01-10 10:23:27 +00:00
Jim Meyering
0cb6f1cc82
fix typo in comment
2006-01-09 20:32:08 +00:00
Jim Meyering
00d069f7d9
*** empty log message ***
2006-01-06 16:48:27 +00:00
Jim Meyering
ea20facd90
(COPYRIGHT_YEAR): Update to 2006.
2006-01-06 16:48:24 +00:00
Jim Meyering
084903a2b1
.
2006-01-04 21:06:39 +00:00
Paul Eggert
15954c3753
(tzname): Don't declare if it is already #defined.
2006-01-04 18:57:24 +00:00
Jim Meyering
0aea37a1b3
*** empty log message ***
2006-01-04 07:13:10 +00:00
Jim Meyering
27ab46340c
Merge from glibc.
...
(fts_open): Avoid function call in MAX macro use.
2006-01-04 07:12:22 +00:00
Paul Eggert
a2fa57b24c
(xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
...
long int, not int, for nanosecond counts, so that people who are
used to POSIX struct timespec won't be surprised.
2006-01-03 23:21:38 +00:00
Jim Meyering
b9c62b6747
correct first-line comment
2006-01-03 10:29:58 +00:00
Paul Eggert
c0dac69808
New approach to safer chmod.
2006-01-02 07:30:27 +00:00
Paul Eggert
bee93bd060
No longer used.
2006-01-02 07:18:30 +00:00
Paul Eggert
e59703a1d6
New file.
2006-01-02 06:34:32 +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
eb330d2584
chdir-related fixes
2005-12-27 08:00:42 +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
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
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
05eb4556c8
.
2005-12-21 09:48:41 +00:00
Jim Meyering
a7c7b483f1
*** empty log message ***
2005-12-21 09:43:44 +00:00
Jim Meyering
2956eb272c
like chdir(2), but safer, if possible
2005-12-21 09:42:36 +00:00
Jim Meyering
3108671902
*** empty log message ***
2005-12-20 14:23:25 +00:00
Jim Meyering
d0344cfc55
(RW_USR): Remove definition.
...
(make_dir_parents): Use S_IRWXU, now that read access is also required.
Avoid a race condition, on systems where open honors O_NOFOLLOW.
(make_dir_parents): Include chdir-safer.h.
Use chdir_no_follow in place of chdir.
2005-12-20 14:23:20 +00:00
Jim Meyering
0b7757fac4
*** empty log message ***
2005-12-20 10:28:58 +00:00
Jim Meyering
cf02d3c6f6
(make_dir_parents): Remove unnecessary casts of alloca,
...
since now it's guaranteed to be (void *).
2005-12-20 10:28:53 +00:00
Jim Meyering
ddb24aa9fb
*** empty log message ***
2005-12-20 10:24:43 +00:00
Jim Meyering
7be64dd68f
(fchmod_new): Don't try to close fd if it's < 0.
2005-12-20 10:24:37 +00:00
Jim Meyering
e0029290b8
.
2005-12-19 18:13:00 +00:00
Jim Meyering
89276658f2
.
2005-12-19 18:12:30 +00:00
Jim Meyering
c99e1d2cb6
.
2005-12-17 10:48:30 +00:00
Jim Meyering
c4a1355047
*** empty log message ***
2005-12-17 10:48:12 +00:00
Jim Meyering
4a12f5ebcf
(acl_entries): Add fallback implementation for POSIX ACL
...
systems other than Linux.
(chmod_or_fchmod): New function: use fchmod when possible,
and chmod otherwise.
(file_has_acl): Add a POSIX ACL implementation, with a
Linux-specific subcase.
(copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
S_ISVTX from one file to another. Fall back to fchmod/chmod when
acls are unsupported.
(set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
are unsupported.
2005-12-17 10:31:33 +00:00
Jim Meyering
9566c9c9d3
(copy_acl, set_acl): Add declarations.
2005-12-17 10:31:15 +00:00
Paul Eggert
1833362111
remove/openat cleanup
2005-12-17 06:56:19 +00:00
Paul Eggert
3f86aaadcf
Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
...
"gettext.h"; either no longer needed or are guaranteed by openat.h.
(_): Remove; no longer needed.
(openat): Renamed from rpl_openat; no need for rpl_openat
since openat.h renames openat for us.
Replace most of the body with a call to openat_permissive,
to avoid duplicate code.
Port to (probably hypothetical) environments were mode_t is
wider than int.
(openat_permissive): Require mode arg, so that we can check
types better. Put it just after flags. Change cwd failure
indicator from pointer-to-bool to pointer-to-errno-value.
All callers changed.
Invoke openat_save_fail and/or openat_restore_fail if
cwd_errno is null, so that openat can call us.
(openat_permissive, fdopendir, fstatat, unlinkat):
Simplify errno handling to avoid some duplicate code,
as it's OK to set errno on success.
2005-12-17 06:55:32 +00:00
Paul Eggert
1c5cebe703
Revamp code so that function macros depend on
...
__OPENAT_PREFIX only, not also on AT_FDCWD.
(openat_ro): Remove. Caller changed to use openat_permissive.
(openat_permissive): Now a macro, if not a function.
(openat_restore_fail, openat_save_fail): Now always functions,
since mkdirat needs them even if __OPENAT_PREFIX is defined.
2005-12-17 06:55:01 +00:00
Jim Meyering
049a807bc6
.
2005-12-15 14:47:36 +00:00
Jim Meyering
b0cee61e23
*** empty log message ***
2005-12-14 20:37:24 +00:00
Jim Meyering
bd78a76886
(libcoreutils_a_SOURCES): Remove fprintftime.c
...
and fprintftime.h. Now they're pulled in via the .m4 file.
2005-12-14 20:37:06 +00:00
Paul Eggert
23b2b5c660
* Makefile.am (stdbool.h): Resurrect the 'sed' that goes along
...
with '#if !@HAVE_BOOL@".
2005-12-14 00:09:23 +00:00
Paul Eggert
a6caba2509
(stdbool.h): Resurrect the 'sed' that goes along with '#if !@HAVE_BOOL@".
2005-12-14 00:08:54 +00:00
Paul Eggert
4170c66d45
(_Bool): Resurrect the "#if !@HAVE__BOOL@" check, to
...
work around compilers that have a (possibly-broken) _Bool but lack
a working <stdbool.h>.
2005-12-13 19:42:27 +00:00
Paul Eggert
5ea987eade
* lib/stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
...
TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
porting problem reported by Georg Schwarz in
<http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html >.
* m4/stat-time.m4 (gl_STAT_TIME): Likewise.
2005-12-07 18:22:05 +00:00
Paul Eggert
19af464ef3
Mention reporters for "none" and "proc" mounts.
2005-12-05 17:46:22 +00:00
Jim Meyering
5e36a5a28f
*** empty log message ***
2005-12-04 22:00:18 +00:00
Jim Meyering
6a33c69c49
(EXPECTED_ERRNO): Add ENOSYS, for Solaris 8.
...
Paul Eggert reported that unlink/rmdir vs. e.g., /proc/self/fd/N/FILE
fails with ENOSYS. This makes openat revert to using save-cwd.c
functions in that case.
2005-12-04 22:00:14 +00:00
Jim Meyering
b3e300393e
.
2005-12-03 23:19:58 +00:00
Jim Meyering
e4f62b9fcf
*** empty log message ***
2005-12-02 07:49:12 +00:00
Paul Eggert
76bebf24a5
Import from gnulib.
2005-12-02 00:42:52 +00:00
Jim Meyering
46679371cb
*** empty log message ***
2005-11-30 13:05:08 +00:00
Jim Meyering
798f577bec
Include openat-priv.h.
...
Remove definitions of macros defined therein.
2005-11-30 13:04:26 +00:00
Jim Meyering
07c80bab50
Define macros used by mkdirat.c and openat.c.
2005-11-30 13:03:21 +00:00
Jim Meyering
48a8638c23
*** empty log message ***
2005-11-30 12:40:12 +00:00
Jim Meyering
29a3f2f810
(mkdirat): Declare.
2005-11-30 12:40:09 +00:00
Jim Meyering
3f23bf599c
*** empty log message ***
2005-11-30 12:39:30 +00:00
Jim Meyering
2e72b76fd3
(mkdirat): New file and function.
2005-11-30 12:39:14 +00:00
Paul Eggert
fc0fa751c4
Log today's changes.
2005-11-26 07:53:39 +00:00
Paul Eggert
1e20020bb8
(ME_DUMMY): "none" and "proc" file systems are dummies
...
too.
2005-11-26 07:52:11 +00:00
Paul Eggert
45ad3543a9
Include <limits.h>.
...
(dev_from_mount_options)
[defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
New function. It no longer assumes "dev=" has the System V meaning
on Linux (since it doesn't). It also parses "dev=" more carefully.
(read_file_system_list)
[defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
dev= in that case.
2005-11-26 07:43:50 +00:00
Paul Eggert
128bc21842
(MOSTLYCLEANFILES): Clean stdbool.h-t, not stdbool.ht.
2005-11-26 06:58:34 +00:00
Paul Eggert
b7fa297fa5
(stdbool.h): Fix typo in previous change.
2005-11-26 06:55:22 +00:00
Paul Eggert
dedcfff69c
(stdbool.h): Just copy stdbool_.h; no need to sed any more.
2005-11-26 06:54:17 +00:00
Paul Eggert
6771c1b415
Simplify greatly, under the assumption that these
...
days most people use C99-compatible compilers to debug, so it's
not worth worrying about catering to older compilers for that.
This works around some porting problems with HP-UX compilers.
(false, true) [defined __BEOS__]: Don't #undef; no longer needed.
(_Bool): typedef to bool if C++ or BeOS, and #define to signed char
otherwise.
2005-11-26 06:37:31 +00:00
Paul Eggert
c63680e87b
(gettime) [!defined OK_TO_USE_1S_CLOCK]:
...
Report an error at compile-time if only a 1-second nominal clock
resolution is found.
2005-11-26 06:30:35 +00:00
Paul Eggert
757d7a8eb5
Add buffer-lcm.
2005-11-24 06:49:10 +00:00
Paul Eggert
ef774a082b
(libcoreutils_a_SOURCES): Add buffer-lcm.c, buffer-lcm.h.
2005-11-24 06:48:55 +00:00
Paul Eggert
79eb35c4e5
Initial version
2005-11-24 06:48:36 +00:00
Paul Eggert
325619eb0d
Initial version, from diffutils
2005-11-24 06:48:03 +00:00
Jim Meyering
1aab378857
tweak grammar in comments
2005-11-23 13:36:48 +00:00
Jim Meyering
694b9b330a
*** empty log message ***
2005-11-23 13:35:15 +00:00
Jim Meyering
e8609798de
(fdopendir): Don't change errno when returning non-NULL.
2005-11-23 13:35:09 +00:00
Jim Meyering
66878248f6
.
2005-11-22 15:33:39 +00:00
Jim Meyering
9c14365b2a
*** empty log message ***
2005-11-22 14:53:55 +00:00
Jim Meyering
d591c30293
(openat_permissive): Declare.
...
(openat_ro): Define.
2005-11-22 14:53:47 +00:00
Jim Meyering
2fa54245e1
(EXPECTED_ERRNO): New macro.
...
(openat_permissive): New function -- used in remove.c rewrite.
(all functions): Set errno just before returning, only if there
was an actual failure.
Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2005-11-22 14:52:48 +00:00
Jim Meyering
75e3f2ecf2
*** empty log message ***
2005-11-20 09:10:35 +00:00
Jim Meyering
800af65fec
.
2005-11-20 08:52:08 +00:00
Jim Meyering
18673b9f2d
*** empty log message ***
2005-11-20 08:51:38 +00:00
Jim Meyering
e88132fa06
New file, mostly from euidaccess.c.
2005-11-20 08:51:10 +00:00
Jim Meyering
a1343d67f2
tweak grammar in a comment
2005-11-19 07:49:10 +00:00
Paul Eggert
8645d522c0
Don't bother with #pragma STDC FENV_ACCESS ON, as
...
coreutils no longer futzes with rounding modes.
2005-11-15 18:30:28 +00:00
Jim Meyering
db5eb389ad
Use #if !, not #ifndef, for AC_CHECK_DECLS.
2005-11-14 14:51:24 +00:00
Jim Meyering
6b869921fa
*** empty log message ***
2005-11-14 14:51:21 +00:00
Jim Meyering
13e06b3243
*** empty log message ***
2005-11-13 14:07:11 +00:00
Jim Meyering
dcd8aa97f2
Include <config.h>, required for possible replacement of mkstemp.
2005-11-13 14:07:06 +00:00
Jim Meyering
3fd87d8e73
*** empty log message ***
2005-11-12 10:16:50 +00:00
Jim Meyering
716377a20a
*** empty log message ***
2005-11-12 10:06:34 +00:00
Jim Meyering
108429b83f
Emulate openat-family functions using Linux's procfs, if possible.
...
Idea and some code from Ulrich Drepper's glibc changes.
(BUILD_PROC_NAME): New macro.
Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
(rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
before falling back on save_cwd and restore_cwd.
(fdopendir, fstatat, unlinkat): Likewise.
2005-11-12 10:06:29 +00:00
Jim Meyering
7fdc7d4df9
*** empty log message ***
2005-11-10 23:20:09 +00:00
Jim Meyering
e5475103aa
(fstatat, unlinkat): Perform the syscall directly,
...
skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2005-11-10 23:20:05 +00:00
Paul Eggert
9d9e6430a3
Fix comment
2005-11-10 20:20:31 +00:00
Paul Eggert
163141255f
Include "timespec.h" rather than the sys/time / time
...
business.
(gethrxtime) [! (HAVE_NANOUPTIME
|| (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
|| HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
our own approximation.
2005-11-10 20:20:20 +00:00
Paul Eggert
14f7ef9d17
gethrxtime now uses gettime
2005-11-10 20:20:02 +00:00
Jim Meyering
aad084f10f
Use /dev/full if possible for descriptor 0 -- like glibc now does.
...
Fall back on /dev/null if opening /dev/full fails.
2005-11-09 20:53:41 +00:00
Paul Eggert
4b15886f93
"touch 0101000000" now operates as POSIX 1002.1-2001 requires.
2005-11-01 23:43:38 +00:00
Paul Eggert
71fa8dc28e
(PDS_PRE_2000): New macro.
2005-11-01 23:42:16 +00:00
Paul Eggert
1a0a832ac8
(year): Arg is now syntax_bits rather than allow_century.
...
All usages changed. Reject dates outside the range 1969-1999 if
PDS_PRE_2000 is used.
2005-11-01 23:41:56 +00:00
Paul Eggert
a54170c2a0
Fix porting problems reported by Theodoros V. Kalamatianos.
2005-10-30 21:46:00 +00:00
Paul Eggert
9c9083d9a7
[defined HAVE_CONFIG_H]: Include <config.h>, so that large files can be opened.
2005-10-30 21:44:31 +00:00
Paul Eggert
9fb982e150
(futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
...
Don't assume that futimes failing means we must fail.
2005-10-30 21:32:02 +00:00
Paul Eggert
b90c07efd8
(__getcwd): Don't assume that system calls after readdir
...
leave errno alone. Problem reported by Dmitry V. Levin.
2005-10-30 01:31:32 +00:00
Paul Eggert
5648577df0
(savedir): Don't assume that xrealloc etc. leave errno alone.
2005-10-28 23:06:42 +00:00
Jim Meyering
e928445598
*** empty log message ***
2005-10-24 13:36:03 +00:00
Jim Meyering
e8871a9516
(make_dir_parents): Like the code above it, don't rely
...
on mkdir failing with a particular errno value (EEXIST).
Based on a patch by Dmitry V. Levin.
2005-10-24 13:35:59 +00:00
Jim Meyering
d038ef379e
*** empty log message ***
2005-10-24 10:22:19 +00:00
Jim Meyering
b8cedd257a
(make_dir_parents): Make the preceding fix a little
...
more robust, e.g., when the final component is created as a non-
directory by another process just before `mkdir -p's final mkdir.
2005-10-24 10:22:10 +00:00
Jim Meyering
946e7dc930
*** empty log message ***
2005-10-24 10:03:51 +00:00
Jim Meyering
5b427ce7c3
A command like `mkdir -p nonexistent/.' would create the
...
directory but exit nonzero with a diagnostic. This could also be
triggered with a non-`.' component, e.g., in a race with another
process running the same `mkdir -p nonexistent/sub' command.
(make_dir_parents): Handle the case of an existing final component.
Reported by Matthias Andree here:
http://savannah.gnu.org/bugs/?func=detailitem&item_id=14848
2005-10-24 10:03:47 +00:00
Jim Meyering
708c4e6682
.
2005-10-23 16:00:59 +00:00
Jim Meyering
f0b2494fa6
*** empty log message ***
2005-10-23 15:59:09 +00:00
Jim Meyering
441c8bd865
from David Madore
2005-10-23 15:58:59 +00:00
Jim Meyering
00ba9322af
Remove no-longer-relevant comment.
2005-10-23 15:55:30 +00:00
Jim Meyering
e2cfa48b0f
from David Madore
2005-10-23 15:53:55 +00:00
Jim Meyering
1e12a6ad1e
*** empty log message ***
2005-10-20 14:20:41 +00:00
Jim Meyering
a4667affc0
(mode_compile): Reject an invalid mode string that
...
starts with an octal digit. From Andreas Gruenbacher.
2005-10-20 14:20:34 +00:00