smack: allow comments on smack rules (#7438)

This commit is contained in:
WaLyong Cho
2017-11-24 00:27:19 +09:00
committed by Zbigniew Jędrzejewski-Szmek
parent 3a26bc1dd5
commit 459aafc6d8

View 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) {