Age | Commit message (Collapse) | Author |
|
Run this command:
git ls-files | grep '\.[ch]$' \
| xargs perl -pi -e 's/for \(;;\)/while (true)/g'
...except for randint.c, which does not include stdbool.h.
In that case, use "while (1)".
* gl/lib/randint.c (randint_genmax): Use "while (1)" for infloops.
* src/cat.c (simple_cat, cat): Use "while (true)" for infloops.
* gl/lib/randread.c (readsource, readisaac): Likewise.
* src/copy.c (copy_reg): Likewise.
* src/csplit.c (record_line_starts, process_regexp): Likewise.
* src/cut.c (set_fields): Likewise.
* src/dd.c (iread, parse_symbols): Likewise.
* src/df.c (find_mount_point, main): Likewise.
* src/du.c (main): Likewise.
* src/expand.c (expand): Likewise.
* src/factor.c (factor_using_division, do_stdin): Likewise.
* src/fmt.c (get_space): Likewise.
* src/ls.c (decode_switches): Likewise.
* src/od.c (main): Likewise.
* src/pr.c (main, read_line): Likewise.
* src/shred.c (dopass, genpattern): Likewise.
* src/sort.c (initbuf, fillbuf, getmonth, keycompare): Likewise.
* src/split.c (bytes_split, lines_split): Likewise.
* src/tac.c (tac_seekable): Likewise.
* src/test.c (and, or): Likewise.
* src/tr.c (squeeze_filter, main): Likewise.
* src/tsort.c (search_item): Likewise.
* src/unexpand.c (unexpand): Likewise.
* src/uniq.c (main): Likewise.
* src/yes.c (main): Likewise.
|
|
* gl/lib/mbsalign.c (mbsalign): Ensure the temporary destination buffer
is big enough, as it may need to be bigger than the source buffer
in the presence of single byte non printable chars.
* gl/tests/test-mbsalign.c (main): Add a test to trigger the issue.
|
|
* gl/lib/mbsalign.c (mbsalign): Support the MBA_UNIBYTE_FALLBACK
flag which reverts to unibyte mode if one can't allocate memory
or if there are invalid multibyte characters present.
Note memory is no longer dynamically allocated in unibyte mode so
one can assume that mbsalign() will not return an error if this
flag is present. Don't calculate twice, the number of spaces,
when centering. Suppress a signed/unsigned comparison warning.
(ambsalign): A new wrapper function to dynamically allocate
the minimum memory required to hold the aligned string.
* gl/lib/mbsalign.h: Add the MBA_UNIBYTE_FALLBACK flag and
also document others that may be implemented in future.
(ambsalign): A prototype for the new wrapper.
* gl/tests/test-mbsalign.c (main): New test program.
* gl/modules/mbsalign-tests: A new index to reference the tests.
* .x-sc_program_name: Exclude test-mbsalign.c from this check.
|
|
* gl/lib/regcomp.c.diff: Update to apply to changed version in gnulib.
* gnulib: Update submodule to latest.
|
|
Use this command:
git ls-files | grep -v COPYING \
| xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \
build-aux/update-copyright
|
|
* gl/lib/tempname.c.diff: Adjust patch to apply to gnulib, now that
most TABs in indentation have been converted to spaces by running
this command: f=tempname.c.diff; patch-xform $f > k && mv k $f
|
|
* gl/lib/xfreopen.c: Remove file.
* gl/lib/xfreopen.h: Likewise.
* gl/modules/xfreopen: Likewise.
|
|
* gl/lib/printf-args.c.diff: Remove file. No longer needed.
* gl/lib/vasnprintf.c.diff: Likewise.
|
|
A replacement getgroups is now guaranteed to exist, but it may
fail with ENOSYS. mgetgroups is moved to gnulib, and now takes
gid_t instead of GETGROUPS_T (but setgroups still needs GETGROUPS_T).
* gnulib: Update to latest.
* gl/modules/mgetgroups: Delete, moved to gnulib.
* gl/m4/mgetgroups.m4: Likewise.
* gl/lib/mgetgroups.h: Likewise.
* gl/lib/mgetgroups.c: Likewise.
* src/group-list.c (print_group_list): Adjust callers.
* src/id.c (print_full_info): Likewise.
|
|
cat, head, ptx, shuf, tac, tail, tee, tr, and uniq used freopen
on stdout, and were potentially vulnerable. dircolors, du, and
tsort only used it on stdin, which is unaffected by freopen_safer,
but this covers all uses for consistency.
* cfg.mk (sc_require_stdio_safer): New rule.
* gl/modules/xfreopen (Depends-on): Add freopen-safer.
* gl/lib/xfreopen.c (includes): Use stdio--.h.
* src/ptx.c (includes): Likewise.
* src/shuf.c (includes): Likewise.
* src/uniq.c (includes): Likewise.
* src/dircolors.c (includes): Likewise.
* src/du.c (includes): Likewise.
* src/tsort.c (includes): Likewise.
|
|
In glibc 2.11 and gnulib, gen_tempname added a parameter
suffixlen (unfortunately, it is typed as int rather than
size_t, for historical compatibility to a poor choice by BSD).
* gnulib: Import latest changes.
* gl/lib/tempname.h.diff: Accommodate new suffixlen parameter.
* gl/lib/tempname.c.diff (check_x_suffix): Allow for X in suffix
beyond x_suffix_len.
(gen_tempname_len): Add suffixlen parameter.
(__gen_tempname): Update caller.
* src/mktemp.c (mkstemp_len, mkdtemp_len): Update callers.
|
|
Diffs are more robust than wholesale replacement, because bootstrap
will inform us of any incompatible changes made in upstream gnulib.
* gl/lib/tempname.h: Change...
* gl/lib/tempname.h.diff: ...to diff.
* gl/lib/tempname.c: Change...
* gl/lib/tempname.c.diff: ...to diff.
|
|
* gl/lib/mbsalign.c (mbsalign): Mark unused parameter.
* bootstrap.conf (gnulib_modules): Remove obsolete
rename-dest-slash.
* gnulib-tests/Makefile.am (AM_CFLAGS): Reduce set of warnings for
gnulib tests.
* gl/modules/rename-tests.diff (Makefile.am): New file, to add
LIBINTL to LDADD, since we avoid canonicalize-lgpl module.
* gl/lib/regcomp.c.diff (regerror, calc_next)
(build_collating_symbol, parse_bracket_element, build_equiv_class)
(free_tree): Mark unused parameters.
* gl/lib/regex_internal.h.diff (re_string_elem_size_at): New file,
to mark unused parameters.
* gl/lib/printf-args.c.diff (PRINTF_FETCHARGS): New file, to avoid
type mismatch.
* gl/lib/vasnprintf.c (VASNPRINTF): New file, to avoid shadowing
local variable name.
* .gitignore: Ignore temporary build artifacts.
|
|
* gl/lib/regexec.c.diff: Fix a typo.
|
|
* configure.ac (GNULIB_WARN_CFLAGS): Define.
* lib/Makefile.am (AM_CFLAGS): Use $(GNULIB_WARN_CFLAGS)
rather than $(WARN_CFLAGS) and add $(WERROR_CFLAGS).
* gl/lib/regcomp.c.diff: New file.
* gl/lib/regex_internal.c.diff: New file.
* gl/lib/regexec.c.diff: New file.
|
|
* 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.
|
|
* gl/lib/mbsalign.c (mbsalign): Remove assignment, the result of which
is never used.
|
|
* src/getlimits.c: Likewise.
* src/group-list.c: Likewise.
* src/groups.c: Likewise.
* src/mktemp.c: Likewise.
* src/setuidgid.c: Likewise.
* src/stdbuf.c: Likewise.
* src/timeout.c: Likewise.
* src/truncate.c: Likewise.
* gl/lib/mbsalign.c: Likewise.
* tests/test-lib.sh: Likewise.
* bootstrap: Likewise.
* README-hacking: Likewise.
|
|
Transformed via this shell code:
t=$'\t'
git ls-files \
| grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \
| grep -vE 'tests/pr/|help2man' \
| xargs grep -lE "^ *$t" \
| xargs perl -MText::Tabs -ni -le \
'$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
|
|
* gl/lib/selinux-at.c: Remove file.
* gl/lib/selinux-at.h: Likewise.
* gl/modules/selinux-at: Likewise.
* gnulib: update to latest, to get the new module.
|
|
* gl/lib/argv-iter.c: Remove file.
* gl/lib/argv-iter.h: Remove file.
* gl/modules/argv-iter: Remove file.
* gl/modules/argv-iter-tests: Remove file.
* gl/tests/test-argv-iter.c: Remove file.
* gnulib: Update submodule, to get argv-iter
|
|
|
|
Steven Parkes reported that `id -G $USER` went into an infinite loop
on Darwin systems for users in more than 10 groups:
http://bugs.gentoo.org/show_bug.cgi?id=264007
* gl/lib/mgetgroups.c (mgetgroups): Work around buggy getgrouplist
implementations that don't update the required size correctly,
by doubling the result buffer and retrying. Also return the
parameter updated by getgrouplist rather than its return value,
as the documentation doesn't actually state the number of groups
stored is returned by getgrouplist.
* tests/misc/id-groups: Add test to exercise this logic
* tests/Makefile.am: Reference new test
* NEWS: Mention the fix
* THANKS: Update
|
|
* gl/lib/randint.c: Remove unused MAX macro
* gl/lib/randread.c (randread_error): Add __attribute__((__noreturn__))
|
|
Suggestion from Steven Schveighoffer at:
http://savannah.gnu.org/patch/?6797
to greatly speed up the random passes done by shred.
* gl/lib/randread.c: Default to using the internal
pseudorandom generator, rather than reading /dev/urandom
* src/shred.c (usage): remove mention of /dev/urandom
* src/shuf.c (usage); ditto
* src/sort.c (usage): ditto
* doc/coreutils.text: Document the new behaviour
for aquiring random data.
|
|
Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR
locale has recently changed to use the official but variable width
abbreviated month names. Other glibc locales also have variable widths.
http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html
http://sourceware.org/bugzilla/show_bug.cgi?id=9859
* NEWS: Mention the fix
* gl/lib/mbsalign.c: A new module to align and truncate a
string in a specified number of screen cells, while handling
multi-byte characters appropriately.
* gl/lib/mbsalign.h: Ditto
* gl/modules/mbsalign: Ditto
* bootstrap.conf: Reference the new module
* src/ls.c (abmon_init): New function, precompute the abbreviated
months aligned left in a minimum width column <= 5 screen cells.
(align_nstrftime): New function, replace the first %b in the
format specification to strftime with the precomputed month string.
Note using the cached month strings speeds up `ls -lU` by around 17%
on glibc-2.7-2 on linux at least. Also if we implement this function
using heap storage rather than automatic storage, and use snprintf
instead of strcpy, ls will slow down by 2% and 1% respectively
(i.e. a net gain of 14% rather than 17%).
* tests/ls/abmon-align: A new test to test ls alignment for
various formats and locales
* tests/Makefile.am: Reference the new test
|
|
* gl/lib/randread.c (__attribute__): Remove unused definition.
(ATTRIBUTE_UNUSED): Likewise.
* gl/lib/selinux-at.c (_): Remove unused definition.
Don't include <gettext.h>. No longer needed.
|
|
* gl/lib/argv-iter.h (_ATTRIBUTE_NONNULL_): Don't assume C99 variadic
macros are portable yet; needed for at least IRIX/MIPSpro.
* THANKS: Update.
Reported by Stuart Shelton.
|
|
* gl/lib/mgetgroups.c: Avoid -Wsign-compare warning by using unsigned
types for the parameters of the new function realloc_groupbuf().
mgetgroups() was refactored to use this function rather than
explicitly allocating and copying from automatic storage itself.
* src/group-list.c: Use int rather than size_t as variable is
used in signed comparisons.
* src/id.c: ditto.
|
|
* gl/lib/argv-iter.h: New file.
* gl/lib/argv-iter.c: New file.
* gl/modules/argv-iter: New file.
With a suggestion for improved memory management by Pádraig Brady.
|
|
* gl/lib/xfreopen.c: New file.
* gl/lib/xfreopen.h: New file.
* gl/modules/xfreopen: New file.
|
|
* gl/lib/se-context.in.h: Remove file.
* gl/lib/se-selinux.in.h: Likewise.
* gl/m4/selinux-context-h.m4: Likewise.
* gl/m4/selinux-selinux-h.m4: Likewise.
* gl/modules/selinux-h: Likewise.
|
|
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Remove definition.
It is already defined there. Reported by Eric Blake.
|
|
* m4/jm-macros.m4: Check for matchpathcon_init_prefix.
* src/install.c [!HAVE_MATCHPATHCON_INIT_PREFIX]
(matchpathcon_init_prefix): Define away.
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.
Reported by Ilya N. Golubev in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13686>.
|
|
* gl/lib/base64.c: Remove file.
* gl/lib/base64.h: Remove file.
|
|
* bootstrap.conf (gnulib_modules) [sha256, sha512]: Add "crypto/"
prefix to module name, now that they come from gnulib.
* gl/lib/sha256.c: Remove file.
* gl/lib/sha256.h: Likewise.
* gl/lib/sha512.c: Likewise.
* gl/lib/sha512.h: Likewise.
* gl/lib/u64.h: Likewise.
* gl/m4/sha256.m4: Likewise.
* gl/m4/sha512.m4: Likewise.
* gl/modules/sha256: Likewise.
* gl/modules/sha512: Likewise.
|
|
* gl/lib/base64.c (base64_decode_ctx): If no context structure was passed in,
treat newlines as garbage (this is the historical behavior). Formerly
base64_decode.
(base64_decode_alloc_ctx): Formerly base64_decode_alloc.
* gl/lib/base64.h (base64_decode): Macro for four-argument calls.
(base64_decode_alloc): Likewise.
* src/base64.c (do_decode): Call base64_decode_ctx instead of base64_decode.
Signed-off-by: Bo Borgerson <gigabo@gmail.com>
|
|
* gl/lib/sha512.c (sha512_process_bytes): s/63/127/.
|
|
* gl/lib/sha256.h (SHA224_DIGEST_SIZE, SHA256_DIGEST_SIZE): Define.
* gl/lib/sha512.h (SHA384_DIGEST_SIZE, SHA512_DIGEST_SIZE): Define.
|
|
* bootstrap.conf (gnulib_modules): Add sha256 and sha512.
* m4/prereq.m4: Don't require gl_SHA256 or gl_SHA512.
* gl/modules/sha512: New file.
* gl/modules/sha256: New file.
* m4/sha256.m4: Move to ...
* gl/m4/sha256.m4: ...here, removing use of AC_SOURCES.
* m4/sha512.m4: Move to ...
* gl/m4/sha512.m4: ...here, removing use of AC_SOURCES.
* lib/sha256.c, lib/sha256.h: Move to ...
* gl/lib/sha256.c, gl/lib/sha256.h: ...here.
* lib/sha512.c, lib/sha512.h: Move to ...
* gl/lib/sha512.c, gl/lib/sha512.h: ...here.
* lib/u64.h: Move to ...
* gl/lib/u64.h: ...here.
|
|
|
|
|
|
* gl/lib/mgetgroups.c (mgetgroups) [N_GROUPS_INIT]: Rename enum.
Use a larger value.
Update *groups only upon success.
Iterate upon failed getgrouplist.
|
|
* gl/m4/mgetgroups.m4: Check for getgrouplist.
* gl/lib/mgetgroups.c (mgetgroups): Use getgrouplist, if available.
* TODO: Remove the item about switching to getgrouplist.
* NEWS: mention this
|
|
* src/system.h (__attribute__): Remove the __STRICT_ANSI__ disjunct.
It has been unnecessary since approximately gcc-2.6, and now, leaving
it would cause gcc -Werror -ansi to fail to compile csplit.c.
* gl/lib/randread.c (__attribute__): Likewise.
|
|
* src/install.c (setdefaultfilecon): Call matchpathcon_init_prefix,
to mitigate what would otherwise be a large performance hit due to
the use of matchpathcon.
Dan Walsh suggested the use of matchpathcon_init_prefix.
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.
Signed-off-by: Jim Meyering <meyering@redhat.com>
|
|
* gl/lib/se-context.in.h (ENOTSUP): Define if missing.
* gl/lib/se-selinux.in.h: Likewise.
|
|
* gl/lib/tempname.h: Update copyright from gnulib.
* gl/lib/tempname.c: Likewise.
* .x-sc_GPL_version: Don't make an exception for those two files.
|
|
* gl/modules/tempname (Depends-on): Add randint and stdbool.
* gl/lib/tempname.c: Include randint.h and stdbool.h.
(uint64_t): Remove definition. Not needed.
[_LIBC] (RANDOM_BITS): Remove this block, now that we have proper random bits.
(check_x_suffix): New function.
(gen_tempname_len): Rename from __gen_tempname.
Add a parameter, x_suffix_len, telling how many X's there must be at
the end of the template.
Use pseudo-random numbers all the way, rather than adding 7777
from one iteration to the next.
(__gen_tempname): New function, to call gen_tempname_len, requiring a
suffix length of 6.
* gl/lib/tempname.h: Add prototype for gen_tempname_len.
Signed-off-by: Jim Meyering <meyering@redhat.com>
|
|
First step: move these files to gl/lib:
* lib/rand-isaac.c, lib/rand-isaac.h
* lib/randint.c, lib/randint.h
* lib/randperm.c, lib/randperm.h
* lib/randread.c, lib/randread.h
Step 2: add modules/rand* and remove now-unneeded .m4 files.
* gl/modules/randint: New file.
* gl/modules/randperm: New file.
* gl/modules/randread: New file.
* m4/randint.m4: Remove file.
* m4/randperm.m4: Remove file.
* m4/randread.m4: Remove file.
Step 3: use the new modules
* bootstrap.conf (gnulib_modules): Add randint and randperm.
* m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require;
These have been removed.
(gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf.
|