Skip to contentSkip to conversation

libsemanage: store users_extra in the policy store

PATCH In review Steve Lawrence 2 participants 2 messages Sep 3, 2015 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsemanage: store users_extra in the policy store

users_extra is needed by genhomedircon and when listing seusers, so it must be kept in the policy store. Also move the FC_TMPL unlink() closer to where the FC_TMPL is created; not a functional change, but eaiser to follow.

---
 libsemanage/src/direct_api.c             | 7 +++----
 libsemanage/utils/semanage_migrate_store | 1 +
 2 files changed, 4 insertions(+), 4 deletions(-)
libsemanage/src/direct_api.c +3 -4
index 6e49cae..68dd0d1 100644
@@ -1272,6 +1272,9 @@ static int semanage_direct_commit(semanage_handle_t * sh)
 		if (retval < 0)
 			goto cleanup;
 
+		/* remove FC_TMPL now that it is now longer needed */
+		unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_FC_TMPL));
+
 		pfcontexts->dtable->drop_cache(pfcontexts->dbase);
 
 		/* SEUsers */
@@ -1413,10 +1416,6 @@ static int semanage_direct_commit(semanage_handle_t * sh)
 	sepol_policydb_free(out);
 	out = NULL;
 
-	/* remove files that are automatically generated and no longer needed */
-	unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_FC_TMPL));
-	unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_USERS_EXTRA));
-
 	if (sh->do_rebuild || modified || bools_modified || fcontexts_modified) {
 		retval = semanage_install_sandbox(sh);
 	}
libsemanage/utils/semanage_migrate_store +1 -0
index 297c71b..b5eefaa 100755
@@ -247,6 +247,7 @@ if __name__ == "__main__":
 		"file_contexts.local",
 		"seusers",
 		"users.local",
+		"users_extra",
 		"users_extra.local",
 		"disable_dontaudit",
 		"preserve_tunables",
Signature · 1 line
2.4.3
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Steve Lawrence

users_extra is needed by genhomedircon and when listing seusers, so it must be kept in the policy store. Also move the FC_TMPL unlink() closer to where the FC_TMPL is created; not a functional change, but eaiser to follow.

Well, I actually acked the previous one, but this one's fine too.

Quoted 43 lines
---
 libsemanage/src/direct_api.c             | 7 +++----
 libsemanage/utils/semanage_migrate_store | 1 +
 2 files changed, 4 insertions(+), 4 deletions(-)
libsemanage/src/direct_api.c +3 -4
index 6e49cae..68dd0d1 100644
@@ -1272,6 +1272,9 @@ static int semanage_direct_commit(semanage_handle_t * sh)
 		if (retval < 0)
 			goto cleanup;
 
+		/* remove FC_TMPL now that it is now longer needed */
+		unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_FC_TMPL));
+
 		pfcontexts->dtable->drop_cache(pfcontexts->dbase);
 
 		/* SEUsers */
@@ -1413,10 +1416,6 @@ static int semanage_direct_commit(semanage_handle_t * sh)
 	sepol_policydb_free(out);
 	out = NULL;
 
-	/* remove files that are automatically generated and no longer needed */
-	unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_FC_TMPL));
-	unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_USERS_EXTRA));
-
 	if (sh->do_rebuild || modified || bools_modified || fcontexts_modified) {
 		retval = semanage_install_sandbox(sh);
 	}
libsemanage/utils/semanage_migrate_store +1 -0
index 297c71b..b5eefaa 100755
@@ -247,6 +247,7 @@ if __name__ == "__main__":
 		"file_contexts.local",
 		"seusers",
 		"users.local",
+		"users_extra",
 		"users_extra.local",
 		"disable_dontaudit",
 		"preserve_tunables",