From patchwork Thu Aug 4 18:33:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Zaman X-Patchwork-Id: 9264055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6AFB36048B for ; Thu, 4 Aug 2016 18:38:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E9DF2841C for ; Thu, 4 Aug 2016 18:38:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 515D1283E4; Thu, 4 Aug 2016 18:38:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (smtp.nsa.gov [8.44.101.8]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB421283E4 for ; Thu, 4 Aug 2016 18:38:23 +0000 (UTC) Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 04 Aug 2016 18:38:22 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u74IcKi5011864; Thu, 4 Aug 2016 14:38:21 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u74IYTmc250306 for ; Thu, 4 Aug 2016 14:34:29 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u74IYMKX011354 for ; Thu, 4 Aug 2016 14:34:31 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1BgAQBGiqNXdMLAVdFcHQGCeoF/txCEDIYdAoFITAEBAQEBARMBCgsUF4UQAgEDEi4BATcBD0ARNAEFARw7iA8BoRSBMj4xilSFKgEBBYtFAQEBAQEFAgEcCBCCFYF6i2SBfQuDB48QiimPBGWIX4V6jmkwgQ+CWYICYQGHKgEBAQ X-IPAS-Result: A1BgAQBGiqNXdMLAVdFcHQGCeoF/txCEDIYdAoFITAEBAQEBARMBCgsUF4UQAgEDEi4BATcBD0ARNAEFARw7iA8BoRSBMj4xilSFKgEBBYtFAQEBAQEFAgEcCBCCFYF6i2SBfQuDB48QiimPBGWIX4V6jmkwgQ+CWYICYQGHKgEBAQ X-IronPort-AV: E=Sophos;i="5.28,471,1464667200"; d="scan'208";a="5626385" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 04 Aug 2016 14:35:19 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/AES128-GCM-SHA256; 04 Aug 2016 18:34:31 +0000 Received: by mail-pf0-f194.google.com with SMTP id h186so18641365pfg.2 for ; Thu, 04 Aug 2016 11:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perfinion-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WVnWNhabjCewkvKthG4K6FIDg1k3hqId39pof1ZeuzU=; b=RDzTlZzlvlYCTNTO9C+A2I9OUwJyYAYZc/y0FZnulzHZoWe2EkFtD1e7trPXin0WnD h98C2gZ512jn/VIXyxV2lpqFZm92xu3U7JTQLS7viFs6QzABfM93lUEO+i3yezcWDp8v k/XtlNPAhDOu64G8AqiTxcbYPbXMH+ezlf2Kyl20ThCZzHMAk7BfB3paoLTtZl1+rk/k MUhaSKJsvEs8xX+rGKaekyei8SBCUTtN6vB/A1OkFc2mp70U7BuPT9f+R0tTKmu80oZA 88MD+a2HeHtd5NznsYywgP9VMUpCXQbXeSMX4IwOQnBXmnfOurfjFHsTwhq/gt+ZTDnO GYdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WVnWNhabjCewkvKthG4K6FIDg1k3hqId39pof1ZeuzU=; b=c2hZbszNfa/4qjCryiJKtpyeYszneP49VZ4OkSaC+5ub5vSkaz9En4ZTDGiufiP61r GxumkSSvjSsUApJlHhz9vaqjYi7sQF9d79bkw5Q9HHMNcxr/tRBYu6HJGty/eLNvpihM hONxhT5UbOJMY708CjFZyf4VwfYj8rwHbqK3w/AhMWaXJkbHNVexhu24mCKSHUAToKDi EtfL8PoZP3nM7crAVcWkcteNbNidW/cOkiHfZ0qLmyH8Mvj81T1GDcaVk2QYbCTfIkBr B0U6MVUNHj63OiR4hv56cXauaczc2uuGoyl7PUucraNneIbQqk+JWW3rVoLAwRD05b/u aDLg== X-Gm-Message-State: AEkoouv/vIpx2SaODOVHz1ObRSsuM0uOT/6+2BR9cyGJGS9rEi52zrSoTXWtHr7S2MeTCw== X-Received: by 10.98.29.201 with SMTP id d192mr128591268pfd.142.1470335670185; Thu, 04 Aug 2016 11:34:30 -0700 (PDT) Received: from localhost ([2404:e800:e600:57b:dcfa:b5a4:c9d2:f744]) by smtp.gmail.com with ESMTPSA id q1sm22061885pfd.48.2016.08.04.11.34.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Aug 2016 11:34:29 -0700 (PDT) From: Jason Zaman To: selinux@tycho.nsa.gov Subject: [PATCH 04/12] sepolicy: Add python3 PyInt and PyString defs Date: Fri, 5 Aug 2016 02:33:57 +0800 Message-Id: <1470335645-24224-5-git-send-email-jason@perfinion.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1470335645-24224-1-git-send-email-jason@perfinion.com> References: <1470335645-24224-1-git-send-email-jason@perfinion.com> X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP --- policycoreutils/sepolicy/common.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/policycoreutils/sepolicy/common.h b/policycoreutils/sepolicy/common.h index dc3ce6a..e453def 100644 --- a/policycoreutils/sepolicy/common.h +++ b/policycoreutils/sepolicy/common.h @@ -11,6 +11,25 @@ #define py_decref(x) { if (x) Py_DECREF(x); } +#if PY_MAJOR_VERSION >= 3 +# define PyIntObject PyLongObject +# define PyInt_Type PyLong_Type +# define PyInt_Check(op) PyLong_Check(op) +# define PyInt_CheckExact(op) PyLong_CheckExact(op) +# define PyInt_FromString PyLong_FromString +# define PyInt_FromUnicode PyLong_FromUnicode +# define PyInt_FromLong PyLong_FromLong +# define PyInt_FromSize_t PyLong_FromSize_t +# define PyInt_FromSsize_t PyLong_FromSsize_t +# define PyInt_AsLong PyLong_AsLong +# define PyInt_AS_LONG PyLong_AS_LONG +# define PyInt_AsSsize_t PyLong_AsSsize_t +# define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask +# define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask +# define PyString_FromString PyUnicode_FromString +# define PyString_AsString PyUnicode_AsUTF8 +#endif + static int py_append_string(PyObject *list, const char* value) { int rt;