Remove the path paramater to smack_have_access
authorBrian McGillion <brian.mcgillion@intel.com>
Wed, 10 Aug 2011 08:20:47 +0000 (11:20 +0300)
committerBrian McGillion <brian.mcgillion@intel.com>
Wed, 10 Aug 2011 08:20:47 +0000 (11:20 +0300)
src/smack.c
src/smack.h

index 54f0360..b3987d2 100644 (file)
@@ -77,6 +77,8 @@ static time_t global_rules_mtime = 0;
 static pthread_mutex_t global_rules_mutex = PTHREAD_MUTEX_INITIALIZER;
 static char *global_rules_path = NULL;
 
+static const char * const SMACK_LOAD_PATH = "/smack/load";
+
 static void free_global_rules(void)
 {
        smack_rule_set_free(global_rules);
@@ -431,12 +433,12 @@ int smack_rule_set_iter_next(SmackRuleSetIter iter,
        return 0;
 }
 
-int smack_have_access(const char *path, const char *subject,
-                     const char *object, const char *access_type)
+int smack_have_access(const char *subject, const char *object,
+                      const char *access_type)
 {
        int res;
 
-       if (refresh_global_rules(path) == -1)
+        if (refresh_global_rules(SMACK_LOAD_PATH) == -1)
                return 0;
 
        if (pthread_mutex_lock(&global_rules_mutex) != 0)
index efa6e93..1cd88df 100644 (file)
@@ -184,21 +184,21 @@ extern int smack_rule_set_iter_next(SmackRuleSetIter iter,
  * Verify access from a given subject to given object with a
  * given access type.
  *
- * @param path path to smack kernel load file
  * @param subject subject of the rule
  * @param object object of the rule
  * @param access_type string defining access type
  * @return 1 if access, 0 if no access.
  */
-extern int smack_have_access(const char *path, const char *subject,
-                            const char *object, const char *access_type);
+extern int smack_have_access(const char *subject, const char *object,
+                             const char *access_type);
 
 /*!
   * Get the label that is associated with a peer on the other
   * end of a socket.
   *
   * @param sock_fd The file descriptor of the socket
-  * @param label (out) The NULL terminated label of the socket if it exists, the caller is responsible to call free on label.
+  * @param label (out) The NULL terminated label of the socket if it exists,
+  * the caller is responsible to call free on the label.
   * @return 0 on success, -1 otherwise.
   */
 extern int smack_get_peer_label(int sock_fd, char **label);