bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Ondrej Valousek <ondrej.valousek.xm@renesas.com>
To: Paul Eggert <eggert@cs.ucla.edu>, Bruno Haible <bruno@clisp.org>,
	"bug-gnulib@gnu.org" <bug-gnulib@gnu.org>
Subject: Re: [PATCH] Use xattr (Linux) in qcopy-acl.c
Date: Wed, 4 Jan 2023 20:54:05 +0000	[thread overview]
Message-ID: <TYXPR01MB1854E3B8F44013CC232E4ECED9F59@TYXPR01MB1854.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <e46d9ca3-600d-aa46-809f-89e3b9b9879b@cs.ucla.edu>

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]


> Perhaps you can fix
this by fixing the Link sections of the relevant modules to use
$(LIB_HAS_ACL) instead of $(LIB_ACL). That is, for each module where you
added $(LIB_XATTR), replace its $(LIB_ACL) with $(LIB_HAS_ACL) if the
only reason it needed $(LIB_ACL) was to copy attributes.

Nope. LIB_HAS_ACL has value only if glibc does not know getxattr() system call. It has nothing to do with libattr (yes, it's bit confusing).
Why don't we solve the linker problem with the "--as-needed" option? This will make linker clever enough not to link libraries that are not needed.

> Also, come to think of it, is there a security issue between the
chmod_or_fchmod call, and the attr_copy_fd call? That is, could the file
temporarily be set to too-generous permissions, between the two calls? A
comment explaining this issue would help.

It depends on a kernel ACL implementation. On Linux the ACLs make the permissions only more opened (hence my code would be fine).
In contrast, on Solaris/ZFS, the opposite could happen.
NetApp NFSv4 server even allows you to break RFC7530 the way that chmod 0 <file> will still allow the inherited ACLs to be applied.
In general, I'd say we should be secure here.


[-- Attachment #2: Type: text/html, Size: 2048 bytes --]

  reply	other threads:[~2023-01-04 20:54 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 14:34 [PATCH] Use xattr (Linux) in qcopy-acl.c Ondrej Valousek
2023-01-04 14:46 ` Bruno Haible
2023-01-04 19:29   ` Paul Eggert
2023-01-04 20:54     ` Ondrej Valousek [this message]
2023-01-05  1:19       ` Paul Eggert
2023-01-13  9:15         ` ACL complexity Bruno Haible
2023-01-13 10:03           ` Ondrej Valousek
2023-01-13 11:05             ` Bruno Haible
2023-01-13 11:22               ` Ondrej Valousek
2023-01-05  9:00       ` [PATCH] Use xattr (Linux) in qcopy-acl.c Bruno Haible
2023-01-05  9:05         ` Ondrej Valousek
2023-01-05 10:32           ` Bruno Haible
2023-01-05 19:06             ` Paul Eggert
2023-01-11  9:11               ` Ondrej Valousek
2023-01-12 20:42                 ` Bruno Haible
2023-01-13  7:51                   ` Bruno Haible
2023-01-13  8:09                     ` Bruno Haible
2023-01-13  8:32                       ` Ondrej Valousek
2023-01-13  8:46                         ` Bruno Haible
2023-01-14  1:52                           ` Paul Eggert
2023-01-14  7:26                             ` Ondrej Valousek
2023-01-14  7:55                               ` Bruno Haible
2023-01-14  8:02                                 ` Ondrej Valousek
2023-01-13  8:33               ` Bruno Haible
2023-01-13  8:50                 ` Bruno Haible
2023-01-30 10:18                 ` Bruno Haible
2023-01-05  8:56     ` Bruno Haible
     [not found] ` <TYXPR01MB18544D0A5C213BF0204BF0D4D9FD9@TYXPR01MB1854.jpnprd01.prod.outlook.com>
     [not found]   ` <c1ddff8c-2734-bfa1-11a3-3279ae9e92cb@cs.ucla.edu>
2023-01-12 20:58     ` Bruno Haible
2023-01-12 22:53       ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=TYXPR01MB1854E3B8F44013CC232E4ECED9F59@TYXPR01MB1854.jpnprd01.prod.outlook.com \
    --to=ondrej.valousek.xm@renesas.com \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).