All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iputils: Use STAGING_DIR_NATIVE for setcap detection
@ 2021-02-18  0:11 Jate Sujjavanich
  2021-02-18 16:01 ` [OE-core] " Alexander Kanavin
  2021-02-18 16:35 ` Richard Purdie
  0 siblings, 2 replies; 4+ messages in thread
From: Jate Sujjavanich @ 2021-02-18  0:11 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jate Sujjavanich

Search for setcap in STAGING_DIR_NATIVE to avoid host contamination. Add
DEPENDS for libcap-native to supply this if we select libcap for
PACKAGECONFIG.

The previous setting of NO_SETCAP_OR_SUID broke setuid or setcap of
/bin/ping

Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
---
 meta/recipes-extended/iputils/iputils_s20200821.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/iputils/iputils_s20200821.bb b/meta/recipes-extended/iputils/iputils_s20200821.bb
index 8b63a23c61..feb97d5086 100644
--- a/meta/recipes-extended/iputils/iputils_s20200821.bb
+++ b/meta/recipes-extended/iputils/iputils_s20200821.bb
@@ -12,6 +12,7 @@ DEPENDS = "gnutls"
 
 SRC_URI = "git://github.com/iputils/iputils \
            file://0001-rarpd-rdisc-Drop-PrivateUsers.patch \
+           file://0001-Add-support-for-setcap-in-STAGING_DIR_NATIVE.patch \
            "
 SRCREV = "23c3782ae0c7f9c6ae59dbed8ad9204f8758542b"
 
@@ -26,7 +27,7 @@ CVE_CHECK_WHITELIST += "CVE-2000-1213 CVE-2000-1214"
 PACKAGECONFIG ??= "libcap rarpd \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ninfod traceroute6', '', d)} \
                    ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
-PACKAGECONFIG[libcap] = "-DUSE_CAP=true, -DUSE_CAP=false, libcap"
+PACKAGECONFIG[libcap] = "-DUSE_CAP=true, -DUSE_CAP=false, libcap libcap-native"
 PACKAGECONFIG[libidn] = "-DUSE_IDN=true, -DUSE_IDN=false, libidn2"
 PACKAGECONFIG[gettext] = "-DUSE_GETTEXT=true, -DUSE_GETTEXT=false, gettext"
 PACKAGECONFIG[ninfod] = "-DBUILD_NINFOD=true,-DBUILD_NINFOD=false,"
@@ -38,7 +39,7 @@ PACKAGECONFIG[docs] = "-DBUILD_HTML_MANS=true -DBUILD_MANS=true,-DBUILD_HTML_MAN
 
 inherit meson systemd update-alternatives
 
-EXTRA_OEMESON += "--prefix=${root_prefix}/"
+EXTRA_OEMESON += "--prefix=${root_prefix}/ -Dstagingdirnative=${STAGING_DIR_NATIVE}"
 
 ALTERNATIVE_PRIORITY = "100"
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] iputils: Use STAGING_DIR_NATIVE for setcap detection
  2021-02-18  0:11 [PATCH] iputils: Use STAGING_DIR_NATIVE for setcap detection Jate Sujjavanich
@ 2021-02-18 16:01 ` Alexander Kanavin
  2021-02-18 16:35 ` Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Alexander Kanavin @ 2021-02-18 16:01 UTC (permalink / raw)
  To: Jate Sujjavanich; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 2238 bytes --]

0001-Add-support-for-setcap-in-STAGING_DIR_NATIVE.patch seems missing?

Alex

On Thu, 18 Feb 2021 at 01:11, Jate Sujjavanich <jatedev@gmail.com> wrote:

