From patchwork Tue Dec 10 13:12:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Zhao X-Patchwork-Id: 53882 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D652C3DA4A for ; Tue, 10 Dec 2024 13:13:29 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web10.9947.1733836400037024565 for ; Tue, 10 Dec 2024 05:13:20 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=20745f6cf3=yi.zhao@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BA6KQCp008981; Tue, 10 Dec 2024 05:13:19 -0800 Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2044.outbound.protection.outlook.com [104.47.73.44]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 43cwy1trsf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 05:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Awo+uhyzL2UBriDAPVvgTcbheryJq30xRQCKZ5bTQqopYr5X2+1jSRcYf0v+Q/VMRM6ufmtHJjH+DYy3xTAkT20v8BBvQaX3VdBpiTMs000bODGl4KJ9jaTF9OlbWQ5HrABNbxD3wLVNU4ltbsqSBWfqopUfW1Y4br1Xnw9pJG953aCfglVhfObuM2z/nR7taBaM4nOVRLNpYHS0Mgm3Zi4o+I8FbtcnxV9J5/1QrgPADlDu08GkLayOTVY4ZFT0Hx4YKMkvxqwKAGk/DxgSvFutjS7RH9VRrrK2/YTAnMeHc2nYPygCKbcJiTgqz2FHi4iIS/gxEGXwRUSuzECfQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HTxpvXARs7tysj4k3NZgJfmebVEZc6XAVLkEiIt3M4M=; b=WKjG79ynEI+3zj0R8lt5FlNvjodvepMQrehaxhmBvdCMBQ0oKdJfr4YZevn9BKCNASgy7wsGWDC1SC/a+dANC+3URbvDuyoGUhiFeHpoQnk1lZOF/WNQsmyTL6lnJBE+o9qaxZDbCOPhMCOgu4b14rFrA8J5hKaDHm0W7Q7RgYL4mrcAQvrwxRf0ElYsAYJpNYpgCgjLttExN7UhBtPEUmVckf3RWhJAQLSsAjQHG+M+LlG9WrOPV2FGtn+aJfYWzyYTDbpRHec4WEvJY2Hp5Qb9vGlrN8S9jIZO5xOmJbkFJ3HwnnQ5tdPS/XZs6Ml5ISZLqxys3EiyWiDIMrSj+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB6399.namprd11.prod.outlook.com (2603:10b6:8:c8::5) by PH0PR11MB7586.namprd11.prod.outlook.com (2603:10b6:510:26e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.14; Tue, 10 Dec 2024 13:13:16 +0000 Received: from DS0PR11MB6399.namprd11.prod.outlook.com ([fe80::2b44:787c:e7ee:bfad]) by DS0PR11MB6399.namprd11.prod.outlook.com ([fe80::2b44:787c:e7ee:bfad%7]) with mapi id 15.20.8207.017; Tue, 10 Dec 2024 13:13:16 +0000 From: Yi Zhao To: yocto-patches@lists.yoctoproject.org, joe@deserted.net, joe.macdonald@siemens.com Subject: [meta-selinux][PATCH 2/4] libselinux-python: fix build with swig 4.3 Date: Tue, 10 Dec 2024 21:12:54 +0800 Message-Id: <20241210131256.2393366-2-yi.zhao@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241210131256.2393366-1-yi.zhao@windriver.com> References: <20241210131256.2393366-1-yi.zhao@windriver.com> X-ClientProxiedBy: SGXP274CA0006.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::18) To DS0PR11MB6399.namprd11.prod.outlook.com (2603:10b6:8:c8::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB6399:EE_|PH0PR11MB7586:EE_ X-MS-Office365-Filtering-Correlation-Id: 41157cad-a31f-41ca-ee69-08dd191c68c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?4Jp918bJCZpo4H3vnuVCLiYk1YWSwoh?= =?utf-8?q?iE1lLECzbREAP9BLN3HIntWJQagy7Vi1x+CIwUoOW7x4fzrlgHRDZ0ET6HLrJW0bp?= =?utf-8?q?eigh4Pcxo/HWueCxAQ8Ry0VdVbjIvUz0uxybrFFvaYQYSd31tGkrgPmlwCYZ6Jw1K?= =?utf-8?q?treGnFKJz5Fx7ZCYXAs9zJFEWyFrjGJYqAmHWPvUV2sm9C3neir54Ilm1Js45sRt8?= =?utf-8?q?/Do0us/ntsjegKjUTM912h1eXtZ2H1cgitVIryxZBk09OIW3Brwr24F99AVMCXquK?= =?utf-8?q?3H2c+AmDQlMv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lBDGkpkwZSihL/d2dnOUE75TqUB4dypE2bAjepOEXIrQ?= =?utf-8?q?q1P0nYfrqgDMVYHHHxKthYCsDSFksd2ra1TFBdXShYkZ90nOwTTGtVInIlJ9PNcWV?= =?utf-8?q?CdfwJTfJ5ZFhJljEvqMiJKgzkBsTlxZ3JrTrYoVOiiHz9yd9AuptOkaOwC/fYOo94?= =?utf-8?q?68nDhhSFyoxCYdnLHMNWCvCPhmvRRQmUJxcxEnC4F4D+52qikZVWxnY=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB6399.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Z7bLCxBTtR0b8z/0mECUVBNOHLpt?= =?utf-8?q?sbJI2/Win0pxTGo4n3pLAU+LaCOPRMBKo+P4QVJgP5YOzP3XWe4WzS9vIa5Y+mnKJ?= =?utf-8?q?H7cmsM59eaxKr8OCsh4Z3bJG0GCQfdwW0i0dbnIi+rlUtZx6C0c90iLvWYrJu40nz?= =?utf-8?q?UruiC6nee36jyCNP9bgzLZ8U8CaUhZ2IuLvtJL6emqtnnVIftIsSHQzZQGLC3RfWq?= =?utf-8?q?sMFuvzEfGFOlozoHDz4l/YY0HRq9V5wmWzsMreknzSARIwln7g2ZWhNpyUtXlCAtZ?= =?utf-8?q?ifj7RxVLBHNzEZWsV0JLin49Ff4huMhidDGqZ96HJLS1ptMt+3LEmqEJBlOzWkGyR?= =?utf-8?q?t1Tsp2aCfkSlQnU9UZ8yuAciCUi71g8tXLUOkzjXn+vXQaQsTZtzuSELrsfBKy8SC?= =?utf-8?q?87EjB3gX+jaf2wVTF0b4nCwAIfQZpgEDoHnSp4S78xaDaFtYkEdxXjCQGwgQgKU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= =?utf-8?q?cSo25Mb1QtgT2bU6i84tOmXdfmRyVafSBmvWiwDv1q0iYuAAKxkbiHjNSSKE926Uw?= =?utf-8?q?yg1EiMFvAnASZ66FxI5tC3wO58+jdjzMGL+2xNQmSFikjVg5N1UQLkzE4SqBfVQDS?= =?utf-8?q?wr26xYl904F6C/kMKeWbDB+pJRMKlGj7PwpCkx15PH70ifzG0EVjH8TRGKombrk0t?= =?utf-8?q?Jbi0w1eOH7L7?= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41157cad-a31f-41ca-ee69-08dd191c68c5 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB6399.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2024 13:13:16.5903 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0N5btaf14xeKMVEWPyOYrirtlVDWaCYgq5NdOYhx3G71dGJpVaKxvgaobd+Cm3nUR0E6D7bL4KPtZO34CVz4vA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB7586 X-Proofpoint-ORIG-GUID: vjWVccRLyWUIRFFCHGGF6P1y4-txGH7Y X-Authority-Analysis: v=2.4 cv=eePHf6EH c=1 sm=1 tr=0 ts=67583e6e cx=c_pps a=coA4Samo6CBVwaisclppwQ==:117 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RZcAm9yDv7YA:10 a=bRTqI5nwn0kA:10 a=NEAV23lmAAAA:8 a=t7CeM3EgAAAA:8 a=20KFwNOVAAAA:8 a=pGLkceISAAAA:8 a=AWekD7wbPusstyTxx90A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: vjWVccRLyWUIRFFCHGGF6P1y4-txGH7Y X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-10_06,2024-12-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 phishscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.21.0-2411120000 definitions=main-2412100098 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0064b401.pphosted.com id 4BA6KQCp008981 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 10 Dec 2024 13:13:29 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/878 Backport a patch to fix build with swig 4.3[1]. [1] https://github.com/SELinuxProject/selinux/issues/447 Signed-off-by: Yi Zhao --- .../selinux/libselinux-python_3.7.bb | 1 + ...bselinux-fix-swig-bindings-for-4.3.0.patch | 91 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch diff --git a/recipes-security/selinux/libselinux-python_3.7.bb b/recipes-security/selinux/libselinux-python_3.7.bb index 3c5c489..5099e55 100644 --- a/recipes-security/selinux/libselinux-python_3.7.bb +++ b/recipes-security/selinux/libselinux-python_3.7.bb @@ -15,6 +15,7 @@ SRC_URI += "\ file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \ file://0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch \ file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ + file://0001-libselinux-fix-swig-bindings-for-4.3.0.patch \ " S = "${WORKDIR}/git/libselinux" diff --git a/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch b/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch new file mode 100644 index 0000000..277c36c --- /dev/null +++ b/recipes-security/selinux/libselinux/0001-libselinux-fix-swig-bindings-for-4.3.0.patch @@ -0,0 +1,91 @@ +From 8e0e718bae53fff30831b92cd784151d475a20da Mon Sep 17 00:00:00 2001 +From: Petr Lautrbach +Date: Wed, 16 Oct 2024 20:48:11 +0200 +Subject: [PATCH] libselinux: fix swig bindings for 4.3.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +https://github.com/swig/swig/blob/master/CHANGES.current + +"[Python] #2907 Fix returning null from functions with output +parameters. Ensures OUTPUT and INOUT typemaps are handled +consistently wrt return type. + +New declaration of SWIG_Python_AppendOutput is now: + + SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void); + +The 3rd parameter is new and the new $isvoid special variable +should be passed to it, indicating whether or not the wrapped +function returns void. + +Also consider replacing with: + + SWIG_AppendOutput(PyObject* result, PyObject* obj); + +which calls SWIG_Python_AppendOutput with same parameters but adding $isvoid +for final parameter." + +Fixes: https://github.com/SELinuxProject/selinux/issues/447 + + selinuxswig_python_wrap.c: In function ‘_wrap_security_compute_user’: + selinuxswig_python_wrap.c:11499:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ + 11499 | resultobj = SWIG_Python_AppendOutput(resultobj, plist); + | ^~~~~~~~~~~~~~~~~~~~~~~~ + selinuxswig_python_wrap.c:1248:1: note: declared here + 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) { + | ^~~~~~~~~~~~~~~~~~~~~~~~ + selinuxswig_python_wrap.c: In function ‘_wrap_security_compute_user_raw’: + selinuxswig_python_wrap.c:11570:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ + 11570 | resultobj = SWIG_Python_AppendOutput(resultobj, plist); + | ^~~~~~~~~~~~~~~~~~~~~~~~ + selinuxswig_python_wrap.c:1248:1: note: declared here + 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) { + | ^~~~~~~~~~~~~~~~~~~~~~~~ + selinuxswig_python_wrap.c: In function ‘_wrap_security_get_boolean_names’: + selinuxswig_python_wrap.c:12470:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ + 12470 | resultobj = SWIG_Python_AppendOutput(resultobj, list); + | ^~~~~~~~~~~~~~~~~~~~~~~~ + selinuxswig_python_wrap.c:1248:1: note: declared here + 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void) { + | ^~~~~~~~~~~~~~~~~~~~~~~~ + error: command '/usr/bin/gcc' failed with exit code 1 + +Suggested-by: Jitka Plesnikova +Signed-off-by: Petr Lautrbach +Acked-by: James Carter + +Upstream-Status: Backport +[https://github.com/SELinuxProject/selinux/commit/8e0e718bae53fff30831b92cd784151d475a20da] + +Signed-off-by: Yi Zhao +--- + src/selinuxswig_python.i | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/selinuxswig_python.i b/src/selinuxswig_python.i +index 17e03b9e..03ed296d 100644 +--- a/src/selinuxswig_python.i ++++ b/src/selinuxswig_python.i +@@ -71,7 +71,7 @@ def install(src, dest): + for (i = 0; i < *$2; i++) { + PyList_SetItem(list, i, PyString_FromString((*$1)[i])); + } +- $result = SWIG_Python_AppendOutput($result, list); ++ $result = SWIG_AppendOutput($result, list); + } + + /* return a sid along with the result */ +@@ -108,7 +108,7 @@ def install(src, dest): + plist = PyList_New(0); + } + +- $result = SWIG_Python_AppendOutput($result, plist); ++ $result = SWIG_AppendOutput($result, plist); + } + + /* Makes functions in get_context_list.h return a Python list of contexts */ +-- +2.25.1 +