Skip to content

Commit

Permalink
Update from Gnulib
Browse files Browse the repository at this point in the history
This incorporates:
2018-10-05 explicit_bzero: make it possible to namespace
2018-10-04 fcntl: make it possible to namespace
2018-10-01 mkostemp, mkostemps: fix C++ compilation on Mac OS X
2018-09-19 maint: mktime.c now shared with glibc
2018-09-18 file-has-acl: fix test failure on Cygwin 2.9
2018-09-18 gettime: nanotime never existed
* admin/merge-gnulib (AVOIDED_MODULES): Add mkdir.
* doc/misc/texinfo.tex, lib/acl-internal.c, lib/acl-internal.h:
* lib/acl_entries.c, lib/explicit_bzero.c, lib/fcntl.c:
* lib/get-permissions.c, lib/gettime.c, lib/mktime.c:
* lib/set-permissions.c, lib/stdlib.in.h, m4/acl.m4, m4/gettime.m4:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
  • Loading branch information
eggert committed Oct 9, 2018
1 parent fc6004e commit cf1ebfa
Show file tree
Hide file tree
Showing 15 changed files with 250 additions and 216 deletions.
2 changes: 1 addition & 1 deletion admin/merge-gnulib
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ GNULIB_MODULES='

AVOIDED_MODULES='
btowc close dup fchdir fstat langinfo lock
malloc-posix mbrtowc mbsinit msvc-inval msvc-nothrow nl_langinfo
malloc-posix mbrtowc mbsinit mkdir msvc-inval msvc-nothrow nl_langinfo
openat-die opendir raise
save-cwd select setenv sigprocmask stat stdarg stdbool
threadlib tzset unsetenv utime utime-h
Expand Down
3 changes: 2 additions & 1 deletion doc/misc/texinfo.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2018-06-02.09}
\def\texinfoversion{2018-09-21.20}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
Expand Down Expand Up @@ -8004,6 +8004,7 @@
\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
\gdef\magicamp{\let&=\amprm}
}
\let\ampchar\&
\newcount\parencount
Expand Down
12 changes: 6 additions & 6 deletions lib/acl-internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "acl-internal.h"

#if USE_ACL && HAVE_ACL_GET_FILE
#if USE_ACL && HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */

# if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */

Expand All @@ -37,7 +37,7 @@ acl_extended_nontrivial (acl_t acl)
return (acl_entries (acl) > 0);
}

# else /* Linux, FreeBSD, IRIX, Tru64 */
# else /* Linux, FreeBSD, IRIX, Tru64, Cygwin >= 2.5 */

/* ACL is an ACL, from a file, stored as type ACL_TYPE_ACCESS.
Return 1 if the given ACL is non-trivial.
Expand All @@ -51,7 +51,7 @@ acl_access_nontrivial (acl_t acl)
at least, allowing us to write
return (3 < acl_entries (acl));
but the following code is more robust. */
# if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD */
# if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Cygwin >= 2.5 */

acl_entry_t ace;
int got_one;
Expand Down Expand Up @@ -124,7 +124,7 @@ acl_default_nontrivial (acl_t acl)

# endif

#elif USE_ACL && HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */
#elif USE_ACL && HAVE_FACL && defined GETACL /* Solaris, Cygwin < 2.5, not HP-UX */

/* Test an ACL retrieved with GETACL.
Return 1 if the given ACL, consisting of COUNT entries, is non-trivial.
Expand Down Expand Up @@ -479,15 +479,15 @@ void
free_permission_context (struct permission_context *ctx)
{
#if USE_ACL
# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */
# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */
if (ctx->acl)
acl_free (ctx->acl);
# if !HAVE_ACL_TYPE_EXTENDED
if (ctx->default_acl)
acl_free (ctx->default_acl);
# endif

