<div dir="auto">Which host distributionen are you using? </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 7 May 2019, 14:47 Popov Anton, &lt;<a href="mailto:Anton.Popov@t-platforms.ru">Anton.Popov@t-platforms.ru</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I don&#39;t think so. At the moment we are using rocko release and found this problem in util-linux-2.30 recipe.<br>
<br>
the problem is that util-linux builds with regular user permissions and result files are owned by user with uid 1000 in our case. for most of binaries in /bin and /sbin generated by util-linux this permissions issue is not a problem (Because all binaries has o+x set). But for those of them who have suid bit setted it became a real trouble.<br>
<br>
With best regards,<br>
Anton Popov<br>
<br>
________________________________________<br>
От: Jacob Kroon [<a href="mailto:jacob.kroon@gmail.com" target="_blank" rel="noreferrer">jacob.kroon@gmail.com</a>]<br>
Отправлено: 7 мая 2019 г. 8:04<br>
Кому: Popov Anton<br>
Копия: <a href="mailto:openembedded-core@lists.openembedded.org" target="_blank" rel="noreferrer">openembedded-core@lists.openembedded.org</a><br>
Тема: Re: [OE-core] [PATCH] util-linux: fix owner and group for binaries in resulting image<br>
<br>
Hi,<br>
Are we sure this is not caused by the new glibc2.29/pseudo problems<br>
that has been seen previously ?<br>
Which distro are you building on, and which version of poky/oe are you using ?<br>
/Jacob<br>
<br>
On Mon, May 6, 2019 at 5:46 PM Popov Anton &lt;<a href="mailto:Anton.Popov@t-platforms.ru" target="_blank" rel="noreferrer">Anton.Popov@t-platforms.ru</a>&gt; wrote:<br>
&gt;<br>
&gt; util-linux source produce some binaries with setuid bit set<br>
&gt;<br>
&gt; do_install function produce binaries in /sbin and /bin with uid:gid<br>
&gt; of user who build image this lead to messages like this:<br>
&gt; mount /dev/sdb1 /mnt/flash<br>
&gt; mount: only root can do that (effective UID is 1000)<br>
&gt; this patch changing owner of binaries in /bin and /sbin to 0:0<br>
&gt;<br>
&gt; Signed-off-by: Anton Popov &lt;<a href="mailto:Anton.Popov@t-platforms.ru" target="_blank" rel="noreferrer">Anton.Popov@t-platforms.ru</a>&gt;<br>
&gt; ---<br>
&gt;  meta/recipes-core/util-linux/util-linux.inc | 21 +++++++++++++++++++++<br>
&gt;  1 file changed, 21 insertions(+)<br>
&gt;<br>
&gt; diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc<br>
&gt; index 34255a2dec..d75a2dd399 100644<br>
&gt; --- a/meta/recipes-core/util-linux/util-linux.inc<br>
&gt; +++ b/meta/recipes-core/util-linux/util-linux.inc<br>
&gt; @@ -201,6 +201,27 @@ do_install () {<br>
&gt;      fi<br>
&gt;  }<br>
&gt;<br>
&gt; +# when building yocto image with non-root user some binaries appears in resulting<br>
&gt; +# image with rights of user who build image. This behaviour may lead to misfunction<br>
&gt; +# of some binaries like mount because of setuid bit on them:<br>
&gt; +# mount /dev/sdb1 /mnt/flash<br>
&gt; +# mount: only root can do that (effective UID is 1000)<br>
&gt; +# ls -ld which mount<br>
&gt; +# lrwxrwxrwx    1 root     root            21 Jan  2  1970 /bin/mount -&gt; /bin/mount.util-linux                                                                                       # root@mitx-fp32:/mnt/system/initrd# ls -ld /bin/mount.util-linux                                                                                                                    # -rwsr-xr-x    1 1000     1000         28020 Apr 23 12:49 /bin/mount.util-linux<br>
&gt; +do_install_append_class-target () {<br>
&gt; +    for p in $sbinprogs $sbinprogs_a; do<br>
&gt; +        if [ -f &quot;${D}${base_sbindir}/$p&quot; ]; then<br>
&gt; +            chown 0:0 &quot;${D}${base_sbindir}/$p&quot;<br>
&gt; +        fi<br>
&gt; +    done<br>
&gt; +    for p in $binprogs_a; do<br>
&gt; +        if [ -f &quot;${D}${base_bindir}/$p&quot; ]; then<br>
&gt; +            chown 0:0 &quot;${D}${base_bindir}/$p&quot;<br>
&gt; +        fi<br>
&gt; +    done<br>
&gt; +}<br>
&gt; +<br>
&gt; +<br>
&gt;  # nologin causes a conflict with shadow-native<br>
&gt;  # kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir})<br>
&gt;  do_install_append_class-native () {<br>
&gt; --<br>
&gt; 2.20.1<br>
&gt; --<br>
&gt; _______________________________________________<br>
&gt; Openembedded-core mailing list<br>
&gt; <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank" rel="noreferrer">Openembedded-core@lists.openembedded.org</a><br>
&gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>