Hi,
A possible fix for this issue during the do_patch task might be the following:


diff --git 
a/recipes-security/selinux/libselinux/0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch
 
b/recipes-security/selinux/libselinux/0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch

index 8a9fb7c..66c86ee 100644

--- 
a/recipes-security/selinux/libselinux/0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch

+++ 
b/recipes-security/selinux/libselinux/0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch

@@ -17,8 +17,8 @@ Acked-by: Stephen Smalley <stephen.smalley.w...@gmail.com>



 diff --git a/libselinux/src/selinux_restorecon.c 
b/libselinux/src/selinux_restorecon.c

 index d1ce830c5..6993be6fd 100644

---- a/libselinux/src/selinux_restorecon.c

-+++ b/libselinux/src/selinux_restorecon.c

+--- a/src/selinux_restorecon.c

++++ b/src/selinux_restorecon.c

 @@ -1154,6 +1154,8 @@ void selinux_restorecon_set_sehandle(struct 
selabel_handle *hndl)

        size_t num_specfiles, fc_digest_len;


Basically in the patch file: 
0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch remove 
“libselinux” from a/libselinux/src/selinux_restorecon.c and 
b/libselinux/src/selinux_restorecon.c

I tested it and works fine.

From: Maurizio Macrina <mmacr...@catchpoint.com>
Date: Monday, 8 November 2021 at 14:13
To: jonas.br...@bmw.de <jonas.br...@bmw.de>, yocto@lists.yoctoproject.org 
<yocto@lists.yoctoproject.org>
Subject: Re: [yocto] meta-selinux: dunfell: libselinux: 
0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch fails to 
apply
Hello Jonas,
I’ve also recently hit an error during the do_patch task of libselinux.
001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch has been 
recently added to the dunfell branch but fails to apply:

ERROR: Applying patch 
'0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch' on target 
directory 
'/yocto/c2100-catchpoint-system-image/poky/build/tmp/work/core2-64-poky-linux/libselinux/3.0-r0/libselinux-3.0'
Command Error: 'quilt --quiltrc 
/yocto/c2100-catchpoint-system-image/poky/build/tmp/work/core2-64-poky-linux/libselinux/3.0-r0/recipe-sysroot-native/etc/quiltrc
 push' exited with 0  Output:
Applying patch 
0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch
can't find file to patch at input line 22
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 08f5e30177218fae7ce9f5c8d6856690126b2b30 Mon Sep 17 00:00:00 2001
|From: Ji Qin <jiqin...@huawei.com>
|Date: Sun, 14 Jun 2020 21:20:23 -0400
|Subject: [PATCH] libselinux: Fix NULL pointer use in
| selinux_restorecon_set_sehandle
|
|error occur when selinux_restorecon_default_handle return NULL in
|restorecon_init.
|
|fixes: https://github.com/SELinuxProject/selinux/issues/249
|
|Signed-off-by: Ji Qin <jiqin...@huawei.com>
|Acked-by: Stephen Smalley <stephen.smalley.w...@gmail.com>
|---
| libselinux/src/selinux_restorecon.c | 2 ++
| 1 file changed, 2 insertions(+)
|
|diff --git a/libselinux/src/selinux_restorecon.c 
b/libselinux/src/selinux_restorecon.c
|index d1ce830c5..6993be6fd 100644
|--- a/libselinux/src/selinux_restorecon.c
|+++ b/libselinux/src/selinux_restorecon.c
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Patch 0001-Fix-NULL-pointer-use-in-selinux_restorecon_set_sehandle.patch does 
not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

I’ve attached the corresponding log.

What would be the suggested fix for this?
I don’t think the leading a/b in the path is the issue here, other patch files 
have the same path.

Thanks.

Regards.

Maurizio Macrina
Senior Software Engineer  | Catchpoint
P:  +39 3472458541
E:  mmacr...@catchpoint.com<mailto:mmacr...@catchpoint.com>
www.catchpoint.com<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catchpoint.com%2F&data=04%7C01%7Cmmacrina%40catchpoint.com%7C98c1d709680945f4f57608d97cfbfa25%7C0c927d7e38e74a3fa4f2e746ec8a0842%7C0%7C0%7C637678243963406272%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2BSEn3zXyaFsuKgWdv%2F4Z8KLoARCfg8DWsQ6LNoWh%2F%2Bk%3D&reserved=0>

[cid464070800*image001.png@01D7AF12.EF411150]<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catchpoint.com%2Fsignature&data=04%7C01%7Cmmacrina%40catchpoint.com%7C98c1d709680945f4f57608d97cfbfa25%7C0c927d7e38e74a3fa4f2e746ec8a0842%7C0%7C0%7C637678243963416231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=exWPtVUWOEYmXAFIm0F2uOvy2tO6wBDxRpz5cORxWpQ%3D&reserved=0>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#55279): https://lists.yoctoproject.org/g/yocto/message/55279
Mute This Topic: https://lists.yoctoproject.org/mt/86440168/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to