I sent an email to the meta-virtualization list describing what I'm trying to 
achieve and see if others have further ideas.

However, I would still like to continue investigating this sudo bug as it is 
quite annoying.
Even when running under pseudo, I don't see why the binary would show as not 
owned by the root user.
Dropping down to the devshell, the binary seems to have the right owner:

 ls -l /usr/bin/sudo
-rwsr-xr-x 1 root root 232416 Mar  1 13:59 /usr/bin/sudo

So any other input to put me on the right tracks would be appreciated.

--Adrian


________________________________
From: Bruce Ashfield <bruce.ashfi...@gmail.com>
Sent: Monday, April 3, 2023 5:59 PM
To: Adrian Dudau <adrian.du...@keyfactor.com>
Cc: Khem Raj <raj.k...@gmail.com>; yocto@lists.yoctoproject.org 
<yocto@lists.yoctoproject.org>
Subject: Re: [yocto] error when try to use sudo command in recipe

You don't often get email from bruce.ashfi...@gmail.com. Learn why this is 
important<https://aka.ms/LearnAboutSenderIdentification>
CAUTION: External Sender - Be cautious when clicking links or opening 
attachments. Please email info...@keyfactor.com with any questions.



On Mon, Apr 3, 2023 at 11:42 AM Adrian Dudau 
<adrian.du...@keyfactor.com<mailto:adrian.du...@keyfactor.com>> wrote:
Hi Khem,

Thanks for the reply, though I am not sure I fully understand the first part of 
your answer. I'm trying to do something similar to the thread creator, i.e 
running "podman pull" at build time to populate an image store that I can later 
install into the target rootfs.


FWIW. The above is something that I have almost working, but had to drop the 
completion of the support for the upcoming release (it was too late, and I had 
to get some kernel changes done). I'm hoping to have something usable in the 
next few months.

If you are trying to generate containers (I don't recommend pulling them) and 
installing them into a container store that is part of the rootfs, then 
collaborating on the meta-virtualization mailing list is a good starting point.

Bruce


Still, I am failing to understand why /usr/bin/sudo doesn't show up as owned by 
the root user, even when running under pseudo. Also, why has this changed 
between Dunfell and master and where exactly has the changed happened..

Best regards,
--Adrian
________________________________
From: Khem Raj <raj.k...@gmail.com<mailto:raj.k...@gmail.com>>
Sent: Monday, April 3, 2023 4:57 PM
To: Adrian Dudau <adrian.du...@keyfactor.com<mailto:adrian.du...@keyfactor.com>>
Cc: yocto@lists.yoctoproject.org<mailto:yocto@lists.yoctoproject.org> 
<yocto@lists.yoctoproject.org<mailto:yocto@lists.yoctoproject.org>>
Subject: Re: [yocto] error when try to use sudo command in recipe

You don't often get email from raj.k...@gmail.com<mailto:raj.k...@gmail.com>. 
Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
CAUTION: External Sender - Be cautious when clicking links or opening 
attachments. Please email info...@keyfactor.com<mailto:info...@keyfactor.com> 
with any questions.



On Mon, Apr 3, 2023 at 12:25 AM 
<adrian.du...@keyfactor.com<mailto:adrian.du...@keyfactor.com>> wrote:
On Mon, Feb 6, 2023 at 01:13 AM, Richard Purdie wrote:
Hi Richard,

Jumping on this thread to provide some clarifications as I hit the same bug.
I can confirm that this is not an environment issue. I could reproduce it by 
adding a sudo call in an empty recipe like this:

SUMMARY = ""
HOMEPAGE = ""
LICENSE = ""
SECTION = ""
DEPENDS = ""

SRC_URI = ""

do_install() {
    ls -l /usr/bin/sudo
    sudo ls -l /usr/bin/sudo
}

Build already use a fake root environment using pseudo to intercept the calls 
so this might not be out of line here. What is the original issue you are 
running into ?



Running bitbake barebone on my x86 machine produces this error:

| -rwxr-xr-x 1 nobody 65534 232416 Mar  1 13:59 /usr/bin/sudo
| sudo: /etc/sudo.conf is owned by uid 65534, should be 0
| sudo: /etc/sudo.conf is owned by uid 65534, should be 0
| sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
| sudo: /usr/libexec/sudo/sudoers.so must be owned by uid 0
| sudo: fatal error, unable to load plugins

Indeed it seems that ownership is broken somehow in the bb environment. The 
issue was introduced somewhere between dunfell and kirkstone. I know it's a 
large timespan but it's a bit time consuming to narrow it down.

Hoping to get some help on this. I would try to investigate further myself but 
I have no idea where to start to be honest.

Best regards,
--Adrian








--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at 
its end
- "Use the force Harry" - Gandalf, Star Trek II

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#59609): https://lists.yoctoproject.org/g/yocto/message/59609
Mute This Topic: https://lists.yoctoproject.org/mt/96733939/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to