浏览代码

dpkg: Do not check for selabel_lookup_raw() returning "<<none>>" context

The selabel_file(5) man page clearly states that the function may never
return such context, so do not check for it.
Guillem Jover 13 年之前
父节点
当前提交
006781260a
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      src/archives.c

+ 3 - 5
src/archives.c

@@ -511,11 +511,9 @@ tarobject_set_se_context(const char *matchpath, const char *path, mode_t mode)
   if (ret == -1 || (ret == 0 && scontext == NULL))
     return;
 
-  if (strcmp(scontext, "<<none>>") != 0) {
-    ret = lsetfilecon_raw(path, scontext);
-    if (ret < 0 && errno != ENOTSUP)
-      ohshite(_("cannot set security context for file object '%s'"), path);
-  }
+  ret = lsetfilecon_raw(path, scontext);
+  if (ret < 0 && errno != ENOTSUP)
+    ohshite(_("cannot set security context for file object '%s'"), path);
 
   freecon(scontext);
 #endif /* WITH_SELINUX */