summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2009-10-10copy: allow symlink timestamp preservation on more systemsEric Blake
* src/copy.c (utimens_symlink): Simplify by using lutimens. * m4/jm-macros.m4 (coreutils_MACROS): Drop utimensat; gnulib does this for us. * tests/cp/preserve-slink-time: Recognize lutimes support.
2009-10-10maint: touch up previous LDADD patchEric Blake
* src/Makefile.am (dir_LDADD): Delete; the ls_LDADD line covers this.
2009-10-10build: build uname(1) unconditionallyJim Meyering
Before, on a system without the uname function, the build system would detect that and not build/install a uname program. Now that gnulib guarantees a uname function, ... * configure.ac: Don't check for the uname function. * src/Makefile.am (build_if_possible__progs): Move uname... (EXTRA_PROGRAMS): ...to this list.
2009-10-10maint: list program names one per lineJim Meyering
* src/Makefile.am (EXTRA_PROGRAMS): List them one per line. (build_if_possible__progs): Likewise.
2009-10-10build: ls: fix link failure due to missing -laclJim Meyering
* src/Makefile.am (ls_LDADD): Re-add $(LIB_ACL). Inadvertently-removed by commit 78c93601.
2009-10-09maint: touch up previous LDADD patchEric Blake
* src/Makefile.am (stdbuf_LDADD): Add missing primer. (hostname_LDADD, uname_LDADD): Add GETHOSTNAME_LIB. * bootstrap.conf (gnulib_modules): Add uname.
2009-10-09maint: improve additional library trackingEric Blake
* src/Makefile.am (LDADD): Refactor, to make per-library additions to individual programs easier to maintain.
2009-10-09chcon: don't disable just because SELinux is disabledJim Meyering
* src/chcon.c (main): Now that gnulib provides getfilecon wrappers, we can revert most of the 2009-10-05 commit 3a97d664, "chcon: exit immediately if SELinux is disabled", since chcon is still useful as long as the file system provides handlers for the security.* name space. gnulib's getfilecon wrappers ensure that an offending context now evokes a return value of -1. Prompted by comments from Stephen Smalley in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18394 * NEWS (Bug fixes): Mention it.
2009-10-09ls: remove explicit getfilecon work-aroundJim Meyering
* src/ls.c (gobble_file): Remove l?getfilecon work-around, now that the gnulib wrappers handle it for us.
2009-10-08maint: use X2NREALLOC in more placesEric Blake
* src/chroot.c (set_additional_groups): Use X2NREALLOC rather than x2nrealloc. * src/factor.c (emit_factor): Likewise. * src/setuidgid.c (main): Likewise.
2009-10-08maint: remove unused macros and declarationsEric Blake
* src/system.h (EDQUOT, EISDIR, ENOSYS, EOVERFLOW, F_OK, X_OK) (W_OK, R_OK): Delete; macros provided by gnulib. (includes): Gnulib guarantees both <time.h> and <sys/time.h>, in either order. (free, malloc, memchr, realloc, getenv, lseek): Delete, gnulib guarantees these declarations. * m4/check-decl.m4 (gl_CHECK_DECLS): Delete checks now done by gnulib.
2009-10-08maint: move timeout exit statusesEric Blake
* src/timeout.c (EXIT_TIMEDOUT, EXIT_CANCELED): Remove as macros... * src/system.h (EXIT_TIMEDOUT, EXIT_CANCELED): ...and provide as enum values instead. * src/stdbuf.c (EXIT_CANCELED): Delete.
2009-10-08stdbuf: improve path searchEric Blake
* src/stdbuf.c (set_program_path): Use gnulib methods for better file name handling. * bootstrap.conf (gnulib_modules): Add xreadlink.
2009-10-08stat: work with recent gnulib changesEric Blake
* src/stat.c (do_stat): Don't mask function-like stat macro.
2009-10-08stat: add support for many more file system typesJim Meyering
* src/stat.c (human_fstype): Add the following FS types, from <linux/magic.h>: afs, anon-inode FS, btrfs, cgroupfs, cramfs-wend, debugfs, futexfs, inotifyfs, minux3, securityfs, selinux, xenfs. Also add "nilfs". * src/Makefile.am (fs-kernel-magic): New rule. * NEWS (Bug fixes): Mention this.
2009-10-08stat: recognize CIFS and HFS file system typesJim Meyering
* src/stat.c (human_fstype) [CIFS, HFS]: Add new file system types. Prompted by a report from Stuart Kemp. Normalize the form of a few hexadecimal magic numbers. Alphabetize on S_MAGIC_ case names. * src/Makefile.am (fs-magic-compare, fs-def, fs-magic): New rules, to automate comparison of our list with that in the Linux statfs man page. * NEWS (Bug fixes): Mention it.
2009-10-07md5sum, sha*sum: also accept openssl checksum syntaxGuenter Knauf
* src/md5sum.c (split_3): Accept openssl checksum syntax, which differs only by two spaces from that of the bsd checksum tools: openssl: MD5(f)= d41d8cd98f00b204e9800998ecf8427e bsd: MD5 (f) = d41d8cd98f00b204e9800998ecf8427e
2009-10-06chcon: exit immediately if SELinux is disabledOndřej Vašík
This change happens to avoid an abort in chcon when SELinux is disabled while operating on a file with an "unlabeled" context from back in 2006. However, that same abort can still be triggered by the same file when running chcon with SELinux enabled. This bug in chcon will be fixed in a subsequent commit via a getfilecon wrapper. See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18384 for how to correct your disk attributes to avoid triggering this bug. * src/chcon.c (main): Exit immediately if SELinux is disabled. Reported in http://bugzilla.redhat.com/527142 by Yanko Kaneti. * src/runcon.c (main): Do not hardcode program name in error message. * THANKS: Update.
2009-10-02dircolors: highlight .cgm and .emf as imagesJames R. Van Zandt
* src/dircolors.hin: Add .cgm, .emf. * THANKS: Update.
2009-10-02tail: avoid a race where we could miss new data with --pidPádraig Brady
* src/tail.c (tail_forever, tail_forever_inotify): Close a race in tail_forever_inotify where new data written after the file check by a now dead process, but before the pid check, is not output. We use the POSIX guarantee that read() and write() are serialized wrt each other even in separate processes, to assume full file consistency after exit() and so poll for new data _after_ the writer has exited. This also allows us to not redundantly _wait_ for new data if the process is dead. * tests/tail-2/pid: Remove the now partially invalid sub second sleep check as we now don't unconditionally wait, and replace it with a check for the redundant sleep. Also clarify some of the existing comments. * NEWS: Mention the fix.
2009-09-30ls: always print "?" for allocated size of a dereferenced dangling symlinkPádraig Brady
Previously for `ls -Ls` (but not `ls -Lsl`), we referenced the st_blocks returned from the previous failed stat() call. This undefined value was seen to be 0 for dangling symlinks at least. * src/ls.c (print_file_name_and_frills, length_of_file_name_and_frills): Don't use st_blocks if the previous stat() failed * tests/ls/dangle: Add a test case * NEWS: Mention the fix, and roll up related items into a single entry.
2009-09-29stat: interpret "-" as standard inputJim Meyering
* src/stat.c (do_stat): Interpret a command line argument of "-" to mean "standard input", like many other tools do. (do_statfs): Fail upon any attempt to use "-". * NEWS (Changes in behavior): Mention it. * tests/misc/stat-hyphen: New test, to exercise the above. * tests/Makefile.am (TESTS): Add misc/stat-hyphen.
2009-09-29ls: don't use an undefined struct stat after failed stat/lstatJim Meyering
* src/ls.c (format_inode): Access f->stat only if f->stat_ok is set. * NEWS (Bug fixes): Mention it. Improved-by: Pádraig Brady <P@draigBrady.com>
2009-09-29ls: print "?", not "0" as inode of dereferenced dangling symlinkJim Meyering
ls prints inode numbers two ways: for long (-l) listings, and for short ones, e.g., ls -li and ls -i. The code to print long listings properly printed "?" when the inode was unknown, but the code for handling short listings would print 0 instead. Factor out the formatting code into a new function so ls prints the right string ("?") from both places: * NEWS (Bug fixes): Mention it. * src/ls.c (format_inode): New function. (print_long_format): Use it here. (print_file_name_and_frills): Use it here, too. * tests/ls/dangle: Exercise this fix. Reported by Yang Ren in http://bugzilla.redhat.com/525400
2009-09-29ls: with -LR, exit with status 2 upon detecting a cycleJim Meyering
* src/ls.c (print_dir): Diagnosing the cycle is not enough. Also set exit status to 2. This is what Solaris' /bin/ls does, too. * tests/ls/infloop: Rework test: match both expected stdout and stderr. Require an exit status of 2 in this case. * doc/coreutils.texi (ls invocation): Mention that a loop provokes in an exit status of 2. * NEWS (Bug fixes): Mention it. Reported by Yang Ren in http://bugzilla.redhat.com/525402. * THANKS: Correct ordering of Yang Ren's names.
2009-09-25cp, mv: use linkat to guarantee semanticsEric Blake
* src/copy.c (copy_internal): Use linkat, not link.
2009-09-25ln: add -L/-P optionsEric Blake
* src/ln.c (STAT_LIKE_LINK): Delete. (logical): New flag. (long_options): Add -L, -P. (usage): Mention them. (main): Choose between them. (do_link): Perform correct action. * tests/ln/misc: Move hard-to-sym portion of test... * tests/ln/hard-to-sym: ...into new test, and add more. * tests/Makefile.am (TESTS): Run new test. * NEWS: Document this. * doc/coreutils.texi (link invocation, ln invocation): Likewise. * bootstrap.conf (gnulib_modules): Add linkat.
2009-09-23maint: Use logical rather than bitwise operators on boolsPádraig Brady
This is because bitwise operators are: - confusing and inconsistent in a boolean context - non short circuiting - brittle in C89 where bool can be an int (so > 1)
2009-09-23maint: expr: avoid compiler warnings without GMPPádraig Brady
* src/expr.c (mpz_clear, mpz_get_str, mpz_out_str) [!HAVE_GMP]: Reference unused arguments.
2009-09-23doc: ls: further improve --help message re --colorJim Meyering
* src/ls.c (usage): Correct grammar, change voice, shorten. Inspired by a report from Bruno Schulenberg.
2009-09-23maint: df.c: adapt to newer gnulibJim Meyering
* src/df.c: Don't include "canonicalize.h". No longer needed, since canonicalize_file_name is now guaranteed to be declared in <stdlib.h>, thanks to gnulib.
2009-09-22maint: uptime: fix a theoretical compile warningPádraig Brady
* src/uptime.c (print_uptime) [!HAVE_UTMPX_H && !HAVE_UTMP_H]: Reference possibly unused arguments.
2009-09-22ls: fix a performance regressionPádraig Brady
* src/ls.c (print_color_indicator): This reinstates commit f3f1ccfd, 21-10-2008, "ls: make it possible to disable file capabilities checking" which was inadvertently reverted with commit 3a169f4c, 14-09-2009, "ls: handle disabling of colors consistently ...".
2009-09-21build: avoid compiler warnings on cygwin 1.5Eric Blake
* src/copy.c (utimens_symlink): Avoid unused variables. * src/su.c (getusershell): Rely on gnulib for prototype.
2009-09-21doc: ls: add an article, "the"Jim Meyering
* src/ls.c (usage): Tweak wording.
2009-09-21ls: handle disabling of colors consistently for all tile typesPádraig Brady
* src/ls.c (print_color_indicator): Use consistent syntax for all file and directory subtypes, and fall back to the color of the base type if there is no enabled color for the subtype. This allows turning off specific colors for o+w dirs for example. * tests/ls/color-dtype-dir: Add a case to test that turning off coloring for o+w directories, falls back to standard dir color. * NEWS: Mention the fix Introduced by commit ac467814, 2005-09-05, "Colorize set-user-ID ... files and sticky ... directories."
2009-09-21doc: ls: make help for --color more concise and accuratePádraig Brady
* src/ls.c (usage): Shorten the --color ancillary info by two lines, while replacing --color=none with --color=never. Mention "always" is the default parameter of the --color option, along with the primary help for that option. Mention the ancillary --color info in the --color primary help.
2009-09-21doc: mention the texinfo documentation in --helpPádraig Brady
* src/system.h: Rename emit_bug_reporting_address() to emit_ancillary_info() and update it to not print the translation project address in en_* locales, and _do_ print it in the 'C' (and other) locales so that it's included in the default man page. Also mention how to invoke the texinfo documentation for each command. Also move the "hard-locale.h" include to the 8 files that now use it. * man/help2man: Strip the newly added texinfo reference from the --help output as a more verbose version is already added by help2man. Suggestion from C de-Avillez
2009-09-19dircolors: arrange to highlight names with the .lz suffixJim Meyering
* src/dircolors.hin: Add .lz, for GNU lzip. Suggested by Matias A. Fonzo.
2009-09-19mktemp: adapt to new, 3-argument gen_tempname_lenJim Meyering
* src/mktemp.c (mkstemp_len, mkdtemp_len): Update callers of gen_tempname_len. * gl/lib/tempname.c, gl/lib/tempname.h: Rebase against recently API-modified copy of tempname module in gnulib. Reported by Lluís Batlle.
2009-09-16rm, rmdir: improve cross-compilation supportEric Blake
* bootstrap.conf (gnulib_modules): Drop rmdir-errno. * src/rmdir.c (errno_rmdir_non_empty): Check both cases allowed by POSIX, rather than relying on configure-time check that might fail during cross-compilation. Reverts commit 9b6eb98d41.
2009-09-15cp: fix a probably redundant chmod when setting xattrsOndřej Vašík
* src/copy.c (copy_reg): Fix initial value of access_changed variable. This was introduced by Pádraig Brady in commit cca83faf, 2009-09-14, "cp,mv: preserve extended attributes even for read-only files"
2009-09-14cp,mv: preserve extended attributes even for read-only filesOndřej Vašík
* src/copy.c (copy_reg): Temporarily set u+rw on the destination file to allow GNU/Linux to set xattrs. * tests/misc/xattr: Test that change. * NEWS (Bug fixes): Mention it. Reported by Ernest N. Mamikonyan.
2009-09-14doc: improve timeout's --help messageJim Meyering
* src/timeout.c (usage): Improve --help description.
2009-09-13maint: use consistent cpp indentation in all .c filesJim Meyering
* src/stty.c: Make cpp indentation reflect nesting. * src/factor.c: Likewise.
2009-09-11id: don't print context=... when POSIXLY_CORRECT is setJim Meyering
* src/id.c (print_full_info) [POSIXLY_CORRECT]: Don't print context. Reported by Ulrich Drepper. * NEWS (Changes in behavior): Mention it. * doc/coreutils.texi (id invocation): Document that id also prints the security context, when possible, and when POSIXLY_CORRECT is not set. * tests/id/no-context: New file. Test for this. * tests/Makefile.am (TESTS): Add it.
2009-09-11rm: avoid compiler warningEric Blake
* src/remove.c (rm_fts): Don't allow fall-through when assertions are disabled.
2009-09-11rm: use gnulib faccessatEric Blake
* bootstrap.conf (gnulib_modules): Add faccessat. Replace strdup with strdup-posix. * m4/jm-macros.m4 (coreutils_MACROS): Revert previous change, now that gnulib does it for us. * src/remove.c (write_protected_non_symlink): Use faccessat in more situations.
2009-09-11rm: improve efficiency of rm -r (without -f) from O(N^2) to O(N)Jim Meyering
where N is the depth of the deepest hierarchy rm is processing. * src/remove.c (write_protected_non_symlink): Use faccessat to avoid O(N)-per-entry cost of calling euidaccess. * m4/jm-macros.m4 (coreutils_MACROS): Check for faccessat. * NEWS (Improvements): Mention it.
2009-09-11build: placate gcc's new -Wskip-jump-initJim Meyering
* remove.c (rm_fts): Put braces around each of the two offending blocks. * configure.ac: Don't turn off -Wjump-misses-init. With the rewrite of remove.c, it is no longer needed.