From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 8 08:50:24 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6528516A4BF for ; Mon, 8 Sep 2003 08:50:24 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8585243FE0 for ; Mon, 8 Sep 2003 08:50:22 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h88FoMUp083771 for ; Mon, 8 Sep 2003 08:50:22 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h88FoMGr083770; Mon, 8 Sep 2003 08:50:22 -0700 (PDT) Resent-Date: Mon, 8 Sep 2003 08:50:22 -0700 (PDT) Resent-Message-Id: <200309081550.h88FoMGr083770@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "KONDOU, Kazuhiro" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3071F16A4E9; Mon, 8 Sep 2003 08:45:48 -0700 (PDT) Received: from reah.alib.jp (kita142132.kitanet.ne.jp [219.112.142.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id C461043FE3; Mon, 8 Sep 2003 08:45:46 -0700 (PDT) (envelope-from kazuhiro@alib.jp) Received: from feena.alib.jp ([IPv6:2001:2c0:40e:2002:2a0:b0ff:fe42:147a]) (authenticated bits=0) by reah.alib.jp (8.12.9/8.12.3) with ESMTP id h88FjhiA056553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Sep 2003 00:45:43 +0900 (JST) (envelope-from kazuhiro@alib.jp) Message-Id: <20030909004529.4064acc7.kazuhiro@alib.jp> Date: Tue, 9 Sep 2003 00:45:29 +0900 From: "KONDOU, Kazuhiro" To: FreeBSD-gnats-submit@FreeBSD.org cc: "KONDOU, Kazuhiro" cc: rwatson@FreeBSD.org Subject: bin/56595: sys/mac.h, sys/mac_policy.h cannot be used as is in C++ X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "KONDOU, Kazuhiro" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2003 15:50:24 -0000 >Number: 56595 >Category: bin >Synopsis: sys/mac.h, sys/mac_policy.h cannot be used as is in C++ >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Sep 08 08:50:21 PDT 2003 >Closed-Date: >Last-Modified: >Originator: "KONDOU, Kazuhiro" >Release: FreeBSD 5.1-CURRENT i386 >Organization: >Environment: System: FreeBSD lilia.alib.jp 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Sat Sep 6 14:08:48 JST 2003 root@:/usr/obj/usr/src/sys/REAH i386 >Description: sys/mac.h and sys/mac_policy.h cannot be used as is in C++ code. because function prototypes doesn't exist between __BEGIN_DECLS and __END_DECLS. >How-To-Repeat: #include or #include in C++ code. >Fix: apply following patch. diff -urdN old/mac.h new/mac.h --- old/mac.h Tue Sep 9 00:16:24 2003 +++ new/mac.h Tue Sep 9 00:39:23 2003 @@ -76,6 +76,7 @@ * Extended non-POSIX.1e interfaces that offer additional services * available from the userland and kernel MAC frameworks. */ +__BEGIN_DECLS int mac_execve(char *fname, char **argv, char **envv, mac_t _label); int mac_free(mac_t _label); @@ -97,6 +98,7 @@ int mac_set_proc(const mac_t _label); int mac_syscall(const char *_policyname, int _call, void *_arg); int mac_to_text(mac_t mac, char **_text); +__END_DECLS #else /* _KERNEL */ diff -urdN old/mac_policy.h new/mac_policy.h --- old/mac_policy.h Tue Sep 9 00:16:35 2003 +++ new/mac_policy.h Tue Sep 9 00:21:44 2003 @@ -471,7 +471,9 @@ DECLARE_MODULE(mpname, mpname##_mod, SI_SUB_MAC_POLICY, \ SI_ORDER_MIDDLE) +__BEGIN_DECLS int mac_policy_modevent(module_t mod, int type, void *data); +__END_DECLS #define LABEL_TO_SLOT(l, s) (l)->l_perpolicy[s] >Release-Note: >Audit-Trail: >Unformatted: