Message ID | 1461391499-20593-9-git-send-email-jason@perfinion.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <selinux-bounces@tycho.nsa.gov> X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 228DEBF29F for <patchwork-selinux@patchwork.kernel.org>; Sat, 23 Apr 2016 06:10:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30BB920225 for <patchwork-selinux@patchwork.kernel.org>; Sat, 23 Apr 2016 06:10:35 +0000 (UTC) Received: from emvm-gh1-uea09.nsa.gov (emvm-gh1-uea09.nsa.gov [8.44.101.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 566922026F for <patchwork-selinux@patchwork.kernel.org>; Sat, 23 Apr 2016 06:10:34 +0000 (UTC) X-TM-IMSS-Message-ID: <b0b00b940000645b@nsa.gov> Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by nsa.gov ([10.208.42.194]) with ESMTP (TREND IMSS SMTP Service 7.1) id b0b00b940000645b ; Sat, 23 Apr 2016 02:07:48 -0400 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 u3N68Fbo008035; Sat, 23 Apr 2016 02:08:15 -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 u3N66LWo117844 for <selinux@prometheus.infosec.tycho.ncsc.mil>; Sat, 23 Apr 2016 02:06:21 -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 u3N66L7Q007525 for <selinux@tycho.nsa.gov>; Sat, 23 Apr 2016 02:06:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CtBACSDxtX/yQp0Apegw2Be7d2gmqBHQsXhXcCgW4BAQEBAQFmJ4RCAQEBAxIVGQEBNwEPUTQBBQEcGSKICAGgd4ExPjGKT4UoAQSMSQEBAQEBAQQCARcGCoQNi2CBfAtAgkOOS4lJjhZjiEaFZUWNLDCBDmKBeIIAXwGIegEBAQ X-IPAS-Result: A0CtBACSDxtX/yQp0Apegw2Be7d2gmqBHQsXhXcCgW4BAQEBAQFmJ4RCAQEBAxIVGQEBNwEPUTQBBQEcGSKICAGgd4ExPjGKT4UoAQSMSQEBAQEBAQQCARcGCoQNi2CBfAtAgkOOS4lJjhZjiEaFZUWNLDCBDmKBeIIAXwGIegEBAQ X-IronPort-AV: E=Sophos;i="5.24,520,1454994000"; d="scan'208";a="5403918" 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; 23 Apr 2016 02:06:20 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AiQjryxPijDen+YcK/kUl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0KP/zrarrMEGX3/hxlliBBdydsKIUzbWP+PGwEUU7or+/81k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZv?= =?us-ascii?q?IaytQ8iJ35TxiLn5qs2bSj4LrQT+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?A1EQAQBYEBtXiMHAVdFegw2Be7d2gmqBH?= =?us-ascii?q?QsXgXaEAQKBbgEBAQEBAQICDwEBAQgLCwkfgl59Wz0BAQEDEhUZAQE3AQ9RNAE?= =?us-ascii?q?FARwZIogIAaBsgTE+MYpPhSgBBIxJAQEBAQEBBAIBFwYKhA2LYIF8C0CCQ45Li?= =?us-ascii?q?UmOFmOIRoVlRY0sMIEOgloegWJfAYh6AQEB?= X-IPAS-Result: =?us-ascii?q?A1EQAQBYEBtXiMHAVdFegw2Be7d2gmqBHQsXgXaEAQKBbgE?= =?us-ascii?q?BAQEBAQICDwEBAQgLCwkfgl59Wz0BAQEDEhUZAQE3AQ9RNAEFARwZIogIAaBsg?= =?us-ascii?q?TE+MYpPhSgBBIxJAQEBAQEBBAIBFwYKhA2LYIF8C0CCQ45LiUmOFmOIRoVlRY0?= =?us-ascii?q?sMIEOgloegWJfAYh6AQEB?= X-IronPort-AV: E=Sophos;i="5.24,520,1454976000"; d="scan'208";a="12950734" Received: from emvm-gh1-uea08.nsa.gov ([10.208.42.193]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Apr 2016 06:05:51 +0000 X-TM-IMSS-Message-ID: <64cf6da400007527@nsa.gov> Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by nsa.gov ([10.208.42.193]) with ESMTP (TREND IMSS SMTP Service 7.1; TLSv1/SSLv3 AES128-SHA (128/128)) id 64cf6da400007527 ; Sat, 23 Apr 2016 02:05:10 -0400 Received: by mail-pf0-f193.google.com with SMTP id r187so11959792pfr.2 for <selinux@tycho.nsa.gov>; Fri, 22 Apr 2016 23:05:50 -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=lmUmQ84L0/2vWAFXn062ZmkyaajQqldoBKnwvAnr6pE=; b=JK4HvZYeurOcqvDMuWDwDkjZiOWitsy3nZXeEz3Szn59Di4N1HqKKLwLdeqwp2z8Qh uGHOdBNWKVTa8ObCBwD5pWlRvtiz1o7cLG/HE9Wbdwrb6r2570oFgmxrSXq5DpbQ+f3/ 5aGz3rDO1NU8z4X5HyLyYWVofXBEIGKnqlrkRU2TQQyBtUZnpoT3jTt+WkpCxt/rGzv6 2tOFJGPs99LoCsIZCAk+Ho9869G53aaj9vpCjOg3Sv9rZ0ckEYR+GOGvVabGbquZueUu urFAuecpu4bbgkxzwjkYCB2xCD4ZA+Lz2TewmuZFuYN+b9WP8Y5hUu6jM1IebEojvj4S zNbw== 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=lmUmQ84L0/2vWAFXn062ZmkyaajQqldoBKnwvAnr6pE=; b=JL+OiykccrmR/ugl1XHmhFn7SgVt3hAryvV/4gmp1OqJyIvLs4UjNp9IwvZ9Sm70w8 mGYU/I62PsdX9/toc5LIGSj0HapVnzc7iUh8RkQ34nkA+JUl1z6XxB7Jk4+PIkw6jtF6 IBnmrqbpQTVhsSPNwWRlwfXbuEhaT9LBKZKRISqZRm+zFU8LEBxEupgpDRo5z20RPVVF LvWIM0oyoTDwsLtea4K7nG6ZOHyoYgEnpfxvVQv9N04z2ziRxW/cxNakgZ7fM3YEprAR ABYUK9azyta5x/sdzraMXTz0vFYNOhYfJEricoQQHeqXD6ni5dVv3Th+9N8Mfq5shzI6 a8QQ== X-Gm-Message-State: AOPr4FUZzGLq6HrD9QHlYhlF2zH5jgD5bwcGwfZVuCBKgEi7olpMG87PZVoBPry3i4WpCA== X-Received: by 10.98.109.131 with SMTP id i125mr33766544pfc.153.1461391549380; Fri, 22 Apr 2016 23:05:49 -0700 (PDT) Received: from localhost ([2404:e800:e600:38b:b52d:863:7600:b418]) by smtp.gmail.com with ESMTPSA id bk8sm13575286pac.3.2016.04.22.23.05.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Apr 2016 23:05:48 -0700 (PDT) From: Jason Zaman <jason@perfinion.com> To: selinux@tycho.nsa.gov Subject: [PATCH v2 8/8] genhomedircon: fix FALLBACK_NAME regex Date: Sat, 23 Apr 2016 14:04:59 +0800 Message-Id: <1461391499-20593-9-git-send-email-jason@perfinion.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1461391499-20593-1-git-send-email-jason@perfinion.com> References: <1460131535-15688-1-git-send-email-jason@perfinion.com> <1461391499-20593-1-git-send-email-jason@perfinion.com> X-TM-AS-MML: disable X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" <selinux.tycho.nsa.gov> List-Post: <mailto:selinux@tycho.nsa.gov> List-Help: <mailto:selinux-request@tycho.nsa.gov?subject=help> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" <selinux-bounces@tycho.nsa.gov> 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 |
diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c index 60a4def..fab6c30 100644 --- a/libsemanage/src/genhomedircon.c +++ b/libsemanage/src/genhomedircon.c @@ -86,7 +86,7 @@ #define FALLBACK_SENAME "user_u" #define FALLBACK_PREFIX "user" #define FALLBACK_LEVEL "s0" -#define FALLBACK_NAME ".*" +#define FALLBACK_NAME "[^/]+" #define FALLBACK_UIDGID "[0-9]+" #define DEFAULT_LOGIN "__default__" @@ -1018,7 +1018,7 @@ static int write_context_file(genhomedircon_settings_t * s, FILE * out) for (h = homedirs; h; h = h->next) { Ustr *temp = ustr_dup_cstr(h->data); - if (!temp || !ustr_add_cstr(&temp, "/[^/]*")) { + if (!temp || !ustr_add_cstr(&temp, "/" FALLBACK_NAME)) { ustr_sc_free(&temp); retval = STATUS_ERR; goto done;
Originally the fallback regex for the username was either ".*" or "[^/]*". The second is more correct but still can match nothing. changing the * to + means that it must match at least one character. Signed-off-by: Jason Zaman <jason@perfinion.com> --- libsemanage/src/genhomedircon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)