From patchwork Mon Sep 11 10:41:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jann Horn via Selinux X-Patchwork-Id: 9947047 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 A160D6024A for ; Mon, 11 Sep 2017 10:43:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69AC228B7E for ; Mon, 11 Sep 2017 10:43:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DEC028B80; Mon, 11 Sep 2017 10:43:27 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from ucol19pa12.eemsg.mail.mil (ucol19pa12.eemsg.mail.mil [214.24.24.85]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98D0D28B7E for ; Mon, 11 Sep 2017 10:43:26 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.42,377,1500940800"; d="scan'208";a="386260586" Received: from emsm-gh1-uea10.ncsc.mil ([214.29.60.2]) by ucol19pa12.eemsg.mail.mil with ESMTP/TLS/AES256-SHA; 11 Sep 2017 10:43:23 +0000 X-IronPort-AV: E=Sophos;i="5.42,377,1500940800"; d="scan'208";a="1978301" Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by EMSM-GH1-UEA10.NCSC.MIL with ESMTP; 11 Sep 2017 10:43:23 +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 v8BAfwB1016114; Mon, 11 Sep 2017 06:42:18 -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 v8BAfrSW064444 for ; Mon, 11 Sep 2017 06:41:53 -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 v8BAfoOO016112 for ; Mon, 11 Sep 2017 06:41:53 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A1D6BQDkZ7ZZfygYGNZcHhgHgyIogVUng?= =?us-ascii?q?3eLFalaCgWFLwqEIFcBAgEBAQEBAhMBAQsWhh8EGQE4AQMSHwImAjYBBQE1iF+?= =?us-ascii?q?BOQEDFQMBoFtAjAuBbTqDCgWBAoJRCkANg3wBKQIGEnyCHYEyUIkzgWiBA4JHg?= =?us-ascii?q?mEBBKBiEpREi1AMhyKUfgIEAgQFAgYUJIEVgWQzRBVkhH4cGYFQdIdEgkEBAQE?= X-IPAS-Result: =?us-ascii?q?A1D6BQDkZ7ZZfygYGNZcHhgHgyIogVUng3eLFalaCgWFLwq?= =?us-ascii?q?EIFcBAgEBAQEBAhMBAQsWhh8EGQE4AQMSHwImAjYBBQE1iF+BOQEDFQMBoFtAj?= =?us-ascii?q?AuBbTqDCgWBAoJRCkANg3wBKQIGEnyCHYEyUIkzgWiBA4JHgmEBBKBiEpREi1A?= =?us-ascii?q?MhyKUfgIEAgQFAgYUJIEVgWQzRBVkhH4cGYFQdIdEgkEBAQE?= X-IronPort-AV: E=Sophos;i="5.42,377,1500955200"; d="scan'208";a="47516" Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.35]) by goalie.tycho.ncsc.mil with ESMTP; 11 Sep 2017 06:41:50 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AFB+bKRYJmwWBfnahCTmNEzX/LSx+4OfEezUN459i?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aPhUd3xKS3YnbPge6ttw1JNwwo0i9ZE7tRbDa9SDuj0XxratM?= =?us-ascii?q?bZFQM4Ogr87Hj7FM521o5WDWmAEKifPbj6vliP6eYiJuCNYMkevzOreKtt3OLn?= =?us-ascii?q?kXJswQxVRqKux5ZCMH0=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0D8BQCoZ7ZZfygYGNZcHhgHDAYMgwQog?= =?us-ascii?q?VUng3eLFalaCoU0CoQgVwEBAQEBAQEBAgESAQELFl2CMyKCbQQZATgBAxIfAiY?= =?us-ascii?q?CNgEFATWIX4E5AQMVAwGgXECMC4FtOoMKBYECglEKQA2DfAEpAgYSfIIdgTJQi?= =?us-ascii?q?TOBaIEDgkeCYQWgYhKURItQDIcilH4CBAIEBQIGFCSBFYFkM0QVZIR+HBmBUHS?= =?us-ascii?q?HRIJBAQEB?= X-IronPort-AV: E=Sophos;i="5.42,377,1500940800"; d="scan'208";a="2126488" Received: from ucol3cpa02.eemsg.mail.mil ([214.24.24.40]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 11 Sep 2017 10:41:49 +0000 X-EEMSG-check-005: 0 X-EEMSG-check-006: 000-001;704092db-d12e-40fb-94db-56323097d55d X-EEMSG-check-008: 448366978|UCOL3CPA02_EEMSG_MP17.csd.disa.mil X-EEMSG-SBRS: 2.7 X-EEMSG-ORIG-IP: 209.85.128.173 X-EEMSG-check-002: true X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A0AwBqZ7ZZf62AVdFcHgYMgy+CJIN3ixWpWgoFhS8KhCBDFAECAQEBAQEBARMBAQkLCwgmMYVCBAsBDQE4AQMSHwImAjYBBQE1iF+BOQEDFQSgXECMC4FtOoMKBYECglEKQA2DfAEBCCACBgkBCHyCHYEyUIkzgWiBA4JHgmEFoGISlESLUAyHIAKUfgIEAgQFAgYUJIEVNoEuM0QVZIRvDxyBaXSHRIJBAQEB X-IPAS-Result: A0A0AwBqZ7ZZf62AVdFcHgYMgy+CJIN3ixWpWgoFhS8KhCBDFAECAQEBAQEBARMBAQkLCwgmMYVCBAsBDQE4AQMSHwImAjYBBQE1iF+BOQEDFQSgXECMC4FtOoMKBYECglEKQA2DfAEBCCACBgkBCHyCHYEyUIkzgWiBA4JHgmEFoGISlESLUAyHIAKUfgIEAgQFAgYUJIEVNoEuM0QVZIRvDxyBaXSHRIJBAQEB Received: from mail-wr0-f173.google.com ([209.85.128.173]) by UCOL3CPA02.eemsg.mail.mil with ESMTP; 11 Sep 2017 10:41:47 +0000 Received: by mail-wr0-f173.google.com with SMTP id m18so13646769wrm.2 for ; Mon, 11 Sep 2017 03:41:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LFeUjORFRVAEHY4PDrnH4+K+czv4mQgoruqDnM1KqBg=; b=F6PdQ6p7MX7+hC97saB0WnpyF31LZGnaG/+BBrLUTEO70CEvKdqw8mDUAVM4abW1mK tpKtATEKFI+6MuND9+bn8ZWNSltjeggoJKkFwqgHzYwvtZWBFxOf6OMqnMdclPMPoJxG FftElnekraU4E2J9wm1cZ8N+xd/iWeytt+CzUlPAa4/mlO8zAtpcz4dq1Fyuff2N1c7o dpcRxLalwW7HjNUuOpcsb/ovqM+9Rul5zG74r1tmUJn942DCxeP3oc5XUnSoCndPSxgs 5xwefPTbhGoMQcNNto35kRxKsiXpldV7R/uVfeMUQFTBVfTQZ953c8xcH0iddTfSdNAV cFSA== X-Gm-Message-State: AHPjjUhWXVZBCeqajhqUOQqH3E/er5/8ABcftX67tOpAh13oafma9Ebv x1wI+FN0qSZW3yKknpM= X-Google-Smtp-Source: ADKCNb6joH/37FVDStL9QE/wzrvJcYmHJoyZvZX4wBexmJVIP+llib+zCQqnBzsdR8cejRbFWqY91A== X-Received: by 10.223.173.84 with SMTP id p78mr5013043wrc.277.1505126507035; Mon, 11 Sep 2017 03:41:47 -0700 (PDT) Received: from localhost.localdomain (x590fee5d.dyn.telefonica.de. [89.15.238.93]) by smtp.gmail.com with ESMTPSA id 195sm9487702wmj.17.2017.09.11.03.41.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 03:41:46 -0700 (PDT) X-EEMSG-check-009: 444-444 To: selinux@tycho.nsa.gov Date: Mon, 11 Sep 2017 12:41:41 +0200 Message-Id: <20170911104141.2629-1-cgzones@googlemail.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 X-MIME-Autoconverted: from quoted-printable to 8bit by prometheus.infosec.tycho.ncsc.mil id v8BAfrSW064444 Subject: [PATCH] libselinux: log no default label warning in verbose mode X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= via Selinux Reply-To: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP Since 1cd972f restorecon does not print a warning in recurse mode for child files without a default label. Change it back in verbose mode: $ touch /run/test.pid $ restorecon -R /run $ restorecon -v -R /run Warning no default label for /run/test.pid Signed-off-by: Christian Göttsche --- libselinux/src/selinux_restorecon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c index ced41152..6d0eabe0 100644 --- a/libselinux/src/selinux_restorecon.c +++ b/libselinux/src/selinux_restorecon.c @@ -614,7 +614,7 @@ static int restorecon_sb(const char *pathname, const struct stat *sb, sb->st_mode); if (rc < 0) { - if (errno == ENOENT && flags->warnonnomatch) + if (errno == ENOENT && (flags->verbose || flags->warnonnomatch)) selinux_log(SELINUX_INFO, "Warning no default label for %s\n", lookup_path);