diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-12-23 15:18:29 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-12-23 15:24:55 -0800 |
commit | 35bd46f0c816948dc1a0430c8ba8b10a01167320 (patch) | |
tree | fffb301e9137c8446b9a546ff233b7d83a9ee2bd /ChangeLog | |
parent | a3efddb96f5f121b8a5bb1310dc82407546fd255 (diff) | |
download | gnulib-35bd46f0c816948dc1a0430c8ba8b10a01167320.tar.gz |
file-has-acl: improve recent NFSv4 support
This fixes a link failure with emacsclient on GNU/Linux. This
program wants file_has_acl but none of the other ACL primitives,
so it doesn’t link acl-internal.o; this way it doesn’t need to
link with -lacl. While I was at it I reviewed the recent changes,
fixed some unlikely overflow bugs, and adjusted to GNU style.
* doc/acl-nfsv4.txt: Remove. Its contents are now in a
comment in lib/file-has-acl.c.
* lib/acl-internal.c, lib/acl-internal.h: Move recent changes
relating to acl_nfs4_nontrivial to lib/file-has-acl.c, so that
there is no trouble linking programs that need only file_has_acl.
* lib/file-has-acl.c (acl_nfs4_nontrivial): Move here from
lib/acl-internal.c, so that we needn't link -lacl in
programs that want only file_has_acl, such as emacsclient.
Do not assume a char buffer is aligned for uint32_t.
Check more carefully for buffer read overrun.
Allow up to 6 ACEs, since other code does; but check
that they’re distinct. Avoid integer overflow.
Use memcmp rather than strncmp to compare memory blocks.
(file_has_acl): Preserve initial errno instead of setting to 0.
Allocate a bit more room for trivial ACL buffer.
Use EINVAL for botchedk NFSv4 ACLs (which shouldn’t happen).
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -1,3 +1,28 @@ +2022-12-23 Paul Eggert <eggert@cs.ucla.edu> + + file-has-acl: improve recent NFSv4 support + This fixes a link failure with emacsclient on GNU/Linux. This + program wants file_has_acl but none of the other ACL primitives, + so it doesn’t link acl-internal.o; this way it doesn’t need to + link with -lacl. While I was at it I reviewed the recent changes, + fixed some unlikely overflow bugs, and adjusted to GNU style. + * doc/acl-nfsv4.txt: Remove. Its contents are now in a + comment in lib/file-has-acl.c. + * lib/acl-internal.c, lib/acl-internal.h: Move recent changes + relating to acl_nfs4_nontrivial to lib/file-has-acl.c, so that + there is no trouble linking programs that need only file_has_acl. + * lib/file-has-acl.c (acl_nfs4_nontrivial): Move here from + lib/acl-internal.c, so that we needn't link -lacl in + programs that want only file_has_acl, such as emacsclient. + Do not assume a char buffer is aligned for uint32_t. + Check more carefully for buffer read overrun. + Allow up to 6 ACEs, since other code does; but check + that they’re distinct. Avoid integer overflow. + Use memcmp rather than strncmp to compare memory blocks. + (file_has_acl): Preserve initial errno instead of setting to 0. + Allocate a bit more room for trivial ACL buffer. + Use EINVAL for botchedk NFSv4 ACLs (which shouldn’t happen). + 2022-12-22 Paul Eggert <eggert@cs.ucla.edu> posix_spawnp-tests: fix filename typo |