]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
smack: allow comments on smack rules (#7438)
authorWaLyong Cho <walyong.cho@gmail.com>
Thu, 23 Nov 2017 15:27:19 +0000 (00:27 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 23 Nov 2017 15:27:19 +0000 (16:27 +0100)
src/core/smack-setup.c

index f05db215e0c47d23736ba301a89c0ca97bb74703..a5b6ea2cd6929e5a3452f24c480acd401b1d9500 100644 (file)
@@ -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) {