From patchwork Sat Apr 30 07:58:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Zaman X-Patchwork-Id: 8986651 Return-Path: X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B9FC89F46D for ; Sat, 30 Apr 2016 08:10:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06A5920142 for ; Sat, 30 Apr 2016 08:10:38 +0000 (UTC) Received: from emsm-gh1-uea11.nsa.gov (emsm-gh1-uea11.nsa.gov [8.44.101.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 073D4201CD for ; Sat, 30 Apr 2016 08:10:36 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.24,555,1454976000"; d="scan'208";a="15771013" IronPort-PHdr: =?us-ascii?q?9a23=3A0Gb8RRBZBJiTvUVjRdC+UyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSP7/p8bcNUDSrc9gkEXOFd2CrakU26yG7Ou5AzdIyK3CmU5BWaQEbwUCh8?= =?us-ascii?q?QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4?= =?us-ascii?q?Ov7yUtaLyZ/nh6bipNaKOV4ArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff?= =?us-ascii?q?9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIYTGZn9Kr81Sb1eESQOL3E+5MqtswLK?= =?us-ascii?q?CwSI+CgySGITxzhBGA/DpCPzW573+n/4v/F63gGCMNf4TLY1XjLk5KBuHky7wB?= =?us-ascii?q?wbPiI0pTmEwvd7i7hW9Uqs?= X-IPAS-Result: =?us-ascii?q?A2EOBQDtZyRX/wHyM5BeHYJwK4FQu2whgXaFKUwBAQEBAQE?= =?us-ascii?q?CAmIngi19Wz0CAQMBAg8VEwYBAQwgCwECAwkBARcpCAgDAS0DAQUBCxEOCwUYB?= =?us-ascii?q?AGICAGkeIExPjGKVIUoAQSMLwEBCAIYBgqEDYplEQFohQqHfIVgc4lKjhpjiEc?= =?us-ascii?q?lhUCNczCBDmKCNoFCXwGGR4E1AQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2016 08:10:27 +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 u3U8AR44019241; Sat, 30 Apr 2016 04:10:27 -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 u3U7wlJH229785 for ; Sat, 30 Apr 2016 03:58:47 -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 u3U7wahi016059 for ; Sat, 30 Apr 2016 03:58:47 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1DpAADiZCRXiMPAVdFdgw2Be7djhAkKF4V5AoEkTAEBAQEBARMBAQEICwsJH4RzAgEDEhUZAQE3AQ9RNAEFARwZIogIAaR2gTE+MYpUhSgBBIwvAQEBAQEBBAIBFwYKhA2LX4F8C0CCQ4d8hWBziUqOGmOIR4VljXMwgQ6CWh4ggUJfAYd8AQEB X-IPAS-Result: A1DpAADiZCRXiMPAVdFdgw2Be7djhAkKF4V5AoEkTAEBAQEBARMBAQEICwsJH4RzAgEDEhUZAQE3AQ9RNAEFARwZIogIAaR2gTE+MYpUhSgBBIwvAQEBAQEBBAIBFwYKhA2LX4F8C0CCQ4d8hWBziUqOGmOIR4VljXMwgQ6CWh4ggUJfAYd8AQEB X-IronPort-AV: E=Sophos;i="5.24,555,1454994000"; d="scan'208";a="5420260" 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; 30 Apr 2016 03:58:47 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3A6o6nNR3LnYIk7Hh3smDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?segSKvad9pjvdHbS+e9qxAeQG96Lu7QU1KGP6fuocFdDyKjCmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBy?= =?us-ascii?q?brysXNWC34LniKvrocabSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf?= =?us-ascii?q?9d32JiKAHbtR/94sCt4MwrqHwI6Lpyv/JHBL73e6U+UKxwECUtM2dz4tbi8xbE?= =?us-ascii?q?U1ih/HwZB0cfiR1OSzrM6Rj8FsPzuzD9sMJl1TOUPMv3SrZyUjOnufQ4ACT0gT?= =?us-ascii?q?sKYmZquFrcjdZ92fpW?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0HQAACqZCRXiMPAVdFdgw2Be7djhAkKF?= =?us-ascii?q?4F2hAMCgSRMAQEBAQEBAgIPAQEBCAsLCR8xgi19Wz0CAQMSFRkBATcBD1E0AQU?= =?us-ascii?q?BHBkiiAgBpHWBMT4xilSFKAEEjC8BAQEBAQEEAgEXBgqEDYtfgXwLQIJDh3yFY?= =?us-ascii?q?HOJSo4aY4hHhWWNczCBDoJaHiCBQl8Bh3wBAQE?= X-IPAS-Result: =?us-ascii?q?A0HQAACqZCRXiMPAVdFdgw2Be7djhAkKF4F2hAMCgSRMAQE?= =?us-ascii?q?BAQEBAgIPAQEBCAsLCR8xgi19Wz0CAQMSFRkBATcBD1E0AQUBHBkiiAgBpHWBM?= =?us-ascii?q?T4xilSFKAEEjC8BAQEBAQEEAgEXBgqEDYtfgXwLQIJDh3yFYHOJSo4aY4hHhWW?= =?us-ascii?q?NczCBDoJaHiCBQl8Bh3wBAQE?= X-IronPort-AV: E=Sophos;i="5.24,555,1454976000"; d="scan'208";a="15770942" Received: from mail-pf0-f195.google.com ([209.85.192.195]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/AES128-GCM-SHA256; 30 Apr 2016 07:58:46 +0000 Received: by mail-pf0-f195.google.com with SMTP id 145so14469265pfz.1 for ; Sat, 30 Apr 2016 00:58:46 -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=b8p4ASjzIWxMX+xzXda+UGhRMKNVHzOHEQY+3zGjNcA=; b=yh4Yoh3nhO0tSdaR4E7fjvdBUPmeepAp2N8h5uCDUGv/pxM+pWybdN+d4xD9BZZ6Qx JfBxAmdOcWUme18goCOEAxSwdtQ2Zh99ZDnPF2jN3IiN5XfJfBfDDTZq0r42Tpaff4fn ylC2TkreclwrIunfzGNsG8t7S6hs2itL1LceyKWq+qPjRIkAZ4N9aQ7pDpmZfUwe4NDM DGXilt0H/yiCVcAaooitKjfiep+BZ6YM44qvk2apCp5u9oCU5Y1mAE5bviqCcr8Hnr2q ujbkYCy4f1ZSmxfz/skOk5q18BceCSDhhzpMrWfs+IAKNKkveVTMBFQVMaHmA20TmVHj uyhg== 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=b8p4ASjzIWxMX+xzXda+UGhRMKNVHzOHEQY+3zGjNcA=; b=EmF6PRjPsegHjFSgsAkd6Ye06THqmnzKzxYp/24hj30qnfGlu+eFFFnIDA/FAhRulk lA4Z4HW1nF6nUZI/K+xOy+Sd0WY7CJMjWgg4aNIeEvxnVDerJ6xA+7fcyZ+9GuG85OYz FN3kEWAIFGgXJbj83+18pT8f+w4RPO26sXXE3I+LExkgVoi5GCZz2sLjxih9MRt0vrGE HTntcT+OJjuxIzqBXRC5ezObg/n6W3Plp7u2U6/b+WCFfQcW5lv7c2x4NysACWyd7HiR wGRp06raJv10rEuiUpZJ/flUtpgwESLE8XxJnrUNt1yliHOlt/OLnojmhZ4J0MzCPEo3 kNOw== X-Gm-Message-State: AOPr4FXHyQoI3apiC8EJkMdrw0+j4dNYtBozgainUnDeqz3EfX+ljyWO77pumn7PWFSW0Q== X-Received: by 10.98.65.82 with SMTP id o79mr34900494pfa.115.1462003125989; Sat, 30 Apr 2016 00:58:45 -0700 (PDT) Received: from localhost ([2404:e800:e600:38b:e5d4:5e0:f7e0:81be]) by smtp.gmail.com with ESMTPSA id z63sm29025927pfb.47.2016.04.30.00.58.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Apr 2016 00:58:45 -0700 (PDT) From: Jason Zaman To: selinux@tycho.nsa.gov Subject: [PATCH v4 2/7] genhomedircon: rename FALLBACK #defines consistent with user struct Date: Sat, 30 Apr 2016 15:58:07 +0800 Message-Id: <1462003092-4611-3-git-send-email-jason@perfinion.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1462003092-4611-1-git-send-email-jason@perfinion.com> References: <1462003092-4611-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: Cc: sds@tycho.nsa.gov MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jason Zaman --- libsemanage/src/genhomedircon.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c index 09c2a10..ba997e1 100644 --- a/libsemanage/src/genhomedircon.c +++ b/libsemanage/src/genhomedircon.c @@ -78,9 +78,10 @@ #define TEMPLATE_SEUSER "system_u" #define TEMPLATE_LEVEL "s0" -#define FALLBACK_USER "user_u" -#define FALLBACK_USER_PREFIX "user" -#define FALLBACK_USER_LEVEL "s0" +#define FALLBACK_SENAME "user_u" +#define FALLBACK_PREFIX "user" +#define FALLBACK_LEVEL "s0" +#define FALLBACK_NAME ".*" #define DEFAULT_LOGIN "__default__" typedef struct { @@ -753,14 +754,14 @@ static int setup_fallback_user(genhomedircon_settings_t * s) if (semanage_user_query(s->h_semanage, key, &u) < 0) { prefix = name; - level = FALLBACK_USER_LEVEL; + level = FALLBACK_LEVEL; } else { prefix = semanage_user_get_prefix(u); level = semanage_user_get_mlslevel(u); if (!level) - level = FALLBACK_USER_LEVEL; + level = FALLBACK_LEVEL; } if (set_fallback_user(s, seuname, prefix, level) != 0) @@ -845,10 +846,10 @@ static genhomedircon_user_entry_t *get_users(genhomedircon_settings_t * s, prefix = semanage_user_get_prefix(*u); level = semanage_user_get_mlslevel(*u); if (!level) - level = FALLBACK_USER_LEVEL; + level = FALLBACK_LEVEL; } else { prefix = name; - level = FALLBACK_USER_LEVEL; + level = FALLBACK_LEVEL; } retval = getpwnam_r(name, &pwstorage, rbuf, rbuflen, &pwent); @@ -1046,9 +1047,9 @@ int semanage_genhomedircon(semanage_handle_t * sh, s.fcfilepath = semanage_final_path(SEMANAGE_FINAL_TMP, SEMANAGE_FC_HOMEDIRS); - s.fallback_user = strdup(FALLBACK_USER); - s.fallback_user_prefix = strdup(FALLBACK_USER_PREFIX); - s.fallback_user_level = strdup(FALLBACK_USER_LEVEL); + s.fallback_user = strdup(FALLBACK_SENAME); + s.fallback_user_prefix = strdup(FALLBACK_PREFIX); + s.fallback_user_level = strdup(FALLBACK_LEVEL); if (s.fallback_user == NULL || s.fallback_user_prefix == NULL || s.fallback_user_level == NULL) { retval = STATUS_ERR; goto done;