> Search for setcap in STAGING_DIR_NATIVE to avoid host contamination. Add
> DEPENDS for libcap-native to supply this if we select libcap for
> PACKAGECONFIG.
>
> The previous setting of NO_SETCAP_OR_SUID broke setuid or setcap of
> /bin/ping
>
> Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
> ---
>  meta/recipes-extended/iputils/iputils_s20200821.bb | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-extended/iputils/iputils_s20200821.bb
> b/meta/recipes-extended/iputils/iputils_s20200821.bb
> index 8b63a23c61..feb97d5086 100644
> --- a/meta/recipes-extended/iputils/iputils_s20200821.bb
> +++ b/meta/recipes-extended/iputils/iputils_s20200821.bb
> @@ -12,6 +12,7 @@ DEPENDS = "gnutls"
>
>  SRC_URI = "git://github.com/iputils/iputils \
>             file://0001-rarpd-rdisc-Drop-PrivateUsers.patch \
> +           file://0001-Add-support-for-setcap-in-STAGING_DIR_NATIVE.patch
> \
>             "
>  SRCREV = "23c3782ae0c7f9c6ae59dbed8ad9204f8758542b"
>
> @@ -26,7 +27,7 @@ CVE_CHECK_WHITELIST += "CVE-2000-1213 CVE-2000-1214"
>  PACKAGECONFIG ??= "libcap rarpd \
>                     ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6',
> 'ninfod traceroute6', '', d)} \
>                     ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> -PACKAGECONFIG[libcap] = "-DUSE_CAP=true, -DUSE_CAP=false, libcap"
> +PACKAGECONFIG[libcap] = "-DUSE_CAP=true, -DUSE_CAP=false, libcap
> libcap-native"
>  PACKAGECONFIG[libidn] = "-DUSE_IDN=true, -DUSE_IDN=false, libidn2"
>  PACKAGECONFIG[gettext] = "-DUSE_GETTEXT=true, -DUSE_GETTEXT=false,
> gettext"
>  PACKAGECONFIG[ninfod] = "-DBUILD_NINFOD=true,-DBUILD_NINFOD=false,"
> @@ -38,7 +39,7 @@ PACKAGECONFIG[docs] = "-DBUILD_HTML_MANS=true
> -DBUILD_MANS=true,-DBUILD_HTML_MAN
>
>  inherit meson systemd update-alternatives
>
> -EXTRA_OEMESON += "--prefix=${root_prefix}/"
> +EXTRA_OEMESON += "--prefix=${root_prefix}/
> -Dstagingdirnative=${STAGING_DIR_NATIVE}"
>
>  ALTERNATIVE_PRIORITY = "100"
>
> --
> 2.25.1
>
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 3377 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] iputils: Use STAGING_DIR_NATIVE for setcap detection
  2021-02-18  0:11 [PATCH] iputils: Use STAGING_DIR_NATIVE for setcap detection Jate Sujjavanich
  2021-02-18 16:01 ` [OE-core] " Alexander Kanavin
@ 2021-02-18 16:35 ` Richard Purdie
  2021-02-18 19:15   ` Jate Sujjavanich
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2021-02-18 16:35 UTC (permalink / raw)
  To: Jate Sujjavanich, openembedded-core

On Thu, 2021-02-18 at 00:11 +0000, Jate Sujjavanich wrote:
> Search for setcap in STAGING_DIR_NATIVE to avoid host contamination. Add
> DEPENDS for libcap-native to supply this if we select libcap for
> PACKAGECONFIG.

Why does it need setcap-native, isn't the target setcap enough? It seems 
odd that it should need it...

Cheers,

Richard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] iputils: Use STAGING_DIR_NATIVE for setcap detection
  2021-02-18 16:35 ` Richard Purdie
@ 2021-02-18 19:15   ` Jate Sujjavanich
  0 siblings, 0 replies; 4+ messages in thread
From: Jate Sujjavanich @ 2021-02-18 19:15 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

The iputils build will try to make the binaries callable by regular users
using setcap or setuid depending on what is available on the system. It
turns out that libcap provides this command. I figured that adding the
dependency on libcap-native and having meson search STAGING_DIR_NATIVE
would work. If libcap is not on in PACKAGECONFIG, then it falls back to
setuid. The script which does this is build-aux/setcap-setuid.sh.

This will become more apparent in version 2 which will contain the missing
a patch file.

- Jate

On Thu, Feb 18, 2021 at 11:35 AM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Thu, 2021-02-18 at 00:11 +0000, Jate Sujjavanich wrote:
> > Search for setcap in STAGING_DIR_NATIVE to avoid host contamination. Add
> > DEPENDS for libcap-native to supply this if we select libcap for
> > PACKAGECONFIG.
>
> Why does it need setcap-native, isn't the target setcap enough? It seems
> odd that it should need it...
>
> Cheers,
>
> Richard
>
>

[-- Attachment #2: Type: text/html, Size: 1395 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-18 19:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18  0:11 [PATCH] iputils: Use STAGING_DIR_NATIVE for setcap detection Jate Sujjavanich
2021-02-18 16:01 ` [OE-core] " Alexander Kanavin
2021-02-18 16:35 ` Richard Purdie
2021-02-18 19:15   ` Jate Sujjavanich

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.