summaryrefslogtreecommitdiff
path: root/gl
AgeCommit message (Collapse)Author
2009-01-16simplify mgetgroups() and avoid -Wsign-compare warningsPádraig Brady
* 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.
2009-01-01improve M4 quotingJim Meyering
* configure.ac: Add quotes. * gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise. * m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise. * m4/check-decl.m4 (gl_CHECK_DECLS): Likewise. * m4/gmp.m4 (cu_GMP): Likewise. * m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise. (gl_CHECK_ALL_TYPES): Likewise. * m4/lib-check.m4 (cu_LIB_CHECK): Likewise. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise. FYI, I first ran this command: git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \ -e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g' Then I updated serial numbers and copyright dates manually. Also, I manually added two pairs of quotes in boottime.m4.
2008-12-01argv-iter: add testsJim Meyering
* gl/modules/argv-iter-tests: New module. * gl/tests/test-argv-iter.c: New file.
2008-12-01argv-iter: new moduleJim Meyering
* 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.
2008-11-10xfreopen: new moduleJim Meyering
* gl/lib/xfreopen.c: New file. * gl/lib/xfreopen.h: New file. * gl/modules/xfreopen: New file.
2008-10-22clean up gl/modules/selinux-atJim Meyering
* gl/modules/selinux-at: Ensure that LIB_SELINUX is cleared, in case it's set in the environment. m4-quote the first two args to AC_SEARCH_LIBS. Don't violate autoconf's ac_ namespace: s/ac_save/gl_save/ Drop the useless double quotes around a simple assignment RHS.
2008-10-21move selinux-h module from gl/ to gnulibJim Meyering
* 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.
2008-10-21prepare to move selinux-h module to gnulibJim Meyering
* gl/modules/selinux-h (Makefile.am) [selinux/selinux.h, selinux/context.h]: Remove temporary file and target, in case they're read-only. Use $(MKDIR_P), not mkdir -p. (License): Relax to LGPLv2+. Remove vestigial comments.
2008-10-19accommodate gnulib header removalsJim Meyering
* src/copy.c: Don't include "euidaccess.h" or "lchmod.h". * src/cp.c: Don't include "lchmod.h". * src/ls.c: Don't include "dirfd.h". * src/mkdir.c: Don't include "lchmod.h". * src/pwd.c: Don't include "dirfd.h". * src/remove.c: Don't include "dirfd.h" or "euidaccess.h". * src/test.c: Don't include "euidaccess.h". * gl/modules/getloadavg.diff: Adjust diff for changed context. * src/uptime.c (uptime): Remove declaration.
2008-06-03remove duplicate definition of matchpathcon_init_prefixJim Meyering
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Remove definition. It is already defined there. Reported by Eric Blake.
2008-06-02accommodate older SELinux which lacks matchpathcon_init_prefixJim Meyering
* 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>.
2008-05-19use gnulib's base64 module, now that it's sync'd to match this oneJim Meyering
* gl/lib/base64.c: Remove file. * gl/lib/base64.h: Remove file.
2008-05-11move sha256 and sha512 modules to gnulibJim Meyering
* 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.
2008-05-05base64 module: adjust API so it's compatible with gnulib'sBo Borgerson
* 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>
2008-03-16sha512_process_bytes: fix a bug in processing a buffer where length&64 != 0J. Scott Edwards
* gl/lib/sha512.c (sha512_process_bytes): s/63/127/.
2008-03-03Define SHA*_DIGEST_SIZE symbols.Simon Josefsson
* gl/lib/sha256.h (SHA224_DIGEST_SIZE, SHA256_DIGEST_SIZE): Define. * gl/lib/sha512.h (SHA384_DIGEST_SIZE, SHA512_DIGEST_SIZE): Define.
2008-03-02Create sha256 and sha512 modules and move files into gl/.Jim Meyering
* 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.
2008-03-01Don't depend on gnulib's deprecated "free" module.Jim Meyering
* bootstrap.conf (obsolete_gnulib_modules): Remove free. * gl/modules/mgetgroups (Depends-on): Remove free.
2008-02-24* gl/lib/mgetgroups.c (mgetgroups): Parenthesize correctly.Jim Meyering
2008-02-24* gl/lib/mgetgroups.c: Include <stdlib.h>.Jim Meyering
2008-02-22id: avoid race when a group is added between getgrouplist callsJim Meyering
* gl/lib/mgetgroups.c (mgetgroups) [N_GROUPS_INIT]: Rename enum. Use a larger value. Update *groups only upon success. Iterate upon failed getgrouplist.
2008-02-21id: use getgrouplist when possibleJames Youngman
* 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
2008-01-17Do not define-away __attribute__ when __STRICT_ANSI__ is set.Jim Meyering
* 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.
2007-11-28* gl/modules/randread (Depends-on): Remove nonexistent rand-isaac.Paul Eggert
2007-11-10install+SELinux: reduce a 12x performance hit to ~1.5xJim Meyering
* 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>
2007-10-28Define ENOTSUP, not ENOSYS. Needed on OpenBSD 3.9.Jim Meyering
* gl/lib/se-context.in.h (ENOTSUP): Define if missing. * gl/lib/se-selinux.in.h: Likewise.
2007-10-07Reflect 2->3 GPL copyright version update in gnulib.Jim Meyering
* 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.
2007-10-07Make tempname more random, via the randint module.Jim Meyering
* 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>
2007-10-07Convert coreutils' rand*.{c,h,m4} into modules.Jim Meyering
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.
2007-10-07Copy from gnulib the parts of tempname that we'll modify.Jim Meyering
* gl/lib/tempname.c: Copy from gnulib. * gl/lib/tempname.h: Likewise. * gl/modules/tempname: Likewise. Allow GPLv2 on temporarily(?)-imported file from gnulib/libc. * .x-sc_GPL_version: New file. * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version
2007-10-04Adapt to new gnulib naming scheme.Jim Meyering
* gl/lib/se-context.in.h: Rename from gl/lib/se-context_.h. * gl/lib/se-selinux.in.h: Rename from gl/lib/se-selinux_.h. * gl/m4/selinux-context-h.m4: Remove use of AC_LIBSOURCES. * gl/m4/selinux-selinux-h.m4: Likewise. * gl/modules/selinux-h (Files, Makefile.am): Reflect renaming. (Makefile.am) [lib_SOURCES]: Add se-context.in.h and se-selinux.in.h.
2007-09-27Move file-set and hash-triple modules to gnulib.Jim Meyering
* bootstrap.conf (gnulib_modules): Remove file-set, now that it's in gnulib, and the canonicalize module requires it there. * gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove. * gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set: Remove.
2007-09-25Use XOR, not OR to combine bits.Jim Meyering
* gl/lib/hash-triple.c (triple_hash): Use XOR (^), not OR (|), to combine the bits from hashing the name and those of the inode number. Add a few comments and remove out-of-context ones.
2007-08-23Move functions from copy.c into new modules, since ln needs them, too.Jim Meyering
* bootstrap.conf (gnulib_modules): Add file-set. * gl/lib/file-set.c (record_file, seen_file): Functions from copy.c. * gl/lib/file-set.h: Add prototypes. * gl/lib/hash-triple.c (triple_hash, triple_hash_no_name): (triple_compare, triple_free): Functions from copy.c. * gl/lib/hash-triple.h (struct F_triple): Define. From copy.c. Add prototypes. * gl/modules/file-set: New module. * gl/modules/hash-triple: New module. * src/Makefile.am (copy_sources): New variable. (ginstall_SOURCES, cp_SOURCES, mv_SOURCES): Use it. * src/copy.c: Include hash-triple.h. No longer include hash-pjw.h. (copy_internal): Don't pass a NULL third argument to record_file, since that function no longer accepts that. (record_file): Move this function to file-set.c. Along the way, remove the code to allow a NULL stat-buffer pointer. Adjust sole caller. (seen_file): Move this function to file-set.c. (struct F_triple): Move declaration to hash-triple.h. (triple_compare, triple_free, triple_hash, triple_hash_no_name): Move these functions to hash-triple.c. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-07-07Fix typo in comment.Jim Meyering
2007-07-06setuidgid: set all groups, not just the primary one; mgetgroups: new moduleJim Meyering
I wanted to use the xgetgroups function from id.c, so factored it out and made it into a non-exiting function (hence the "m" prefix rather than "x"). * src/setuidgid.c (main): Use mgetgroups. Include "mgetgroups.h". * src/id.c (xgetgroups): Remove function. Include "mgetgroups.h". (print_group_list): Use mgetgroups, not xgetgroups. * gl/modules/mgetgroups: New module. * gl/lib/mgetgroups.c: New file. mgetgroups is derived from id.c's xgetgroups function. * bootstrap.conf (gnulib_modules): Add mgetgroups. * gl/m4/mgetgroups.m4: New file. * gl/lib/mgetgroups.h: New file.
2007-03-29* gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H.Jim Meyering
2007-03-29New program: chconJim Meyering
* gl/modules/selinux-at: New module. Check for libselinux and set LIB_SELINUX here, unconditionally, rather than depending on the configure-time --enable-selinux option. * gl/modules/selinux-h: New module. * bootstrap.conf (gnulib_modules): Add selinux-at. * gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files. * gl/lib/se-selinux_.h: New file. * gl/lib/se-context_.h: New file. * gl/m4/selinux-selinux-h.m4: New file. * gl/m4/selinux-context-h.m4: New file. * src/Makefile.am (bin_PROGRAMS): Add chcon. (chcon_LDADD): Define. * README: Add chcon to the list of programs. * src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
2007-03-21* gl/lib/savewd.c: Remove this file, since the savewd_save changeJim Meyering
is now in gnulib. The other wasn't useful.
2007-03-20* gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it.Jim Meyering
2007-03-16Begin adding support for Solaris ZFS (4 entries per trivial ACL)Jim Meyering
* gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro. (file_has_acl, copy_acl): Use it, rather than enumerating errno values. (is_trivial_acl): New function. Incomplete, for now. (file_has_acl, copy_acl): Use the new function, rather than counting the number of entries in an ACL.
2007-03-13Prepare to work on ACL-related failure when using Solaris ZFS.Jim Meyering
* gl/lib/acl.c: New file, copied from gnulib.
2007-03-10Try to fix today's NFS-related failure: Treat ESTALE like EACCES.Jim Meyering
* gl/lib/savewd.c: Copy this file from gnulib, then change "errno != EACCES" to (errno != EACCES && errno != ESTALE). The symptom was this failure in tests/install/basic-1: ginstall: cannot create directory `rel/a': Stale NFS file handle
2007-01-05Avoid a used-uninitialized bug for invalid input, i.e., when the sizeJim Meyering
of the input, not counting newlines, is 1 % 4. * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4. It may be smaller when flushing.
2007-01-04[ChangeLog]Jim Meyering
When decoding, always allow newlines in input, with almost no performance impact. * src/base64.c (do_decode): Initialize decode context. Call base64_decode one more time, after all input is processed. (usage): When decoding, newlines are always accepted. * tests/misc/base64: Add a bunch of tests, for the above. * gl/lib/base64.c: Include <string.h>. (base64_decode_ctx_init, get_4, decode_4): New functions. (base64_decode): Efficiently handle interspersed newlines. (base64_decode_alloc): Update signature. * gl/lib/base64.h (struct base64_decode_context): Define. (base64_decode_ctx_init): Add prototype. (base64_decode, base64_decode_alloc): Update prototypes. [doc/ChangeLog] * coreutils.texi (base64 invocation): When decoding, newlines are always accepted.
2007-01-04* gl/lib/base64.c: Copied from gnulib.Jim Meyering
* gl/lib/base64.h: Likewise.
2006-11-14* gl/m4/root-dev-ino.m4: Now that this is part of a real "module",Jim Meyering
remove the now-unnecessary use of AC_LIBSOURCES.
2006-11-14Adapt to new version of gnulib-tool.Jim Meyering
* gl/modules/root-dev-ino: New file. * lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ... * gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here. * m4/root-dev-ino.m4: Move this file ... * gl/m4/root-dev-ino.m4: ... to here. * bootstrap.conf (gnulib_modules): Add root-dev-ino.