# elif defined GETACL /* Solaris, Cygwin */
# elif defined GETACL /* Solaris, Cygwin < 2.5 */
free (ctx->entries);
# ifdef ACE_GETACL
free (ctx->ace_entries);
Expand Down
16 changes: 10 additions & 6 deletions lib/acl-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
# define GETACLCNT ACL_CNT
#endif

/* On Linux, additional ACL related API is available in <acl/libacl.h>. */
/* On Linux and Cygwin >= 2.5, additional ACL related API is available in
<acl/libacl.h>. */
#ifdef HAVE_ACL_LIBACL_H
# include <acl/libacl.h>
#endif
Expand Down Expand Up @@ -72,7 +73,7 @@ _GL_INLINE_HEADER_BEGIN

# if HAVE_ACL_GET_FILE
/* POSIX 1003.1e (draft 17 -- abandoned) specific version. */
/* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */
/* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */

# ifndef MIN_ACL_ENTRIES
# define MIN_ACL_ENTRIES 4
Expand Down Expand Up @@ -122,7 +123,10 @@ rpl_acl_set_fd (int fd, acl_t acl)
# endif

/* Linux-specific */
# ifndef HAVE_ACL_EXTENDED_FILE
/* Cygwin >= 2.5 implements this function, but it returns 1 for all
directories, thus is unusable. */
# if !defined HAVE_ACL_EXTENDED_FILE || defined __CYGWIN__
# undef HAVE_ACL_EXTENDED_FILE
# define HAVE_ACL_EXTENDED_FILE false
# define acl_extended_file(name) (-1)
# endif
Expand Down Expand Up @@ -163,7 +167,7 @@ extern int acl_access_nontrivial (acl_t);
extern int acl_default_nontrivial (acl_t);
# endif

# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */
# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin < 2.5, not HP-UX */

/* Set to 0 if a file's mode is stored independently from the ACL. */
# if defined __CYGWIN__ /* Cygwin */
Expand Down Expand Up @@ -256,14 +260,14 @@ extern int acl_nontrivial (int count, struct acl *entries);
struct permission_context {
mode_t mode;
#if USE_ACL
# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */
# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */
acl_t acl;
# if !HAVE_ACL_TYPE_EXTENDED
acl_t default_acl;
# endif
bool acls_not_supported;

# elif defined GETACL /* Solaris, Cygwin */
# elif defined GETACL /* Solaris, Cygwin < 2.5 */
int count;
aclent_t *entries;
# ifdef ACE_GETACL
Expand Down
6 changes: 3 additions & 3 deletions lib/acl_entries.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "acl-internal.h"

/* This file assumes POSIX-draft like ACLs
(Linux, FreeBSD, Mac OS X, IRIX, Tru64). */
(Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5). */

/* Return the number of entries in ACL.
Return -1 and set errno upon failure to determine it. */
Expand All @@ -34,7 +34,7 @@ acl_entries (acl_t acl)

if (acl != NULL)
{
#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Mac OS X */
#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Mac OS X, Cygwin >= 2.5 */
# if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */
/* acl_get_entry returns 0 when it successfully fetches an entry,
and -1/EINVAL at the end. */
Expand All @@ -45,7 +45,7 @@ acl_entries (acl_t acl)
got_one >= 0;
got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace))
count++;
# else /* Linux, FreeBSD */
# else /* Linux, FreeBSD, Cygwin >= 2.5 */
/* acl_get_entry returns 1 when it successfully fetches an entry,
and 0 at the end. */
acl_entry_t ace;
Expand Down
4 changes: 3 additions & 1 deletion lib/explicit_bzero.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@

#include <string.h>

#if _LIBC
/* glibc-internal users use __explicit_bzero_chk, and explicit_bzero
redirects to that. */
#undef explicit_bzero
# undef explicit_bzero
#endif

/* Set LEN bytes of S to 0. The compiler will not delete a call to
this function, even if S is dead after the call. */
Expand Down
Loading

0 comments on commit cf1ebfa

Please sign in to comment.