Commit Graph

  • b4c0a12e3b (sort invocation): Clarify that a blank is a space or a tab. Paul Eggert 2005-12-29 21:44:35 +00:00
  • 00b8d64531 add src/system.h Jim Meyering 2005-12-29 15:03:57 +00:00
  • c414f983b4 . Jim Meyering 2005-12-28 10:27:47 +00:00
  • 72f81e727d *** empty log message *** Jim Meyering 2005-12-28 10:27:34 +00:00
  • aac8ce8261 (EXTRA_DIST): Add .x-sc_prohibit_assert_without_use. Jim Meyering 2005-12-28 10:26:58 +00:00
  • 04354518e1 (sc_obsolete_symbols): Prohibit use of O_NDELAY. (sc_prohibit_assert_without_use): New rule. (syntax-check-rules): Add it to the list. Jim Meyering 2005-12-28 10:26:10 +00:00
  • 67e065e79d Don't include <assert.h>; it wasn't used. Jim Meyering 2005-12-28 10:22:41 +00:00
  • eb330d2584 chdir-related fixes Paul Eggert 2005-12-27 08:00:42 +00:00
  • 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. Paul Eggert 2005-12-27 08:00:12 +00:00
  • 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. Paul Eggert 2005-12-27 07:59:27 +00:00
  • da4c548bbb (restricted_chown): Don't try O_WRONLY unless O_RDONLY failed wth EACCES. Paul Eggert 2005-12-27 07:59:00 +00:00
  • 97fe820f88 (save_cwd): Don't bother trying to open directory for write access: POSIX says that must fail. Paul Eggert 2005-12-27 07:57:14 +00:00
  • 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. Paul Eggert 2005-12-27 07:56:33 +00:00
  • 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. Paul Eggert 2005-12-27 07:55:50 +00:00
  • cc4d59e9cd (diropen): Don't bother trying to open directory for write access: POSIX says that must fail. Paul Eggert 2005-12-27 07:55:03 +00:00
  • 8846a6bfdd (chdir_no_follow): Don't bother trying to open directory for write access: POSIX says that must fail. Paul Eggert 2005-12-27 07:54:37 +00:00
  • 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. Paul Eggert 2005-12-27 07:53:50 +00:00
  • 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. Jim Meyering 2005-12-26 18:53:58 +00:00
  • 078800a00b *** empty log message *** Jim Meyering 2005-12-26 18:53:46 +00:00
  • 7cffc5f20e chdir-safer.c still needs unistd.h Paul Eggert 2005-12-25 21:40:01 +00:00
  • f7a0d07623 Whoops; don't remove the include for unistd.h, since it defines fchdir. Paul Eggert 2005-12-25 21:38:43 +00:00
  • 11eedd84d3 chdir-safer cleanup Paul Eggert 2005-12-25 21:35:51 +00:00
  • 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). Paul Eggert 2005-12-25 21:35:38 +00:00
  • 532cf2ac33 (FCHMOD_SAFER_H): Remove: it was misnamed, and wasn't needed anyay. Paul Eggert 2005-12-25 21:35:21 +00:00
  • 735fb62c0f *** empty log message *** Jim Meyering 2005-12-25 17:34:04 +00:00
  • d789e78a75 (chdir_no_follow): Remove unnecessary test of S_ISDIR (sb_init.st_mode). Jim Meyering 2005-12-25 17:33:57 +00:00
  • f9f6078432 (TESTS): Add p-thru-slink Jim Meyering 2005-12-23 18:17:39 +00:00
  • dc217ce9c2 New file. Test for today's mkdir-p.c fix. Jim Meyering 2005-12-23 18:16:40 +00:00
  • 7916560259 *** empty log message *** Jim Meyering 2005-12-23 18:15:38 +00:00
  • 5d3118175f (make_dir_parents): Use chdir_no_follow only if we've just created the directory. Jim Meyering 2005-12-23 18:15:33 +00:00
  • bdf801ef29 *** empty log message *** Jim Meyering 2005-12-23 17:14:37 +00:00
  • 7616f9171a *** empty log message *** Jim Meyering 2005-12-23 12:00:37 +00:00
  • 2eab9d93fc (chdir_no_follow): Rewrite to use fchdir even when O_NOFOLLOW is not defined. Suggested by Eric Blake. Jim Meyering 2005-12-23 12:00:26 +00:00
  • 867dbd1591 *** empty log message *** Jim Meyering 2005-12-23 08:28:19 +00:00
  • bd80c2e5a7 (O_NOFOLLOW): Define, if necessary. Jim Meyering 2005-12-23 08:28:14 +00:00
  • 6ed15904b1 (O_NOFOLLOW): Define. Jim Meyering 2005-12-23 08:27:44 +00:00
  • bda1fc0aa4 *** empty log message *** Jim Meyering 2005-12-22 15:43:25 +00:00
  • 23490f81f8 *** empty log message *** Jim Meyering 2005-12-22 15:42:17 +00:00
  • b5bfbe2385 redirect stderr to /dev/full, too (to suppress write error diagnostic) Jim Meyering 2005-12-22 15:40:00 +00:00
  • 2bd65173c2 *** empty log message *** Jim Meyering 2005-12-22 14:36:22 +00:00
  • 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. Jim Meyering 2005-12-22 14:34:20 +00:00
  • 1e1938032b . Jim Meyering 2005-12-21 10:23:51 +00:00
  • 3114855498 *** empty log message *** Jim Meyering 2005-12-21 10:21:20 +00:00
  • 9eb2e69d62 Require gl_CHDIR_SAFER. Jim Meyering 2005-12-21 10:21:04 +00:00
  • 05eb4556c8 . Jim Meyering 2005-12-21 09:48:41 +00:00
  • a7c7b483f1 *** empty log message *** Jim Meyering 2005-12-21 09:43:44 +00:00
  • 2956eb272c like chdir(2), but safer, if possible Jim Meyering 2005-12-21 09:42:36 +00:00
  • 3108671902 *** empty log message *** Jim Meyering 2005-12-20 14:23:25 +00:00
  • d0344cfc55 (RW_USR): Remove definition. (make_dir_parents): Use S_IRWXU, now that read access is also required. Jim Meyering 2005-12-20 14:23:20 +00:00
  • 0b7757fac4 *** empty log message *** Jim Meyering 2005-12-20 10:28:58 +00:00
  • cf02d3c6f6 (make_dir_parents): Remove unnecessary casts of alloca, since now it's guaranteed to be (void *). Jim Meyering 2005-12-20 10:28:53 +00:00
  • ddb24aa9fb *** empty log message *** Jim Meyering 2005-12-20 10:24:43 +00:00
  • 7be64dd68f (fchmod_new): Don't try to close fd if it's < 0. Jim Meyering 2005-12-20 10:24:37 +00:00
  • 07d7677196 . Jim Meyering 2005-12-19 18:21:11 +00:00
  • 3d49eb721b . Jim Meyering 2005-12-19 18:19:38 +00:00
  • a8b913cfdd (TESTS): Add mknod. Jim Meyering 2005-12-19 18:18:57 +00:00
  • fa6cfcb9ce (main) Avoid a minor race condition when `-m MODE' is specified, by using open, fchown, and close rather than just chown. To do that reliably (even with an overly restrictive umask), ensure that each mknod call uses a mode including at least owner-read access. Jim Meyering 2005-12-19 18:18:03 +00:00
  • 52893ffd2a (main) Avoid a minor race condition when `-m MODE' is specified, by using open, fchown, and close rather than just chown. To do that reliably (even with an overly restrictive umask), ensure that each mkdir call uses a mode including at least owner-read access. Jim Meyering 2005-12-19 18:17:16 +00:00
  • 17f521adfd (main) Avoid a minor race condition when `-m MODE' is specified, by using open, fchown, and close rather than just chown. To do that reliably (even with an overly restrictive umask), ensure that each mknod/mkfifo call uses a mode including at least owner-read access. Jim Meyering 2005-12-19 18:16:07 +00:00
  • e0029290b8 . Jim Meyering 2005-12-19 18:13:00 +00:00
  • 89276658f2 . Jim Meyering 2005-12-19 18:12:30 +00:00
  • 457167610f . Jim Meyering 2005-12-19 18:05:55 +00:00
  • 1e4cd701dc Require gl_CHMOD_SAFER. Jim Meyering 2005-12-19 18:05:11 +00:00
  • 5df3b1a078 *** empty log message *** Jim Meyering 2005-12-17 13:46:34 +00:00
  • 46f3108c99 (is_empty_dir): Open with O_NDELAY, so we don't hang, e.g., on a named pipe. (OPEN_NO_FOLLOW_SYMLINK): Remove definition. Use O_NOFOLLOW in place of all uses, since it is guaranteed (system.h) to be defined. Jim Meyering 2005-12-17 13:46:27 +00:00
  • eb931cda05 *** empty log message *** Jim Meyering 2005-12-17 10:56:25 +00:00
  • 88d381bada Add lib/acl.c. Jim Meyering 2005-12-17 10:56:22 +00:00
  • 26f5a6e03e *** empty log message *** Jim Meyering 2005-12-17 10:50:04 +00:00
  • 88c3a9be50 (stat invocation) [--printf]: Describe new option. [--format]: Add example. Distinguish from --printf. Sort option descriptions. Jim Meyering 2005-12-17 10:50:00 +00:00
  • c99e1d2cb6 . Jim Meyering 2005-12-17 10:48:30 +00:00
  • c4a1355047 *** empty log message *** Jim Meyering 2005-12-17 10:48:12 +00:00
  • 2862dc7af9 *** empty log message *** Jim Meyering 2005-12-17 10:47:37 +00:00
  • 01a5f3830f (ls): Clarify the Alternate Access Method description. (cp): Clarify that --preserve=mode also preserves acls. Jim Meyering 2005-12-17 10:46:57 +00:00
  • 7b08fdb1eb (cp_option_init): Don't set umask_kill member. Jim Meyering 2005-12-17 10:46:23 +00:00
  • eee9e3d072 (cp_option_init): Don't set umask_kill member. Jim Meyering 2005-12-17 10:45:54 +00:00
  • 406a9d3636 (cp_option_init) [umask_kill]: Remove member. Jim Meyering 2005-12-17 10:43:12 +00:00
  • fdffb6bb48 (umask_kill): With default acls, the umask is not to be applied. Remove umask_kill, don't change the process umask, and let the kernel apply the umask where appropriate. (make_dir_parents_private): Fix logic for POSIX ACLs. Jim Meyering 2005-12-17 10:40:10 +00:00
  • 4fb20524d7 (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD, mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange to link with it via $(LIB_ACL), for the utilities that need it. Jim Meyering 2005-12-17 10:37:47 +00:00
  • f634e88445 (get_dest_mode): Remove; it is obsolete after removing umask_kill. (copy_reg, copy_internal): Use copy_acl and set_acl instead of fchown/chown. Fix the logic for POSIX ACLs. (chown_succeded): Remove; we now always copy acls and preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we did a chown before or not. Jim Meyering 2005-12-17 10:33:33 +00:00
  • e6ece7ba6c Switch back from HAVE_ACL to USE_ACL: The acl() syscall is no requirement for ACL support; particularly, it does not exist on systems that have POSIX ACLs. Jim Meyering 2005-12-17 10:33:08 +00:00
  • 3c0d9bc513 *** empty log message *** Jim Meyering 2005-12-17 10:31:37 +00:00
  • 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. Jim Meyering 2005-12-17 10:31:33 +00:00
  • 9566c9c9d3 (copy_acl, set_acl): Add declarations. Jim Meyering 2005-12-17 10:31:15 +00:00
  • 2eb8cbd948 *** empty log message *** Jim Meyering 2005-12-17 10:30:13 +00:00
  • f69fb2f533 (AC_FUNC_ACL): Add POSIX ACL and Linux-specific acl tests. Jim Meyering 2005-12-17 10:30:09 +00:00
  • 1833362111 remove/openat cleanup Paul Eggert 2005-12-17 06:56:19 +00:00
  • 25c49ccc1c (OPENAT_CWD_RESTORE__REQUIRE): Remove. (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise. (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its value is now signified by whether cwd_errno is null. (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from pointer-to-bool to pointer-to-errno-value. All callers changed. (rm_1): Don't bother setting a local cwd failure flag and then ORing it into the caller's. Just set the caller's. (rm): Use cwd failure errno value to print a slightly-better diagnostic. Paul Eggert 2005-12-17 06:55:54 +00:00
  • 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. Paul Eggert 2005-12-17 06:55:32 +00:00
  • 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. Paul Eggert 2005-12-17 06:55:01 +00:00
  • 0ae5a45fcb *** empty log message *** Jim Meyering 2005-12-15 20:16:03 +00:00
  • ce79c562f6 (print_it): Properly handle a backslash at the end of a --printf format string. Reported by Paul Eggert. Jim Meyering 2005-12-15 20:15:20 +00:00
  • 41e95465a6 (print_it): Properly handle a backslash at the end of a --printf format string. Reported by Paul Eggert. Jim Meyering 2005-12-15 20:15:05 +00:00
  • c1c8e668de Fix typo in previous change Paul Eggert 2005-12-15 19:01:00 +00:00
  • a025357bd6 tests/acl porting fixes Paul Eggert 2005-12-15 18:58:47 +00:00
  • b7c426c0ab Port to pre-POSIX shells like Solaris 8 /bin/sh. Don't assume /etc/passwd contains user names; use 'id' instead. Paul Eggert 2005-12-15 18:58:20 +00:00
  • 6dcd2807d7 Regenerate. Paul Eggert 2005-12-15 18:24:35 +00:00
  • a37438984f Add Kinyarwanda (rw). Add Croatian (hr). Jim Meyering 2005-12-15 14:49:00 +00:00
  • fee8c3985a . Jim Meyering 2005-12-15 14:48:48 +00:00
  • 049a807bc6 . Jim Meyering 2005-12-15 14:47:36 +00:00
  • 6e7efd30f0 *** empty log message *** Jim Meyering 2005-12-15 12:25:04 +00:00