Re: 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.ji@...>

|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





|Signed-off-by: Ji Qin <jiqin.ji@...>

|Acked-by: Stephen Smalley <>


| 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.






Maurizio Macrina

Senior Software Engineer  | Catchpoint

P:  +39 3472458541



Join to automatically receive all group messages.