summaryrefslogtreecommitdiff
path: root/plugins/msm.h
diff options
context:
space:
mode:
authorElena Reshetova <elena.reshetova@intel.com>2013-09-26 11:30:54 +0300
committerElena Reshetova <elena.reshetova@intel.com>2013-09-27 10:41:47 +0300
commit2a4cb0f4d4de732ec10b4e7729c24b4c4fc41e2c (patch)
treea333df5e8b5a447f7b08c13944fec0cfbd51c6b4 /plugins/msm.h
parent570bf157b85ce8a272fff03669a3e2eca68da431 (diff)
downloadlibrpm-tizen-2a4cb0f4d4de732ec10b4e7729c24b4c4fc41e2c.tar.gz
librpm-tizen-2a4cb0f4d4de732ec10b4e7729c24b4c4fc41e2c.tar.bz2
librpm-tizen-2a4cb0f4d4de732ec10b4e7729c24b4c4fc41e2c.zip
Security plugin: plugin hooks code refactoring and improvment
Change-Id: I4d44db47865dd5c83fcf28435ffc26a70164b69d
Diffstat (limited to 'plugins/msm.h')
-rw-r--r--plugins/msm.h46
1 files changed, 42 insertions, 4 deletions
diff --git a/plugins/msm.h b/plugins/msm.h
index 1a4853a2a..f1bdcc819 100644
--- a/plugins/msm.h
+++ b/plugins/msm.h
@@ -29,15 +29,12 @@
#ifndef MSM_H
#define MSM_H
-#define IMA "security.ima"
-#define SMACK64TRANSMUTE "security.SMACK64TRANSMUTE"
#define SMACK64 "security.SMACK64"
#define SMACK64EXEC "security.SMACK64EXEC"
+#define SMACK64TRANSMUTE "security.SMACK64TRANSMUTE"
#define SMACK_RULES_PATH "/etc/smack/accesses.d/"
-#define SMACK_RULES_PATH_BEG "/etc/smack/"
#define DEVICE_SECURITY_POLICY "/etc/device-sec-policy"
-#define SMACK_LOAD_PATH "/sys/fs/smackfs/load"
#define SMACK_ISOLATED_LABEL "Isolated"
@@ -312,6 +309,14 @@ void msmFreePointer(void **ptr);
manifest_x *msmProcessManifestXml(const char *buffer, int size, sw_source_x *current, const char *packagename);
/** \ingroup msm
+ * Loads device security policy.
+ * @param rootDir --root rpm optional prefix
+ * @param dsp pointer to the loaded policy
+ * @return RPMRC_OK or RPMRC_FAIL
+ */
+rpmRC msmLoadDeviceSecurityPolicy(const char* rootDir, manifest_x **dsp);
+
+/** \ingroup msm
* Process device security policy file.
* @param filename file name
* @return pointer to structure on success
@@ -319,6 +324,13 @@ manifest_x *msmProcessManifestXml(const char *buffer, int size, sw_source_x *cur
manifest_x *msmProcessDevSecPolicyXml(const char *filename);
/** \ingroup msm
+ * Creates a directory for the smack rules.
+ * @param rootDir --root rpm optional prefix
+ * @return RPMRC_OK or RPMRC_FAIL
+ */
+rpmRC msmSetupSmackRulesDir(const char* rootDir);
+
+/** \ingroup msm
* Free all structures reserved during manifest processing.
* @param mfx pointer to structure
*/
@@ -457,4 +469,30 @@ sw_source_x *msmSWSourceTreeTraversal(sw_source_x *sw_sources, int (func)(sw_sou
* Free internal hashes.
*/
void msmFreeInternalHashes(void);
+
+/** \ingroup msm
+ * Finds a sw source by key info.
+ * @param sw_source sw source
+ * @param param searched param
+ * @return 0 if found
+ */
+int msmFindSWSourceByKey(sw_source_x *sw_source, void *param);
+
+/** \ingroup msm
+ * Finds a sw source by sw source name.
+ * @param sw_source sw source
+ * @param param searched param
+ * @return 0 if found
+ */
+int msmFindSWSourceByName(sw_source_x *sw_source, void *param);
+
+/** \ingroup msm
+ * Finds a sw source by sw source signature.
+ * @param sw_source sw source
+ * @param param searched param
+ * @param param2 searched param2
+ * @return 0 if found
+ */
+int msmFindSWSourceBySignature(sw_source_x *sw_source, void *param, void* param2);
+
#endif