From 4b94cfd3910de26dbca64cf746a899cbc635158b Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Thu, 11 Dec 2014 10:00:45 -0600 Subject: Attempt to set the proper uid/gid/contexts on new files and dirs Files and folders that we create during backups, copy log, or MTP operations often do not have the proper uid/gid/contexts assigned. We will attempt to read the proper contexts from the settings storage path and assign those same contexts to any files or dirs that we create. Change-Id: I769f9479854122b49b499de2175e6e2d026f8afd --- infomanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'infomanager.cpp') diff --git a/infomanager.cpp b/infomanager.cpp index 080fe1d28..864c431a5 100644 --- a/infomanager.cpp +++ b/infomanager.cpp @@ -39,6 +39,7 @@ #include "infomanager.hpp" #include "twcommon.h" #include "partitions.hpp" +#include "set_metadata.h" using namespace std; @@ -97,7 +98,7 @@ int InfoManager::SaveValues(void) { return -1; PartitionManager.Mount_By_Path(File, true); -LOGINFO("InfoManager saving '%s'\n", File.c_str()); + LOGINFO("InfoManager saving '%s'\n", File.c_str()); FILE* out = fopen(File.c_str(), "wb"); if (!out) return -1; @@ -112,6 +113,7 @@ LOGINFO("InfoManager saving '%s'\n", File.c_str()); fwrite(iter->second.c_str(), 1, length, out); } fclose(out); + tw_set_default_metadata(File.c_str()); return 0; } -- cgit v1.2.3