From patchwork Thu Jul 2 08:57:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Vu-Brugier X-Patchwork-Id: 11638323 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A949C14E3 for ; Thu, 2 Jul 2020 08:57:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CEA520772 for ; Thu, 2 Jul 2020 08:57:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.fm header.i=@fastmail.fm header.b="I7PeIG6t"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OCwgZu/L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727943AbgGBI5e (ORCPT ); Thu, 2 Jul 2020 04:57:34 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:59289 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbgGBI5d (ORCPT ); Thu, 2 Jul 2020 04:57:33 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id EFB43B07; Thu, 2 Jul 2020 04:57:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 02 Jul 2020 04:57:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=+YsZcxp1ZA3rS j+KzNAvYd6Z7hnmqDO2gpNUhusH8P0=; b=I7PeIG6teugzQDBAT1BPN8XDmccDz ttHVyWfjyjdPlOuxAt5oGHnYwgoo1Dlv7MYrvfOXmQqRuhsptef+fEFTNF9Njxm3 /3C+y5vGPoGLwIK5KUDl/AHU+Y/cMWQCVA2MRfCaGQ6vrpsEji9I2NWmtIl/Yy0o 1tuX/WRumR0uFmVS9TNbplCDtvfZiiJvIQl8/3ZzfZWyG4D+ybez1BYPwgriG7DY mup+QVSWibjCsc1dYuOtgcCCJDtz6xDTdMNxoSkXTdl2QIyObhauUjcfCUpurTur LiCTVr/ejSW8+Ayc2G9WGoIY9GeBVO5mkoyQ4GtW4ZIVFq70RyF1HeYoA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=+YsZcxp1ZA3rSj+KzNAvYd6Z7hnmqDO2gpNUhusH8P0=; b=OCwgZu/L wsTLPropSgnetjkH5QgxkjgoeuAY7fsRcV/cz/BZ/7R7PiLivHSCoDKQRYgiVKWV RKjCc2KGCjY+Wh34cS1S6nkDfdkWoL0mz4u60VpINTRaI5SF0epuZLrT/3ipOPp2 p9GODkxcbbwAl1rs9mwL/e0UXeqNEV9rREH/GIlGjYWDZHhvNGA+OD+WbnglU3Nx i/Ln7SJrdG9JBg4kZa079vbjE70Nsl2WBXSvWt2QWkkGF5WitD/PrVreveDcW+ol OpYOMRRsTsTMZKwFF+0GQku44aZpxghh3J913dvn5mYqV+9iLTWBE1I+zaj9mPLz fyZBiFHQJlmHzQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtdeggddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvehhrhhishht ohhphhgvucgguhdquehruhhgihgvrhcuoegtvhhusghruhhgihgvrhesfhgrshhtmhgrih hlrdhfmheqnecuggftrfgrthhtvghrnhepkeejteetgfeitedvkeduveduuddvvdeuteel hfeiveffheduhfevuedtvefgkeffnecukfhppeekiedrvdegjedrudeiuddrvddvieenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegtvhhusghr uhhgihgvrhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Received: from rakis.home (lfbn-idf2-1-711-226.w86-247.abo.wanadoo.fr [86.247.161.226]) by mail.messagingengine.com (Postfix) with ESMTPA id E1377306005C; Thu, 2 Jul 2020 04:57:31 -0400 (EDT) From: Christophe Vu-Brugier To: keyrings@vger.kernel.org Cc: David Howells , =?utf-8?q?Stephan_M=C3=BCller?= , Christophe Vu-Brugier Subject: [PATCH 1/4] man: fix typos Date: Thu, 2 Jul 2020 10:57:20 +0200 Message-Id: <20200702085723.7026-2-cvubrugier@fastmail.fm> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200702085723.7026-1-cvubrugier@fastmail.fm> References: <20200702085723.7026-1-cvubrugier@fastmail.fm> MIME-Version: 1.0 Sender: keyrings-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org Signed-off-by: Christophe Vu-Brugier --- man/keyctl.3 | 4 ++-- man/keyctl_capabilities.3 | 2 +- man/keyctl_chown.3 | 2 +- man/keyctl_clear.3 | 3 +-- man/keyctl_link.3 | 3 +-- man/keyctl_move.3 | 3 +-- man/keyctl_read.3 | 3 +-- man/keyctl_revoke.3 | 2 +- man/keyctl_set_timeout.3 | 2 +- man/keyctl_setperm.3 | 2 +- man/keyctl_update.3 | 2 +- 11 files changed, 12 insertions(+), 16 deletions(-) diff --git a/man/keyctl.3 b/man/keyctl.3 index b0f5fdc..cb0449c 100644 --- a/man/keyctl.3 +++ b/man/keyctl.3 @@ -71,9 +71,9 @@ and then telling the linker it should link in the library: .br .BR keyctl_negate (3) .br -.BR keyctl_pkey_dec (3) +.BR keyctl_pkey_decrypt (3) .br -.BR keyctl_pkey_enc (3) +.BR keyctl_pkey_encrypt (3) .br .BR keyctl_pkey_query (3) .br diff --git a/man/keyctl_capabilities.3 b/man/keyctl_capabilities.3 index 63cee3c..f816df6 100644 --- a/man/keyctl_capabilities.3 +++ b/man/keyctl_capabilities.3 @@ -29,7 +29,7 @@ of the amount of buffer space available. If the buffer is shorter than the data, a short copy will be made; if the buffer is larger than the data, the excess space will be cleared. .P -If this operation is not available in the kernel, the keyutils library will be +If this operation is not available in the kernel, the keyutils library will emulate it as best it can and the capability bit that indicates if the kernel operation is available will be cleared. .P diff --git a/man/keyctl_chown.3 b/man/keyctl_chown.3 index 286bded..f85840a 100644 --- a/man/keyctl_chown.3 +++ b/man/keyctl_chown.3 @@ -37,7 +37,7 @@ does not match the process's GID or one of its group list. .P The caller must have .B setattr -permission on a key to be able change its ownership. +permission on a key to be able to change its ownership. .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .SH RETURN VALUE On success diff --git a/man/keyctl_clear.3 b/man/keyctl_clear.3 index 21e0c26..8da699e 100644 --- a/man/keyctl_clear.3 +++ b/man/keyctl_clear.3 @@ -25,7 +25,7 @@ clears the contents of a .P The caller must have .B write -permission on a keyring to be able clear it. +permission on a keyring to be able to clear it. .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .SH RETURN VALUE On success @@ -71,4 +71,3 @@ should be specified to the linker. .BR keyctl (3), .BR keyrings (7), .BR keyutils (7) - diff --git a/man/keyctl_link.3 b/man/keyctl_link.3 index 1185874..2cbc104 100644 --- a/man/keyctl_link.3 +++ b/man/keyctl_link.3 @@ -38,7 +38,7 @@ if it exists. .P The caller must have .B write -permission on a keyring to be able create or remove links in it. +permission on a keyring to be able to create or remove links in it. .P The caller must have .B link @@ -105,4 +105,3 @@ should be specified to the linker. .BR keyctl (3), .BR keyrings (7), .BR keyutils (7) - diff --git a/man/keyctl_move.3 b/man/keyctl_move.3 index b241f70..6f144df 100644 --- a/man/keyctl_move.3 +++ b/man/keyctl_move.3 @@ -41,7 +41,7 @@ an error. .P The caller must have .B write -permission on both keyring to be able create or remove links in them. +permission on both keyring to be able to create or remove links in them. .P The caller must have .B link @@ -106,4 +106,3 @@ should be specified to the linker. .BR keyctl (3), .BR keyrings (7), .BR keyutils (7) - diff --git a/man/keyctl_read.3 b/man/keyctl_read.3 index 852bc05..97b0e24 100644 --- a/man/keyctl_read.3 +++ b/man/keyctl_read.3 @@ -16,8 +16,7 @@ keyctl_read \- read a key .nf .B #include .sp -.BI "long keyctl_read(key_serial_t " key ", char *" buffer , -.BI "size_t" buflen ");" +.BI "long keyctl_read(key_serial_t " key ", char *" buffer ", size_t " buflen ");" .sp .BI "long keyctl_read_alloc(key_serial_t " key ", void **" _buffer ");" .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/man/keyctl_revoke.3 b/man/keyctl_revoke.3 index 914a253..622f1ac 100644 --- a/man/keyctl_revoke.3 +++ b/man/keyctl_revoke.3 @@ -28,7 +28,7 @@ meet with error .P The caller must have .B write -permission on a key to be able revoke it. +permission on a key to be able to revoke it. .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .SH RETURN VALUE On success diff --git a/man/keyctl_set_timeout.3 b/man/keyctl_set_timeout.3 index 1b7ec94..24c7049 100644 --- a/man/keyctl_set_timeout.3 +++ b/man/keyctl_set_timeout.3 @@ -33,7 +33,7 @@ When the key expires, further attempts to access it will be met with error .P The caller must have .B setattr -permission on a key to be able change its permissions mask. +permission on a key to be able to change its permissions mask. .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .SH RETURN VALUE On success diff --git a/man/keyctl_setperm.3 b/man/keyctl_setperm.3 index 0a4426d..d5d9015 100644 --- a/man/keyctl_setperm.3 +++ b/man/keyctl_setperm.3 @@ -29,7 +29,7 @@ same UID as the caller. .P The caller must have .B setattr -permission on a key to be able change its permissions mask. +permission on a key to be able to change its permissions mask. .P The permissions mask is a bitwise-OR of the following flags: .TP diff --git a/man/keyctl_update.3 b/man/keyctl_update.3 index 17fbdb4..2d44740 100644 --- a/man/keyctl_update.3 +++ b/man/keyctl_update.3 @@ -25,7 +25,7 @@ updates the payload of a key if the key type permits it. .P The caller must have .B write -permission on a key to be able update it. +permission on a key to be able to update it. .P .I payload and From patchwork Thu Jul 2 08:57:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Vu-Brugier X-Patchwork-Id: 11638325 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFA41618 for ; Thu, 2 Jul 2020 08:57:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D845420772 for ; Thu, 2 Jul 2020 08:57:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.fm header.i=@fastmail.fm header.b="Sml+VwRt"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Zm0VclJY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbgGBI5e (ORCPT ); Thu, 2 Jul 2020 04:57:34 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:44503 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgGBI5e (ORCPT ); Thu, 2 Jul 2020 04:57:34 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 9F76FB20; Thu, 2 Jul 2020 04:57:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 02 Jul 2020 04:57:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=Mh41nAClzHVkl S4k2i9J+7PH4YVTDDwaaoXIQg8eo7I=; b=Sml+VwRtzOotmhw+nLhRELNKqxfYQ iFiOpeR//kJzRHo2BFMSwr+fGcHAnkon+7pUpYxqsYtnDI8zA7H1jtPe8wTnMN3B wrW9euy2eLiFF8ttlFz58muv7ocBGHlvx9VkCB9wxzZqbC8d8ajbGQ5usSNOIQOl tAUfManjGx6OjazTuCwLZLATm0rvrkkX/+CbBFs4EpXmaEy2bY4ruVukTBH7cVAN fqbsik9kFC4hlT4dmRNTjHSc/fwu3mcyk2hYjrcbFjwBfP1RS94sOK0hW11Nv6cr 5nXGs6p9plNXxP7pIlq+RYsM7jQNJ7f2cnCXfDnfDopluZtkq4DIXHRsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Mh41nAClzHVklS4k2i9J+7PH4YVTDDwaaoXIQg8eo7I=; b=Zm0VclJY Lphr8u9oG+HPD4NvoNTEfXpQIAQ0XmkeyMx2pA1Ze4SnbpBeULauTbm3Us2Ma2hr jH1fuqamdv2fPKa364EPdrw8nXjz0DUNo+dP3Pbl6+BicMEeCI+NfSg3+Nl8rAmj CJ+7Oztbn0kWi3wGjbkbIMrgad/cdU/R3lrndnD/el5nJriVWBw2xVLNVYuF32jb QU+pNCT4eSrecdjEz8BrAsvNmoFXOut7Q5t60ojeWBPESi92YVLgtbs4RlNLSiFQ q6EPYBne2d1D4g3wSNOEj7vvE+c+VidAwkXvIg/WTtBc52klbhgLQtphf+TIpPfZ qt77fq1AAxRX4A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtdeggddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvehhrhhishht ohhphhgvucgguhdquehruhhgihgvrhcuoegtvhhusghruhhgihgvrhesfhgrshhtmhgrih hlrdhfmheqnecuggftrfgrthhtvghrnhepkeejteetgfeitedvkeduveduuddvvdeuteel hfeiveffheduhfevuedtvefgkeffnecukfhppeekiedrvdegjedrudeiuddrvddvieenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegtvhhusghr uhhgihgvrhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Received: from rakis.home (lfbn-idf2-1-711-226.w86-247.abo.wanadoo.fr [86.247.161.226]) by mail.messagingengine.com (Postfix) with ESMTPA id 931D33060076; Thu, 2 Jul 2020 04:57:32 -0400 (EDT) From: Christophe Vu-Brugier To: keyrings@vger.kernel.org Cc: David Howells , =?utf-8?q?Stephan_M=C3=BCller?= , Christophe Vu-Brugier Subject: [PATCH 2/4] Fix compilation error when keyutils.h is used in C++ Date: Thu, 2 Jul 2020 10:57:21 +0200 Message-Id: <20200702085723.7026-3-cvubrugier@fastmail.fm> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200702085723.7026-1-cvubrugier@fastmail.fm> References: <20200702085723.7026-1-cvubrugier@fastmail.fm> MIME-Version: 1.0 Sender: keyrings-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org The declaration of the keyctl_dh_compute_kdf() function contains a parameter named "private". Unfortunately, "private" is a C++ reserved keyword. As a consequence, compiling a C++ program that includes keyutils.h fails. This patch renames the "private" variable to "priv" since a similar parameter is named this way in the nearby keyctl_dh_compute() function. Signed-off-by: Christophe Vu-Brugier --- keyutils.c | 4 ++-- keyutils.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyutils.c b/keyutils.c index 9c37256..9877fdb 100644 --- a/keyutils.c +++ b/keyutils.c @@ -244,11 +244,11 @@ long keyctl_dh_compute(key_serial_t priv, key_serial_t prime, return keyctl(KEYCTL_DH_COMPUTE, ¶ms, buffer, buflen, 0); } -long keyctl_dh_compute_kdf(key_serial_t private, key_serial_t prime, +long keyctl_dh_compute_kdf(key_serial_t priv, key_serial_t prime, key_serial_t base, char *hashname, char *otherinfo, size_t otherinfolen, char *buffer, size_t buflen) { - struct keyctl_dh_params params = { .priv = private, + struct keyctl_dh_params params = { .priv = priv, .prime = prime, .base = base }; struct keyctl_kdf_params kdfparams = { .hashname = hashname, diff --git a/keyutils.h b/keyutils.h index d50119e..bdecf15 100644 --- a/keyutils.h +++ b/keyutils.h @@ -220,7 +220,7 @@ extern long keyctl_invalidate(key_serial_t id); extern long keyctl_get_persistent(uid_t uid, key_serial_t id); extern long keyctl_dh_compute(key_serial_t priv, key_serial_t prime, key_serial_t base, char *buffer, size_t buflen); -extern long keyctl_dh_compute_kdf(key_serial_t private, key_serial_t prime, +extern long keyctl_dh_compute_kdf(key_serial_t priv, key_serial_t prime, key_serial_t base, char *hashname, char *otherinfo, size_t otherinfolen, char *buffer, size_t buflen); From patchwork Thu Jul 2 08:57:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Vu-Brugier X-Patchwork-Id: 11638327 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5EF9618 for ; Thu, 2 Jul 2020 08:57:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE6E120772 for ; Thu, 2 Jul 2020 08:57:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.fm header.i=@fastmail.fm header.b="EDJ86qGe"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NL86Av/I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728043AbgGBI5f (ORCPT ); Thu, 2 Jul 2020 04:57:35 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:56429 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgGBI5f (ORCPT ); Thu, 2 Jul 2020 04:57:35 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 4D834B31; Thu, 2 Jul 2020 04:57:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 02 Jul 2020 04:57:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=47rOrkr64p6EL fWCyoyqqH7kZXEHBBa+RTVzkNJ7LI8=; b=EDJ86qGeTnSPZWCS3LZyvMJrO4f07 OetLqAQdRAi6vav7AjYlSX5YzTPdyp8MUQg7OAR4taYfTFwoFZ6tuRfE4pRtLcJX nPieMWZykhEFT2cY9WR5Zee/+xdnfLjjeVwEBBRheNMfkBe4S7jYQwKV4Xm1pHWm bYNNxw/Jtg81mvo+D1Lw1B5fKq9ic1RXPDSGLtkXehmtFnvYe1eRs9ttZyww3yVs zCdxntoY62gGnl+wNSEeB57AKP5GxqI0HhybWW4ViPXU4PJcOcwZ9mr+gPJzJQ32 oSDUCMDCZOjfihmNfc9oxp8Iel9ctvDI9uORMbFNVkHp/XZWOBuyUg9Wg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=47rOrkr64p6ELfWCyoyqqH7kZXEHBBa+RTVzkNJ7LI8=; b=NL86Av/I YSCkBV2iwluI9aNnHGJ+nXTU0mHj4hZsn4IBLQ0FHEUHHvWLu6YqyLRlY5wQn5kK yUAyPWyxcGycaKJZm/jzQWHaIOFEkIr2hdAgs62f/EmelXL6zrE8+n5hAXuCx3Z4 Du2nIBjLlQmBIfanBnTdsEQ+eiUKmrwc2J0MH3ns7GFTvhrkxeJ36wFe3wdeDvl3 KjzFoh70yrJd6wgpfWQPgnZp3C0J65IKuwlg7fqDx+N86YbxokXALaO51WJHctXD qTPGObu7Pmvop3tJFvcGrxW2Iun/egOi1Br4GHgGHb4qFcGx7LIlfpKddZTxWEOP I6+7CJ8v6twqOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtdeggddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvehhrhhishht ohhphhgvucgguhdquehruhhgihgvrhcuoegtvhhusghruhhgihgvrhesfhgrshhtmhgrih hlrdhfmheqnecuggftrfgrthhtvghrnhepkeejteetgfeitedvkeduveduuddvvdeuteel hfeiveffheduhfevuedtvefgkeffnecukfhppeekiedrvdegjedrudeiuddrvddvieenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegtvhhusghr uhhgihgvrhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Received: from rakis.home (lfbn-idf2-1-711-226.w86-247.abo.wanadoo.fr [86.247.161.226]) by mail.messagingengine.com (Postfix) with ESMTPA id 4531F306006C; Thu, 2 Jul 2020 04:57:33 -0400 (EDT) From: Christophe Vu-Brugier To: keyrings@vger.kernel.org Cc: David Howells , =?utf-8?q?Stephan_M=C3=BCller?= , Christophe Vu-Brugier Subject: [PATCH 3/4] Check that keyutils.h has valid C++ syntax at build time Date: Thu, 2 Jul 2020 10:57:22 +0200 Message-Id: <20200702085723.7026-4-cvubrugier@fastmail.fm> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200702085723.7026-1-cvubrugier@fastmail.fm> References: <20200702085723.7026-1-cvubrugier@fastmail.fm> MIME-Version: 1.0 Sender: keyrings-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org Signed-off-by: Christophe Vu-Brugier --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6f79446..949ad7c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CPPFLAGS := -I. CFLAGS := -g -Wall -Werror +CXXFLAGS := -g -Wall -Werror INSTALL := install DESTDIR := SPECFILE := keyutils.spec @@ -99,7 +100,7 @@ endif # Normal build rule # ############################################################################### -all: keyctl request-key key.dns_resolver +all: keyctl request-key key.dns_resolver cxx ############################################################################### # @@ -163,6 +164,18 @@ key.dns_resolver: key.dns_resolver.o dns.afsdb.o $(LIB_DEPENDENCY) key.dns_resolver.o: key.dns_resolver.c key.dns.h dns.afsdb.o: dns.afsdb.c key.dns.h +############################################################################### +# +# Check that the header file has valid C++ syntax +# +############################################################################### +cxx.stamp: keyutils.h Makefile + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -x c++-header -fsyntax-only $< + touch $@ + +cxx: cxx.stamp +.PHONY: cxx + ############################################################################### # # Install everything @@ -244,6 +257,7 @@ clean: $(RM) keyctl request-key key.dns_resolver $(RM) *.o *.os *~ $(RM) debugfiles.list debugsources.list + $(RM) cxx.stamp distclean: clean $(RM) -r rpmbuild $(TARBALL) From patchwork Thu Jul 2 08:57:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Vu-Brugier X-Patchwork-Id: 11638329 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 939FC13BD for ; Thu, 2 Jul 2020 08:57:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C56220772 for ; Thu, 2 Jul 2020 08:57:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.fm header.i=@fastmail.fm header.b="k0V8XCvR"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="L65gAjn7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726362AbgGBI5g (ORCPT ); Thu, 2 Jul 2020 04:57:36 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:44503 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbgGBI5f (ORCPT ); Thu, 2 Jul 2020 04:57:35 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E52A3A00; Thu, 2 Jul 2020 04:57:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 02 Jul 2020 04:57:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=nGPU66UAkhcTc RctQDVtC/KEDsFxt43B2g6dUlMAEyM=; b=k0V8XCvRnlVRw+DDbJIkKxNaQj7dF GJ4U8/Uheg7178AC+Vg6A2fP67HQ1KM7Atk9jSmFszHOCC2W62clrznZg2mbB1E8 4rTiKHgBRJ7zLbDXvUV2lLwuMDBbAwF7KcluNcN8NfPudut+xx9B0z8VZCwF3eHN O/jQOXUcodPQGXUz6YnvTePCCS9U0th0SeBvMEwQPBWAAftCJiPWoZXou3xL5hP7 DPXA/fvIjniNLSbJYrYQ7hfScz8KGKzgbzgvLIdfPWUxq5o0xnRA2RjW8NDJZr9x szAMx/cI0HlVZDgM1Wpn0fclHLT+HrkI1pe2DtCipzPN42Zepx3FqbJsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=nGPU66UAkhcTcRctQDVtC/KEDsFxt43B2g6dUlMAEyM=; b=L65gAjn7 7XMCfcTDUOo0xxCgvRQV/lB4J15OQWiFYlhEMBvIQgIMIIDYH2UHYA6NNisdR+dE 2v8oHvrCcuGH+cwOh/508UCkgHZnOv2OAz9WP4Tot9B0yM1BTgLny1JCSEu//5t7 xvZ7+EyKZOs4zfUsV3AeloxCGFWpMRFmMg56pu9+9y0BwUFLRW5/G87X/9t3QCEu abXFUMzS0ueDPQG9pa2r5rkLrOKqcU/pzD2TlI4gkpnPVIXyzQvvMXMSvrVbAh68 jHw2hW2Wq404hbnXN27pFWzxSK9lg9+Wx48vRsYARnszY/vjpXuEh1y1lmCMzpaz +B/Na7BTBHU8LA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtdeggddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvehhrhhishht ohhphhgvucgguhdquehruhhgihgvrhcuoegtvhhusghruhhgihgvrhesfhgrshhtmhgrih hlrdhfmheqnecuggftrfgrthhtvghrnhepkeejteetgfeitedvkeduveduuddvvdeuteel hfeiveffheduhfevuedtvefgkeffnecukfhppeekiedrvdegjedrudeiuddrvddvieenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegtvhhusghr uhhgihgvrhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Received: from rakis.home (lfbn-idf2-1-711-226.w86-247.abo.wanadoo.fr [86.247.161.226]) by mail.messagingengine.com (Postfix) with ESMTPA id EAF98306005C; Thu, 2 Jul 2020 04:57:33 -0400 (EDT) From: Christophe Vu-Brugier To: keyrings@vger.kernel.org Cc: David Howells , =?utf-8?q?Stephan_M=C3=BCller?= , Christophe Vu-Brugier Subject: [PATCH 4/4] Fix error when a C++ program is linked with libkeyutils Date: Thu, 2 Jul 2020 10:57:23 +0200 Message-Id: <20200702085723.7026-5-cvubrugier@fastmail.fm> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200702085723.7026-1-cvubrugier@fastmail.fm> References: <20200702085723.7026-1-cvubrugier@fastmail.fm> MIME-Version: 1.0 Sender: keyrings-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org Declare all the functions as extern "C" in keyutils.h to instruct a C++ compiler that these functions are not mangled. Signed-off-by: Christophe Vu-Brugier --- keyutils.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/keyutils.h b/keyutils.h index bdecf15..4ae81d3 100644 --- a/keyutils.h +++ b/keyutils.h @@ -15,6 +15,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + extern const char keyutils_version_string[]; extern const char keyutils_build_string[]; @@ -268,4 +272,8 @@ extern int recursive_session_key_scan(recursive_key_scanner_t func, void *data); extern key_serial_t find_key_by_type_and_desc(const char *type, const char *desc, key_serial_t destringid); +#ifdef __cplusplus +} +#endif + #endif /* KEYUTILS_H */