<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, <<a href="mailto:Anton.Popov@t-platforms.ru">Anton.Popov@t-platforms.ru</a>> 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'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 <<a href="mailto:Anton.Popov@t-platforms.ru" target="_blank" rel="noreferrer">Anton.Popov@t-platforms.ru</a>> wrote:<br>
><br>
> util-linux source produce some binaries with setuid bit set<br>
><br>
> do_install function produce binaries in /sbin and /bin with uid:gid<br>
> of user who build image this lead to messages like this:<br>
> mount /dev/sdb1 /mnt/flash<br>
> mount: only root can do that (effective UID is 1000)<br>
> this patch changing owner of binaries in /bin and /sbin to 0:0<br>
><br>
> Signed-off-by: Anton Popov <<a href="mailto:Anton.Popov@t-platforms.ru" target="_blank" rel="noreferrer">Anton.Popov@t-platforms.ru</a>><br>
> ---<br>
> meta/recipes-core/util-linux/util-linux.inc | 21 +++++++++++++++++++++<br>
> 1 file changed, 21 insertions(+)<br>
><br>
> diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc<br>
> index 34255a2dec..d75a2dd399 100644<br>
> --- a/meta/recipes-core/util-linux/util-linux.inc<br>
> +++ b/meta/recipes-core/util-linux/util-linux.inc<br>
> @@ -201,6 +201,27 @@ do_install () {<br>
> fi<br>
> }<br>
><br>
> +# when building yocto image with non-root user some binaries appears in resulting<br>
> +# image with rights of user who build image. This behaviour may lead to misfunction<br>
> +# of some binaries like mount because of setuid bit on them:<br>
> +# mount /dev/sdb1 /mnt/flash<br>
> +# mount: only root can do that (effective UID is 1000)<br>
> +# ls -ld which mount<br>
> +# lrwxrwxrwx 1 root root 21 Jan 2 1970 /bin/mount -> /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>
> +do_install_append_class-target () {<br>
> + for p in $sbinprogs $sbinprogs_a; do<br>
> + if [ -f "${D}${base_sbindir}/$p" ]; then<br>
> + chown 0:0 "${D}${base_sbindir}/$p"<br>
> + fi<br>
> + done<br>
> + for p in $binprogs_a; do<br>
> + if [ -f "${D}${base_bindir}/$p" ]; then<br>
> + chown 0:0 "${D}${base_bindir}/$p"<br>
> + fi<br>
> + done<br>
> +}<br>
> +<br>
> +<br>
> # nologin causes a conflict with shadow-native<br>
> # kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir})<br>
> do_install_append_class-native () {<br>
> --<br>
> 2.20.1<br>
> --<br>
> _______________________________________________<br>
> Openembedded-core mailing list<br>
> <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank" rel="noreferrer">Openembedded-core@lists.openembedded.org</a><br>
> <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>