From nobody Mon Sep 4 18:29:44 2023 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rfccf0kjMz4rHyR for ; Mon, 4 Sep 2023 18:29:54 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rfccd0dPjz3SGN for ; Mon, 4 Sep 2023 18:29:52 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of dchagin@heemeyer.club has no SPF policy when checking 195.93.173.158) smtp.mailfrom=dchagin@heemeyer.club; dmarc=none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.2/8.16.1) with ESMTP id 384ITioh035134 for ; Mon, 4 Sep 2023 21:29:44 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.2/8.16.1/Submit) id 384ITisf035133 for current@freebsd.org; Mon, 4 Sep 2023 21:29:44 +0300 (MSK) (envelope-from dchagin) Date: Mon, 4 Sep 2023 21:29:44 +0300 From: Dmitry Chagin To: current@freebsd.org Subject: Re: Possible issue with linux xattr support? Message-ID: References: <52go6mhpf34em7x7llzh7dgtf7ggdd7n2wuofm2yrndiw73yqk@pgngyvdypvhd> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52go6mhpf34em7x7llzh7dgtf7ggdd7n2wuofm2yrndiw73yqk@pgngyvdypvhd> X-Spamd-Bar: / X-Spamd-Result: default: False [-0.77 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.970]; FORGED_SENDER(0.30)[dchagin@freebsd.org,dchagin@heemeyer.club]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[current@freebsd.org]; TO_DOM_EQ_FROM_DOM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DMARC_NA(0.00)[freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[dchagin]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[dchagin@freebsd.org,dchagin@heemeyer.club]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[current@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU] X-Rspamd-Queue-Id: 4Rfccd0dPjz3SGN On Mon, Sep 04, 2023 at 04:03:54PM +0200, Felix Palmen wrote: > * Felix Palmen [20230904 15:39]: > > For some reason (I still have to try to get more information about it, > > will do soon), something else is broken now. While install from GNU > > coreutils works fine, some build systems use 'cp -p' to install files > > instead, which now fails with: > > > > | cp: preserving permissions for [...]: Operation not permitted > > The issue seems to be with listing attributes: > > | root@15-default:/wrkdirs/usr/ports/x11/linuxsrc-libxcb/work/libxcb-1.15/doc # truss /compat/linux/bin/cp -pR ./tutorial '/wrkdirs/usr/ports/x11/linuxsrc-libxcb/work/stage/compat/linux/usr/share/doc/libxcb/' 2>&1 | grep xattr > | linux_flistxattr(0x4,0x0,0x0) ERR#-1 'Operation not permitted' > | linux_flistxattr(0x4,0x0,0x0) ERR#-1 'Operation not permitted' > | linux_llistxattr(0xffffffffcdd9,0x0,0x0) ERR#-1 'Operation not permitted' > > The following q&d patch makes it work again: > > #v+ > diff --git a/sys/compat/linux/linux_xattr.c b/sys/compat/linux/linux_xattr.c > index 74b47f1cbaec..0b5af084b1b1 100644 > --- a/sys/compat/linux/linux_xattr.c > +++ b/sys/compat/linux/linux_xattr.c > @@ -198,7 +198,7 @@ listxattr(struct thread *td, struct listxattr_args *args) > if (error == 0) > td->td_retval[0] = cnt; > free(data, M_LINUX); > - return (error_to_xattrerror(attrnamespace, error)); > + return (error_to_xattrerror(EXTATTR_NAMESPACE_SYSTEM, error)); > } > > int > #v- > > I think this makes sense, because listxattr iterates over all > namespaces, so there's no sane way to know whether the EPERM was caused > by trying to access "system" or something else. Thanks for the report, please, try this: https://people.freebsd.org/~dchagin/lxattr.patch Don't be surprised, there 2 fixes > > Cheers, Felix > > -- > Felix Palmen {private} felix@palmen-it.de > -- ports committer -- {web} http://palmen-it.de > {pgp public key} http://palmen-it.de/pub.txt > {pgp fingerprint} 6936 13D5 5BBF 4837 B212 3ACC 54AD E006 9879 F231