From: WaLyong Cho Date: Thu, 23 Nov 2017 15:27:19 +0000 (+0900) Subject: smack: allow comments on smack rules (#7438) X-Git-Tag: v236~139 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=459aafc6d85ee9719db28de461d66bd0433136fe;p=thirdparty%2Fsystemd.git smack: allow comments on smack rules (#7438) --- diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c index f05db215e0c..a5b6ea2cd69 100644 --- a/src/core/smack-setup.c +++ b/src/core/smack-setup.c @@ -103,7 +103,7 @@ static int write_access2_rules(const char* srcdir) { _cleanup_free_ char *sbj = NULL, *obj = NULL, *acc1 = NULL, *acc2 = NULL; - if (isempty(truncate_nl(buf))) + if (isempty(truncate_nl(buf)) || strchr(COMMENTS, *buf)) continue; /* if 3 args -> load rule : subject object access1 */ @@ -180,7 +180,7 @@ static int write_cipso2_rules(const char* srcdir) { log_error_errno(errno, "Failed to read line from '%s': %m", entry->d_name)) { - if (isempty(truncate_nl(buf))) + if (isempty(truncate_nl(buf)) || strchr(COMMENTS, *buf)) continue; if (write(cipso2_fd, buf, strlen(buf)) < 0) {