All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Gladkov <legion@kernel.org>
To: kbd@lists.linux.dev, Steffen Nurpmeso <steffen@sdaoden.eu>
Subject: Re: kbd 2.9.0: build error (under fakeroot(1) environment)
Date: Fri, 19 Sep 2025 17:16:39 +0200	[thread overview]
Message-ID: <aM1z1wErMKbNTAZP@example.org> (raw)
In-Reply-To: <20250910123724.s2uU6eVo@steffen%sdaoden.eu>

On Wed, Sep 10, 2025 at 02:37:24PM +0200, Steffen Nurpmeso wrote:
> Alexey Gladkov wrote in
>  <aMFMHp57qTVOKSUv@example.org>:
>  |On Tue, Sep 09, 2025 at 11:18:18PM +0200, Steffen Nurpmeso wrote:
>  |> Alexey Gladkov wrote in
>  |>  <aMBGmTfQO-ukr9GP@example.org>:
>  |>|On Tue, Sep 09, 2025 at 03:45:33PM +0200, Steffen Nurpmeso wrote:
>  |>|> My distribution (CRUX) updated to 2.9.0, and the build failed via
>  |>|> 
>  |>|>   cp: failed to preserve ownership for /tmp/.pkgmk/pkg/usr/share/kbd/ke\
>  |>|>   ym\
>  |>|>   aps/i386/qwertz/sr-latin.map.gz: Operation not supported
>  |>|> 
>  |>|> Thing is that this seems to only work for real root user, but that
>  |>|> is not who is doing it, really.
>  |>|
>  |>|cp -a is used in the makefile. The -a means no dereference and preserve
>  |>|links and other attributes. This should not be a problem if you have
>  |>|the same user.
>  |> 
>  |> GNU coreutils 9.7 cp(1) is of a different opinion:
>  |> 
>  |>   $ touch xa
>  |>   $ ln -s xa xb
>  |>   $ cp -a xb xc
>  |>   cp: failed to preserve ownership for xc: Operation not supported
>  |
>  |No. This is security settings on your system.
>  |
>  |On my laptop:
>  |
>  |$ touch xa
>  |$ ln -s xa xb
>  |$ cp -a xb xc
> 
>  |$ ls -la
>  |total 8
>  |drwxr-xr-x  2 legion legion 4096 Sep 10 11:30 .
>  |drwxr-xr-x 15 legion legion 4096 Sep 10 11:30 ..
>  |-rw-r--r--  1 legion legion    0 Sep 10 11:30 xa
>  |lrwxrwxrwx  1 legion legion    2 Sep 10 11:30 xb -> xa
>  |lrwxrwxrwx  1 legion legion    2 Sep 10 11:30 xc -> xa
> 
>  |$ cp --version | head -1
>  |cp (GNU coreutils) 9.7
> 
> This is really strange; i have no "security setting", actually,
> only the fs.protected_* sysctls are set.
> I get the failure in the "sticky" /tmp/ as well as as myself in my
> home directory.  Looking at coreutils cp.c the error comes from
> 
>       if (x->preserve_ownership)
>         {
>           if (lchownat (dst_dirfd, relname, p->st.st_uid, p->st.st_gid)
>               != 0)
> ...
>                   error (0, errno, _("failed to preserve ownership for %s"),
>                          quoteaf (dst_name));
> 
> Here there is no lchownat(3/2), and if i do (copied from manual
> and made runnable)
> 
>              #include <sys/types.h>
>              #include <unistd.h>
>              #include <pwd.h>
>              #include <grp.h>
>   #include <errno.h>
>   #include <string.h>
>   #include <stdio.h>
>   int main(void){
>              struct passwd *pwd;
>              struct group  *grp;
>              int x;
> 
>              pwd = getpwnam("steffen");
>              grp = getgrnam("steffen");
>              x = lchown("xb", pwd->pw_uid, grp->gr_gid);
>              fprintf(stderr, "x=%d errno=%s\n", x, strerror(errno));
>              return 0;
>   }
> 
> i get
> 
>   #?148|kent:x$ fakeroot tcc -run t.c
>   x=0 errno=Success
>   #?0|kent:x$ tcc -run t.c
>   x=0 errno=Success
> 
> wherever i try, and so it seems to me the GNU coreutils
> lib/fchownat.c fallback implementation of lchownat() is bogus
> thus??
> 
>   ...
>  |>|You can try to change "cp -a" by "cp -dPR". Maybe this will help with
>  |>|fakeroot.
>  |> 
>  |> Yes, it does.
>  |
>  |Good. Thanks!
>  |
>  |https://web.git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git/commi\
>  |t/?id=db82eb6f86e6c0b8ac4260e88b88d66e1cd7c077
> 
> Ah, and the kernel.org "you are not a robot check" is totally
> bogus.  If i go directly to
> 
>   https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git/commit/?id=db82eb6f86e6c0b8ac4260e88b88d66e1cd7c077

Sorry for delay. You can use the mirror:

https://github.com/legionus/kbd/commit/db82eb6f86e6c0b8ac4260e88b88d66e1cd7c077

> i get over it, but if i follow your link i get in an endless loop
> that tries and restarts and tries and restarts.  Some lwn.net
> article link i followed (on git and rust, led to still running
> FreeBSD bikeshed "Re: Git haas gone wild (Rust), freebsd-update"
> thread on freebsd-hackers@) always ends up as "Noes!" or
> something.  Just in case ..  (Luckily with lynx(1) direct access
> is possible without that script mess.)
> 
> So anyway the commit message of yours is not right ;)

Well, the message reflects my understanding of the situation.
Perhaps I am wrong.

>, and, do you
> know people of coreutils, or is this worth a bug report?

No, I don't know anyone from coreutils. But perhaps they should be
informed about this behavior.

-- 
Rgrds, legion


  reply	other threads:[~2025-09-19 15:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 13:45 kbd 2.9.0: build error (under fakeroot(1) environment) Steffen Nurpmeso
2025-09-09 15:24 ` Alexey Gladkov
2025-09-09 21:18   ` Steffen Nurpmeso
2025-09-10  9:59     ` Alexey Gladkov
2025-09-10 12:37       ` Steffen Nurpmeso
2025-09-19 15:16         ` Alexey Gladkov [this message]
2025-09-20 15:57           ` Steffen Nurpmeso
2025-09-20 16:22             ` bug#79433: " Paul Eggert
2025-09-20 20:43               ` Steffen Nurpmeso
2025-09-21 16:57                 ` Paul Eggert
2025-09-22 16:21                   ` Steffen Nurpmeso

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

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

  git send-email \
    --in-reply-to=aM1z1wErMKbNTAZP@example.org \
    --to=legion@kernel.org \
    --cc=kbd@lists.linux.dev \
    --cc=steffen@sdaoden.eu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.