From patchwork Sun Jan 15 13:03:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 9517391 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 A8286607D4 for ; Sun, 15 Jan 2017 13:07:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 924F42807E for ; Sun, 15 Jan 2017 13:07:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8373B283E1; Sun, 15 Jan 2017 13:07:35 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (emsm-gh1-uea10.nsa.gov [8.44.101.8]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DBDA2807E for ; Sun, 15 Jan 2017 13:07:34 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.33,233,1477958400"; d="scan'208";a="2830796" IronPort-PHdr: =?us-ascii?q?9a23=3AuoSOyBapN/v6ze7jmfCw4ob/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZoc69Zx7h7PlgxGXEQZ/co6odzbGH7+a7BSdZuszJmUtBWaQEbwUCh8?= =?us-ascii?q?QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6?= =?us-ascii?q?OPn+FJLMgMSrzeCy/IDYbxlViDanb75/KBq7oR/fu8QZjoduN6g8xgXUqXZUZu?= =?us-ascii?q?pawn9lK0iOlBjm/Mew+5Bj8yVUu/0/8sNLTLv3caclQ7FGFToqK2866tHluhnF?= =?us-ascii?q?VguP+2ATUn4KnRpSAgjK9w/1U5HsuSbnrOV92S2aPcrrTbAoXDmp8qlmRAP0hC?= =?us-ascii?q?oBKjU2/nvXishth6xFphyvqQF0z4rNbI2IKPZye6XQds4YS2VcRMZcTyxPDJ2h?= =?us-ascii?q?YYUBDOQPOv5Yoovgq1YAohSxGQaiC/30yjJTmn/737c33/g7HA3awgAtGc8Fvn?= =?us-ascii?q?TOrNXyMacfSfi7zKjUwjXEa/NZwyz945XLfBAmpvGMRqlwetfWxEkpFgPKklKQ?= =?us-ascii?q?qYj/MDOOzOgNsm+b7+17VeK0kGMnrg58oze1yscrkInJiZsYx1bZ/it62IY4Pc?= =?us-ascii?q?C0RUF0bNK+EJZcqjuWO5V5T888WW1kpT42x78EtJKhYSQHxpoqywTBZ/CbcoWE?= =?us-ascii?q?+BzuWPiXLDxlnnxqYqi/iAy38UW4z+38UdS730hSoypel9nMqmgN1xvO6sibUv?= =?us-ascii?q?d9/lmu2TKI1w3L9uFLO1o0lavGK5462LIwipoSvljDHi/xgkn2irOZdl449eSy?= =?us-ascii?q?7uTnY7HmqoedN49ylA7+LrwjltGwDOk3KAQDX3WX9f6i2LDs40H1WqhGguUzkq?= =?us-ascii?q?bDsZDaIcobprS+Aw9Qyosj8AiwDzOn0NQegHkGI0tJdwmAj4j0PVHBPO73Deyk?= =?us-ascii?q?jlSwkDZk2/DGPrr7DpXLNXjMiq3tfbl6605C0AYz18xQ54pICrEdJ/L+Qk3xtN?= =?us-ascii?q?veDhAjLwy0w/zoCNNm24McXmKPBKqZP7nJsV+U+O0vOfKMaJUSuDbnJPgv/+Tu?= =?us-ascii?q?gmMhmV8BYamp2oMaaHK6Hvt8P0qZYmHsgtAHEWcLoAozV+LqiFmfUT9cfHmyQq?= =?us-ascii?q?Q85i0mCI68CofDXI+tiqSb3CinBp1WenxGCleUHHbmdoWEX/IMZzyIIsJ6nDwL?= =?us-ascii?q?S6WuS4g71R60rA/60b1nLujK9SIEqZLvzt915/fclRsq7zx7E9yd032RT2Fzhm?= =?us-ascii?q?4HWiM53KV4oUx71lePzLN1g+JGGtxJ5vNIUwA6NZjGw+x8Fd/yRhrLfs2VR1a+?= =?us-ascii?q?XtWmHTYxQ8oszN8SeUl9Ac6vgQzE3yqvH7AajaeLBIAu/qLawXfxO953y2za26?= =?us-ascii?q?k5k1kmXsxPOHWmh69+8AjTAZXEk0Cdl6qzdKQc2jTB9GGZwmqUv0FYURBwXrvf?= =?us-ascii?q?UXAZeETWsczz5lneQL+2FbQnLgxBxNaZJaRRbdHpiVRGROz/ONTFeW6xgHm/Cg?= =?us-ascii?q?qSyrOXcoXqf2Qd3CPACEkLiA0c4XaHNRIjBie6uW7fAiZhFU70Y0Pr9+lysnS7?= =?us-ascii?q?TlU7zwuSdU1uy6K1+gIJhfybU/4cwKoEtz07qzV1B1awxMrWBMCapwpgZ6Vced?= =?us-ascii?q?c9701b2m3HrQB9OYagL696jF4Ebwt3p1/u1wlwCohYn8gqtmklzAxuJqKZy1NM?= =?us-ascii?q?bDaY3YjxOrHOMWnz8guvZ7TR2lHE39ac4r0P5+ggq1X/oAGpEVIv83Z93NlW1H?= =?us-ascii?q?uc+47HDAkIXpLyVUY36gJ2p7bAYiky/4nUz2FjMbGosj/e3NIkHPEqxQu6f9de?= =?us-ascii?q?LqyEDhT/HNcGCMirMuAqnEKpbh0cNuBI6KE0J9+md+eB2KOzPOZvgjamjWBA4I?= =?us-ascii?q?1m1kKM6jZ8SunN35kf2f2Y2RGHVzjkhle7rs/3gZxEZS0VHmen0ijkCpRRZqpp?= =?us-ascii?q?fYYXEmquOMu3xtJwhp7oQXFY8kSvB1UY18+1YRCSdUDy3RVM1UQLpnyqgSW5wC?= =?us-ascii?q?ZwkzE1sKWfxjfOzv/8dBUZIG5EX3RijVL2LYizldAaU1CibxI1mxu9+Ub6269b?= =?us-ascii?q?qbxjL2bOXEhIfjL5L2V5X6SssbqCZtJA54kzsSVLSui8Z06VSqLlqRsAzyzjB3?= =?us-ascii?q?dexCw8dzyyvJX5nhh6iGaDI3Zot3fWY99/xQ3Y5NDGQv5RxDUGTjFiiTbLHli8?= =?us-ascii?q?I8Wp/dKMmpfds+CxS36hVppJcSXx0YyAtCy75WtlARCkm/Czm9vnHhIg0S/8zd?= =?us-ascii?q?VqUj/IrBnkaInxy6u6Kf5nflVvBFLk78p6G5p+kpcpiJELx3cagpSV/XwakWb8?= =?us-ascii?q?Kthbwrr+bHsLRT4K39HV+xLp2Et9IXKV34j5TGmSwtN9Z9mmZWMbwjg978dOCK?= =?us-ascii?q?eQ8rNEhzd6ol22rA/Kevh9gysSyeA05H4dmeEJtxInzj+BDbAKAUlYISvsmgyQ?= =?us-ascii?q?79+ksaVXYHyjfqKq2EVlmtChCK2CogZaWHvif5cuASlw7sJjP17W1n389J3kcs?= =?us-ascii?q?HKbd0Prh2UjwvAj+9NJZIyiPUKgzFnNHn+vXI7ze47lhpu0o+mvISdLGVt5q25?= =?us-ascii?q?CAZCNjLpf8MT5i3tjaFGk8aI2YCgA45sGisNXJT1TfKkCjQSuur7NwyWCj0ztm?= =?us-ascii?q?+bGabDHQ+Y8Epmt2jAE42vN3yMOHYZzMliRRmEKExRmg8UWi82npkjFgCl3Mbh?= =?us-ascii?q?alt25igN5l7krRtB0vpoOAPiUmfbugioci07SJ6DLBVI9AFP/FrVMdeA4eJpBC?= =?us-ascii?q?FU5IahrAuQKmyBewtHE28JWkueB1DsILai/9/A/PaEBuCmNfvBfa2OqfBCV/eP?= =?us-ascii?q?3Z+v3JFp/zCQNsWIO3lvFPM71VReUnB+AcTWgS0PSzYQlyLPccGUuAu89jdwrs?= =?us-ascii?q?Cl//ThQBjv6peXC7tOLdVv/Ai7gaKZOO6UgCZ2NypY1o8WynDS07Uf2kAdiz11?= =?us-ascii?q?dzaxC7sArTDCQLjWmqBJEx4RczlzO9dQ76IgwglNPtbWisnv2r92lPI1Dk1KVV?= =?us-ascii?q?jmmsCpfsEFOX2yNFb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?= =?us-ascii?q?p302u7Pvyn/F+zAyqli63jCzF7W+T+1H420UAh8pKHiGqkkzE+ss9X/f817Xvl?= =?us-ascii?q?9o/+dbB72PjURrrzZ+BZ1OByhG2m67IFhpS3lGqepaIrzPc8NAW/kyeQOvOxsm?= =?us-ascii?q?GPE8xUyJ4Ed0kW36YyFptwta+iHdXxUvWiUPhLfihyEeoNm9OTAGU5JIcSkhby?= =?us-ascii?q?DdJgKanyBXoAhQa0V0VJAcHNlF56sb3ItP88rFUUajNycFXBl4OQI51fpQjklD?= =?us-ascii?q?sUqCdSDaFwqoeu7FsgdrcseJsM6pMPP58R9IioP9qu848bkDSmanmQ2qT9HeqZ?= =?us-ascii?q?P8tt2UuUuPcqf4L/OzYWXbQDjKkx+wma8uD4PW8CjLLApbN556xGI4YZjmDG7G?= =?us-ascii?q?JghGK74eJ0VAT6x6b8tJovxCbc9+ZKkJ4bNtBg6ARh73GIygtuNGIUzXRTvDNC?= =?us-ascii?q?iO7/KwoZrL7bPDTejveNaMy2zAQ6JtMZdw8SP7FKvy0Y9C5kr23e9g9kF9SVfY?= =?us-ascii?q?KC2OscruJhgV68m4akvtoIAmESnQAJhujHrn3ltAeNYPQy227JQYz4tU523+Se?= =?us-ascii?q?1kzkT+svBe+rd/5IYr5LBpzNu7Kr3JKfRGq0NnBAabBhly/JU3HGd/X3xRYvMW?= =?us-ascii?q?KPrJZ6QWk93hq+DtGKwL8xCV/+tZacXZKE3fhsa/DSyTRgJekAcHtzEaMhOW1+?= =?us-ascii?q?SZlK9sVcalue/511o141ilMh4J1q1i5Zuf96qTo+/XcgHRwqQaVajsWsPztK4j?= =?us-ascii?q?u0eI6f0jjr4OdXR/Yxe7H+gFSs4d2mDgwLg2zSI2DczMAa/v9eVeV3I9gjLggY?= =?us-ascii?q?pyH0sXGvMTGbqE45hekn0/m+zDOd0carpClXqXFR64Dr8Czmam5DaRIGZ/mRzB?= =?us-ascii?q?zhfwTnmp4F/xty94TjPGz83/nUpNSrm3GUBSU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KhWTTaJ07GwY2i?= =?us-ascii?q?AtkH5CBpumusg8zVtedpPaAcpoZ+G0wiBH5mYNfH8mYSAinPxAKuskPjT3ylKz?= =?us-ascii?q?UD7WNOfHQI?= X-IPAS-Result: =?us-ascii?q?A2HUBACNc3tY/wHyM5BdHAEBBAEBCgEBFwEBBAEBCgEBgw4?= =?us-ascii?q?BAQEBAR+BaI5KqEwqiB1XAQEBAQEBAQECAQJgKIIzG4IjAiQTFCAOAwkCFykIC?= =?us-ascii?q?AMBLRUfCwUYBIhiBAGyBzomAoNohh6GRYkBEQGGAAWIeoYpjBeBe49XilOGJ5J?= =?us-ascii?q?sWHEkEipCg2gMQgEcgWByhjSCLgEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 15 Jan 2017 13:07:32 +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 v0FD7TY0001372; Sun, 15 Jan 2017 08:07:29 -0500 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 v0FD4pPJ226052 for ; Sun, 15 Jan 2017 08:04:51 -0500 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 v0FD4ofm000632 for ; Sun, 15 Jan 2017 08:04:50 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1DcBAAQc3tYbyIeaIFdHQEFAQsBgzkBAQEBAYIHjkqkPYQ0iCJXAQIBAQEBAQITAQwKDAgdhUeCI4kDBAGgG5FsOoQQhh6GRY8TBYh6himMF4F7j1eQepJsgWwSKoQqAQsBQQEcgWByiGIBAQE X-IPAS-Result: A1DcBAAQc3tYbyIeaIFdHQEFAQsBgzkBAQEBAYIHjkqkPYQ0iCJXAQIBAQEBAQITAQwKDAgdhUeCI4kDBAGgG5FsOoQQhh6GRY8TBYh6himMF4F7j1eQepJsgWwSKoQqAQsBQQEcgWByiGIBAQE X-IronPort-AV: E=Sophos;i="5.33,233,1477972800"; d="scan'208";a="5907509" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 15 Jan 2017 08:04:22 -0500 IronPort-PHdr: =?us-ascii?q?9a23=3Akw+XfhcVQHqFHcvCLKswDh0hlGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxcuybR7h7PlgxGXEQZ/co6odzbGH7+a7BSdZuszJmUtBWaQEbwUCh8?= =?us-ascii?q?QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6?= =?us-ascii?q?OPn+FJLMgMSrzeCy/IDYbxlViDanb75/KBq7oR/fu8QZjoduN6g8xgXUqXZUZu?= =?us-ascii?q?pawn9lK0iOlBjm/Mew+5Bj8yVUu/0/8sNLTLv3caclQ7FGFToqK2866tHluhnF?= =?us-ascii?q?VguP+2ATUn4KnRpSAgjK9w/1U5HsuSbnrOV92S2aPcrrTbAoXDmp8qlmRAP0hC?= =?us-ascii?q?oBKjU09nzchM5tg6JBuB+vpwJxzZPabo+WM/RzZb/Rcc8ASGZdRMtdSzBND4Wh?= =?us-ascii?q?ZIUPFeoBOuNYopHlqVsPsRS+Ag2sC/n0yjRVhXH22qo60/86EQrb2wEgGdMOv2?= =?us-ascii?q?jTrNXxLqgSSvq5zKjPzTXEdPNWwizw6I3HfxEuu/2MWqhwccXIxEQpCgjLjU2Q?= =?us-ascii?q?pJT4Mz+L0ukBqXWX4/ZvWO61hWMrtxt9rzagy8s0iITEhJgZxk3K+Ch32oo5O8?= =?us-ascii?q?G0RU9hbdOqDpddsTyROZFsTcM4WW5ovT43yr0Ytp6/eygH0JEnxhHCZ/Cda4iI?= =?us-ascii?q?5RbjVeaNIThmmH1leLS/hxer8Ui91OLwTM600ExFriZdk9nMsG4C1wDL58SaVP?= =?us-ascii?q?dw+l2t1SuT2w3c8O1JL1w4mbDVJpMu2rIwk4AcsUXHHi/4gkX2i6qWe1059Oa0?= =?us-ascii?q?9urrfq3rpoabN49plw7zKqYhl8ynDOQ9PQUPUHKX+eOm1L3s5UD5RrRKgeExkq?= =?us-ascii?q?ndqp/aPt4Xpq++Aw9SyYYj8A2yACyh0NQFm3kIMExKeAmdg4jsNFzPL+r0DfCl?= =?us-ascii?q?g1SjiDtr3ezJPqX9ApXRKXjOiKzhcqh5605dzgoz0N9e6olICrABPP3zWkjxuM?= =?us-ascii?q?beDh8iKQO42ennCNJj1tBWZWXaGaKdMaXPoXeU9+kvJK+Kf4ZTtzHjeNY/4Pu7?= =?us-ascii?q?q34ynlsUZuGI2pwMczjsGPVtJEGQejzthdAaCk8P4hp4S/bl3g7RGQVPbmq/Cv?= =?us-ascii?q?pvrgowD5irWN/O?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0EBBQBhcntYbyIeaIFdHQEFAQsBGAEFA?= =?us-ascii?q?QsBgw4BAQEBAYIHjkqkPYQ0iCJXAQEBAQEBAQECAQIQAQwWCB0wgjMZgkuCI4k?= =?us-ascii?q?DBAGgGZFsOoQQhh6GRY8TBYh6himMF4F7j1eQepJsgW0SKoQqAQsBQQEcgWByi?= =?us-ascii?q?GIBAQE?= X-IPAS-Result: =?us-ascii?q?A0EBBQBhcntYbyIeaIFdHQEFAQsBGAEFAQsBgw4BAQEBAYI?= =?us-ascii?q?HjkqkPYQ0iCJXAQEBAQEBAQECAQIQAQwWCB0wgjMZgkuCI4kDBAGgGZFsOoQQh?= =?us-ascii?q?h6GRY8TBYh6himMF4F7j1eQepJsgW0SKoQqAQsBQQEcgWByiGIBAQE?= X-IronPort-AV: E=Sophos;i="5.33,233,1477958400"; d="scan'208";a="2301779" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from mx1.polytechnique.org ([129.104.30.34]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2017 13:04:20 +0000 Received: from localhost.localdomain (32.206.133.77.rev.sfr.net [77.133.206.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 7B84056481B for ; Sun, 15 Jan 2017 14:04:18 +0100 (CET) From: Nicolas Iooss To: selinux@tycho.nsa.gov Subject: [PATCH 1/5] libsepol: use constant keys in hashtab functions Date: Sun, 15 Jan 2017 14:03:55 +0100 Message-Id: <20170115130359.6108-1-nicolas.iooss@m4x.org> X-Mailer: git-send-email 2.11.0 X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sun Jan 15 14:04:18 2017 +0100 (CET)) X-Org-Mail: nicolas.iooss.2010@polytechnique.org 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 Even though "hashtab_key_t" is an alias for "char *", "const hashtab_key_t" is not an alias for "(const char) *" but means "(char *) const". Introduce const_hashtab_key_t to map "(const char) *" and use it in hashtab_search() and hashtab key comparison functions. Signed-off-by: Nicolas Iooss --- libsepol/cil/src/cil_binary.c | 48 ++++++++++++++-------------- libsepol/cil/src/cil_strpool.c | 12 +++---- libsepol/include/sepol/policydb/hashtab.h | 13 ++++---- libsepol/src/hashtab.c | 8 ++--- libsepol/src/policydb.c | 8 ++--- libsepol/src/roles.c | 3 +- libsepol/src/symtab.c | 16 ++++------ libsepol/src/users.c | 12 +++---- policycoreutils/newrole/hashtab.c | 8 ++--- policycoreutils/newrole/hashtab.h | 13 ++++---- policycoreutils/newrole/newrole.c | 12 +++---- semodule-utils/semodule_deps/semodule_deps.c | 16 ++++------ 12 files changed, 77 insertions(+), 92 deletions(-) diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c index 60c175029c27..aaad364efce7 100644 --- a/libsepol/cil/src/cil_binary.c +++ b/libsepol/cil/src/cil_binary.c @@ -4027,53 +4027,53 @@ exit: return rc; } -static unsigned int filename_trans_hash(hashtab_t h, hashtab_key_t key) +static unsigned int filename_trans_hash(hashtab_t h, const_hashtab_key_t key) { - filename_trans_t *k = (filename_trans_t *)key; + const filename_trans_t *k = (const filename_trans_t *)key; return ((k->tclass + (k->ttype << 2) + (k->stype << 9)) & (h->size - 1)); } static int filename_trans_compare(hashtab_t h - __attribute__ ((unused)), hashtab_key_t key1, - hashtab_key_t key2) + __attribute__ ((unused)), const_hashtab_key_t key1, + const_hashtab_key_t key2) { - filename_trans_t *a = (filename_trans_t *)key1; - filename_trans_t *b = (filename_trans_t *)key2; + const filename_trans_t *a = (const filename_trans_t *)key1; + const filename_trans_t *b = (const filename_trans_t *)key2; return a->stype != b->stype || a->ttype != b->ttype || a->tclass != b->tclass || strcmp(a->name, b->name); } -static unsigned int range_trans_hash(hashtab_t h, hashtab_key_t key) +static unsigned int range_trans_hash(hashtab_t h, const_hashtab_key_t key) { - range_trans_t *k = (range_trans_t *)key; + const range_trans_t *k = (const range_trans_t *)key; return ((k->target_class + (k->target_type << 2) + (k->source_type << 5)) & (h->size - 1)); } static int range_trans_compare(hashtab_t h - __attribute__ ((unused)), hashtab_key_t key1, - hashtab_key_t key2) + __attribute__ ((unused)), const_hashtab_key_t key1, + const_hashtab_key_t key2) { - range_trans_t *a = (range_trans_t *)key1; - range_trans_t *b = (range_trans_t *)key2; + const range_trans_t *a = (const range_trans_t *)key1; + const range_trans_t *b = (const range_trans_t *)key2; return a->source_type != b->source_type || a->target_type != b->target_type || a->target_class != b->target_class; } -static unsigned int role_trans_hash(hashtab_t h, hashtab_key_t key) +static unsigned int role_trans_hash(hashtab_t h, const_hashtab_key_t key) { - role_trans_t *k = (role_trans_t *)key; + const role_trans_t *k = (const role_trans_t *)key; return ((k->role + (k->type << 2) + (k->tclass << 5)) & (h->size - 1)); } static int role_trans_compare(hashtab_t h - __attribute__ ((unused)), hashtab_key_t key1, - hashtab_key_t key2) + __attribute__ ((unused)), const_hashtab_key_t key1, + const_hashtab_key_t key2) { - role_trans_t *a = (role_trans_t *)key1; - role_trans_t *b = (role_trans_t *)key2; + const role_trans_t *a = (const role_trans_t *)key1; + const role_trans_t *b = (const role_trans_t *)key2; return a->role != b->role || a->type != b->type || a->tclass != b->tclass; } @@ -4081,9 +4081,9 @@ static int role_trans_compare(hashtab_t h /* Based on MurmurHash3, written by Austin Appleby and placed in the * public domain. */ -static unsigned int avrulex_hash(__attribute__((unused)) hashtab_t h, hashtab_key_t key) +static unsigned int avrulex_hash(__attribute__((unused)) hashtab_t h, const_hashtab_key_t key) { - avtab_key_t *k = (avtab_key_t *)key; + const avtab_key_t *k = (const avtab_key_t *)key; static const uint32_t c1 = 0xcc9e2d51; static const uint32_t c2 = 0x1b873593; @@ -4121,11 +4121,11 @@ static unsigned int avrulex_hash(__attribute__((unused)) hashtab_t h, hashtab_ke } static int avrulex_compare(hashtab_t h - __attribute__ ((unused)), hashtab_key_t key1, - hashtab_key_t key2) + __attribute__ ((unused)), const_hashtab_key_t key1, + const_hashtab_key_t key2) { - avtab_key_t *a = (avtab_key_t *)key1; - avtab_key_t *b = (avtab_key_t *)key2; + const avtab_key_t *a = (const avtab_key_t *)key1; + const avtab_key_t *b = (const avtab_key_t *)key2; return a->source_type != b->source_type || a->target_type != b->target_type || a->target_class != b->target_class || a->specified != b->specified; } diff --git a/libsepol/cil/src/cil_strpool.c b/libsepol/cil/src/cil_strpool.c index 5b7df8c6e0ce..b1396d2daebb 100644 --- a/libsepol/cil/src/cil_strpool.c +++ b/libsepol/cil/src/cil_strpool.c @@ -45,14 +45,14 @@ static pthread_mutex_t cil_strpool_mutex = PTHREAD_MUTEX_INITIALIZER; static unsigned int cil_strpool_readers = 0; static hashtab_t cil_strpool_tab = NULL; -static unsigned int cil_strpool_hash(hashtab_t h, hashtab_key_t key) +static unsigned int cil_strpool_hash(hashtab_t h, const_hashtab_key_t key) { - char *p, *keyp; + const char *p, *keyp; size_t size; unsigned int val; val = 0; - keyp = (char*)key; + keyp = (const char*)key; size = strlen(keyp); for (p = keyp; ((size_t) (p - keyp)) < size; p++) val = @@ -60,10 +60,10 @@ static unsigned int cil_strpool_hash(hashtab_t h, hashtab_key_t key) return val & (h->size - 1); } -static int cil_strpool_compare(hashtab_t h __attribute__ ((unused)), hashtab_key_t key1, hashtab_key_t key2) +static int cil_strpool_compare(hashtab_t h __attribute__ ((unused)), const_hashtab_key_t key1, const_hashtab_key_t key2) { - char *keyp1 = (char*)key1; - char *keyp2 = (char*)key2; + const char *keyp1 = (const char*)key1; + const char *keyp2 = (const char*)key2; return strcmp(keyp1, keyp2); } diff --git a/libsepol/include/sepol/policydb/hashtab.h b/libsepol/include/sepol/policydb/hashtab.h index df49258c7cba..ae5674adcb7f 100644 --- a/libsepol/include/sepol/policydb/hashtab.h +++ b/libsepol/include/sepol/policydb/hashtab.h @@ -23,6 +23,7 @@ extern "C" { #endif typedef char *hashtab_key_t; /* generic key type */ +typedef const char *const_hashtab_key_t; /* constant generic key type */ typedef void *hashtab_datum_t; /* generic datum type */ typedef struct hashtab_node *hashtab_ptr_t; @@ -37,8 +38,8 @@ typedef struct hashtab_val { hashtab_ptr_t *htable; /* hash table */ unsigned int size; /* number of slots in hash table */ uint32_t nel; /* number of elements in hash table */ - unsigned int (*hash_value) (struct hashtab_val * h, hashtab_key_t key); /* hash function */ - int (*keycmp) (struct hashtab_val * h, hashtab_key_t key1, hashtab_key_t key2); /* key comparison function */ + unsigned int (*hash_value) (struct hashtab_val * h, const_hashtab_key_t key); /* hash function */ + int (*keycmp) (struct hashtab_val * h, const_hashtab_key_t key1, const_hashtab_key_t key2); /* key comparison function */ } hashtab_val_t; typedef hashtab_val_t *hashtab_t; @@ -50,11 +51,11 @@ typedef hashtab_val_t *hashtab_t; the new hash table otherwise. */ extern hashtab_t hashtab_create(unsigned int (*hash_value) (hashtab_t h, - const hashtab_key_t + const_hashtab_key_t key), int (*keycmp) (hashtab_t h, - const hashtab_key_t key1, - const hashtab_key_t key2), + const_hashtab_key_t key1, + const_hashtab_key_t key2), unsigned int size); /* Inserts the specified (key, datum) pair into the specified hash table. @@ -98,7 +99,7 @@ extern int hashtab_replace(hashtab_t h, hashtab_key_t k, hashtab_datum_t d, Returns NULL if no entry has the specified key or the datum of the entry otherwise. */ -extern hashtab_datum_t hashtab_search(hashtab_t h, const hashtab_key_t k); +extern hashtab_datum_t hashtab_search(hashtab_t h, const_hashtab_key_t k); /* Destroys the specified hash table. diff --git a/libsepol/src/hashtab.c b/libsepol/src/hashtab.c index c4be72cd3f5f..ec49c1571534 100644 --- a/libsepol/src/hashtab.c +++ b/libsepol/src/hashtab.c @@ -33,10 +33,10 @@ #include hashtab_t hashtab_create(unsigned int (*hash_value) (hashtab_t h, - const hashtab_key_t key), + const_hashtab_key_t key), int (*keycmp) (hashtab_t h, - const hashtab_key_t key1, - const hashtab_key_t key2), + const_hashtab_key_t key1, + const_hashtab_key_t key2), unsigned int size) { @@ -175,7 +175,7 @@ int hashtab_replace(hashtab_t h, hashtab_key_t key, hashtab_datum_t datum, return SEPOL_OK; } -hashtab_datum_t hashtab_search(hashtab_t h, const hashtab_key_t key) +hashtab_datum_t hashtab_search(hashtab_t h, const_hashtab_key_t key) { int hvalue; diff --git a/libsepol/src/policydb.c b/libsepol/src/policydb.c index ed4bdc8c821e..3f9b1f3fd2ac 100644 --- a/libsepol/src/policydb.c +++ b/libsepol/src/policydb.c @@ -727,7 +727,7 @@ partial_name_hash(unsigned long c, unsigned long prevhash) return (prevhash + (c << 4) + (c >> 4)) * 11; } -static unsigned int filenametr_hash(hashtab_t h, hashtab_key_t k) +static unsigned int filenametr_hash(hashtab_t h, const_hashtab_key_t k) { const struct filename_trans *ft = (const struct filename_trans *)k; unsigned long hash; @@ -743,7 +743,7 @@ static unsigned int filenametr_hash(hashtab_t h, hashtab_key_t k) } static int filenametr_cmp(hashtab_t h __attribute__ ((unused)), - hashtab_key_t k1, hashtab_key_t k2) + const_hashtab_key_t k1, const_hashtab_key_t k2) { const struct filename_trans *ft1 = (const struct filename_trans *)k1; const struct filename_trans *ft2 = (const struct filename_trans *)k2; @@ -765,7 +765,7 @@ static int filenametr_cmp(hashtab_t h __attribute__ ((unused)), } -static unsigned int rangetr_hash(hashtab_t h, hashtab_key_t k) +static unsigned int rangetr_hash(hashtab_t h, const_hashtab_key_t k) { const struct range_trans *key = (const struct range_trans *)k; return (key->source_type + (key->target_type << 3) + @@ -773,7 +773,7 @@ static unsigned int rangetr_hash(hashtab_t h, hashtab_key_t k) } static int rangetr_cmp(hashtab_t h __attribute__ ((unused)), - hashtab_key_t k1, hashtab_key_t k2) + const_hashtab_key_t k1, const_hashtab_key_t k2) { const struct range_trans *key1 = (const struct range_trans *)k1; const struct range_trans *key2 = (const struct range_trans *)k2; diff --git a/libsepol/src/roles.c b/libsepol/src/roles.c index 713d834df3f9..4540cee80e19 100644 --- a/libsepol/src/roles.c +++ b/libsepol/src/roles.c @@ -13,8 +13,7 @@ int sepol_role_exists(sepol_handle_t * handle __attribute__ ((unused)), { policydb_t *policydb = &p->p; - *response = (hashtab_search(policydb->p_roles.table, - (const hashtab_key_t)role) != NULL); + *response = (hashtab_search(policydb->p_roles.table, role) != NULL); return STATUS_SUCCESS; } diff --git a/libsepol/src/symtab.c b/libsepol/src/symtab.c index b319c8f2b0e4..c1e625dbf16f 100644 --- a/libsepol/src/symtab.c +++ b/libsepol/src/symtab.c @@ -11,14 +11,14 @@ #include #include -static unsigned int symhash(hashtab_t h, hashtab_key_t key) +static unsigned int symhash(hashtab_t h, const_hashtab_key_t key) { - char *p, *keyp; + const char *p, *keyp; size_t size; unsigned int val; val = 0; - keyp = (char *)key; + keyp = (const char *)key; size = strlen(keyp); for (p = keyp; ((size_t) (p - keyp)) < size; p++) val = @@ -27,14 +27,10 @@ static unsigned int symhash(hashtab_t h, hashtab_key_t key) } static int symcmp(hashtab_t h - __attribute__ ((unused)), hashtab_key_t key1, - hashtab_key_t key2) + __attribute__ ((unused)), const_hashtab_key_t key1, + const_hashtab_key_t key2) { - char *keyp1, *keyp2; - - keyp1 = (char *)key1; - keyp2 = (char *)key2; - return strcmp(keyp1, keyp2); + return strcmp(key1, key2); } int symtab_init(symtab_t * s, unsigned int size) diff --git a/libsepol/src/users.c b/libsepol/src/users.c index 3ffb166b1c66..1929399bf447 100644 --- a/libsepol/src/users.c +++ b/libsepol/src/users.c @@ -139,8 +139,7 @@ int sepol_user_modify(sepol_handle_t * handle, goto err; /* Now, see if a user exists */ - usrdatum = hashtab_search(policydb->p_users.table, - (const hashtab_key_t)cname); + usrdatum = hashtab_search(policydb->p_users.table, cname); /* If it does, we will modify it */ if (usrdatum) { @@ -163,8 +162,7 @@ int sepol_user_modify(sepol_handle_t * handle, for (i = 0; i < num_roles; i++) { /* Search for the role */ - roldatum = hashtab_search(policydb->p_roles.table, - (const hashtab_key_t)roles[i]); + roldatum = hashtab_search(policydb->p_roles.table, roles[i]); if (!roldatum) { ERR(handle, "undefined role %s for user %s", roles[i], cname); @@ -301,8 +299,7 @@ int sepol_user_exists(sepol_handle_t * handle __attribute__ ((unused)), const char *cname; sepol_user_key_unpack(key, &cname); - *response = (hashtab_search(policydb->p_users.table, - (const hashtab_key_t)cname) != NULL); + *response = (hashtab_search(policydb->p_users.table, cname) != NULL); return STATUS_SUCCESS; } @@ -328,8 +325,7 @@ int sepol_user_query(sepol_handle_t * handle, const char *cname; sepol_user_key_unpack(key, &cname); - usrdatum = hashtab_search(policydb->p_users.table, - (const hashtab_key_t)cname); + usrdatum = hashtab_search(policydb->p_users.table, cname); if (!usrdatum) { *response = NULL; diff --git a/policycoreutils/newrole/hashtab.c b/policycoreutils/newrole/hashtab.c index 0442ab35ad26..77ed143c832d 100644 --- a/policycoreutils/newrole/hashtab.c +++ b/policycoreutils/newrole/hashtab.c @@ -12,10 +12,10 @@ #include "hashtab.h" hashtab_t hashtab_create(unsigned int (*hash_value) (hashtab_t h, - const hashtab_key_t key), + const_hashtab_key_t key), int (*keycmp) (hashtab_t h, - const hashtab_key_t key1, - const hashtab_key_t key2), + const_hashtab_key_t key1, + const_hashtab_key_t key2), unsigned int size) { @@ -154,7 +154,7 @@ int hashtab_replace(hashtab_t h, hashtab_key_t key, hashtab_datum_t datum, return HASHTAB_SUCCESS; } -hashtab_datum_t hashtab_search(hashtab_t h, const hashtab_key_t key) +hashtab_datum_t hashtab_search(hashtab_t h, const_hashtab_key_t key) { int hvalue; diff --git a/policycoreutils/newrole/hashtab.h b/policycoreutils/newrole/hashtab.h index abc80c312257..9f737df64e70 100644 --- a/policycoreutils/newrole/hashtab.h +++ b/policycoreutils/newrole/hashtab.h @@ -19,6 +19,7 @@ #include typedef char *hashtab_key_t; /* generic key type */ +typedef const char *const_hashtab_key_t; /* constant generic key type */ typedef void *hashtab_datum_t; /* generic datum type */ typedef struct hashtab_node *hashtab_ptr_t; @@ -33,8 +34,8 @@ typedef struct hashtab_val { hashtab_ptr_t *htable; /* hash table */ unsigned int size; /* number of slots in hash table */ uint32_t nel; /* number of elements in hash table */ - unsigned int (*hash_value) (struct hashtab_val * h, hashtab_key_t key); /* hash function */ - int (*keycmp) (struct hashtab_val * h, hashtab_key_t key1, hashtab_key_t key2); /* key comparison function */ + unsigned int (*hash_value) (struct hashtab_val * h, const_hashtab_key_t key); /* hash function */ + int (*keycmp) (struct hashtab_val * h, const_hashtab_key_t key1, const_hashtab_key_t key2); /* key comparison function */ } hashtab_val_t; typedef hashtab_val_t *hashtab_t; @@ -52,11 +53,11 @@ typedef hashtab_val_t *hashtab_t; the new hash table otherwise. */ extern hashtab_t hashtab_create(unsigned int (*hash_value) (hashtab_t h, - const hashtab_key_t + const_hashtab_key_t key), int (*keycmp) (hashtab_t h, - const hashtab_key_t key1, - const hashtab_key_t key2), + const_hashtab_key_t key1, + const_hashtab_key_t key2), unsigned int size); /* Inserts the specified (key, datum) pair into the specified hash table. @@ -100,7 +101,7 @@ extern int hashtab_replace(hashtab_t h, hashtab_key_t k, hashtab_datum_t d, Returns NULL if no entry has the specified key or the datum of the entry otherwise. */ -extern hashtab_datum_t hashtab_search(hashtab_t h, const hashtab_key_t k); +extern hashtab_datum_t hashtab_search(hashtab_t h, const_hashtab_key_t k); /* Destroys the specified hash table. diff --git a/policycoreutils/newrole/newrole.c b/policycoreutils/newrole/newrole.c index c6544eed07b9..faf937b94f6d 100644 --- a/policycoreutils/newrole/newrole.c +++ b/policycoreutils/newrole/newrole.c @@ -228,7 +228,7 @@ static int free_hashtab_entry(hashtab_key_t key, hashtab_datum_t d, return 0; } -static unsigned int reqsymhash(hashtab_t h, hashtab_key_t key) +static unsigned int reqsymhash(hashtab_t h, const_hashtab_key_t key) { char *p, *keyp; size_t size; @@ -244,14 +244,10 @@ static unsigned int reqsymhash(hashtab_t h, hashtab_key_t key) } static int reqsymcmp(hashtab_t h - __attribute__ ((unused)), hashtab_key_t key1, - hashtab_key_t key2) + __attribute__ ((unused)), const_hashtab_key_t key1, + const_hashtab_key_t key2) { - char *keyp1, *keyp2; - - keyp1 = (char *)key1; - keyp2 = (char *)key2; - return strcmp(keyp1, keyp2); + return strcmp(key1, key2); } static hashtab_t app_service_names = NULL; diff --git a/semodule-utils/semodule_deps/semodule_deps.c b/semodule-utils/semodule_deps/semodule_deps.c index ab3d1cb800af..ab99d159f788 100644 --- a/semodule-utils/semodule_deps/semodule_deps.c +++ b/semodule-utils/semodule_deps/semodule_deps.c @@ -52,14 +52,14 @@ static void usage(char *program_name) /* Basic string hash and compare for the hashtables used in * generate_requires. Copied from symtab.c. */ -static unsigned int reqsymhash(hashtab_t h, hashtab_key_t key) +static unsigned int reqsymhash(hashtab_t h, const_hashtab_key_t key) { - char *p, *keyp; + const char *p, *keyp; size_t size; unsigned int val; val = 0; - keyp = (char *)key; + keyp = (const char *)key; size = strlen(keyp); for (p = keyp; ((size_t) (p - keyp)) < size; p++) val = @@ -68,14 +68,10 @@ static unsigned int reqsymhash(hashtab_t h, hashtab_key_t key) } static int reqsymcmp(hashtab_t h - __attribute__ ((unused)), hashtab_key_t key1, - hashtab_key_t key2) + __attribute__ ((unused)), const_hashtab_key_t key1, + const_hashtab_key_t key2) { - char *keyp1, *keyp2; - - keyp1 = (char *)key1; - keyp2 = (char *)key2; - return strcmp(keyp1, keyp2); + return strcmp(key1, key2); } /* Load a policy package from the given filename. Progname is used for