Removed smack_label_length() API
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fri, 25 Oct 2013 12:46:56 +0000 (15:46 +0300)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fri, 25 Oct 2013 12:46:56 +0000 (15:46 +0300)
In order to use this smack_label_length() in 1.0 branch, this patch
takes it away from the API. Adds temporarily unused attribute to the
function siganture.

doc/Makefile.am
doc/smack_have_access.3
doc/smack_label_length.3 [deleted file]
libsmack/libsmack.c
libsmack/libsmack.sym
libsmack/sys/smack.h

index 2cc31e6..37dc95a 100644 (file)
@@ -34,7 +34,6 @@ man_MANS = smackaccess.1 \
           smack_new_label_from_socket.3 \
           smack_new_label_from_path.3 \
           smack_set_label_for_self.3 \
-          smack_label_length.3 \
           smack_revoke_subject.3 \
           chsmack.8 \
           smackcipso.8 \
index a517d2e..2f6e535 100644 (file)
@@ -19,7 +19,7 @@
 .\"
 .TH "SMACK_HAVE_ACCESS" "3" "06/20/2012" "Libsmack 1\&.0"
 .SH NAME
-smack_have_access, smack_new_label_from_self, smack_new_label_from_socket, smack_label_length \- Userspace interaction with Smack
+smack_have_access, smack_new_label_from_self, smack_new_label_from_socket \- Userspace interaction with Smack
 .SH SYNOPSIS
 .B #include <sys/smack.h>
 .sp
@@ -30,8 +30,6 @@ smack_have_access, smack_new_label_from_self, smack_new_label_from_socket, smack
 .BI "int smack_set_label_for_self(char **" label ");"
 .br
 .BI "int smack_new_label_from_socket(int " fd ", char **" label ");"
-.br
-.BI "int smack_label_length(const char *" label ");"
 .sp
 .SH DESCRIPTION
 Smack is a Mandatory Access Control (MAC) based security mechanism for the Linux kernel.  It works on the basis of context, which is stored as a label in the extended attributes (xattr) of a file.  When a process is started the kernel ensures that this context is assigned to the running process.  By default a process can only interact with processes and filesystem objects that have the same context as itself and is denied access to all other contexts.  Rules can be created to grant access to other contexts, these are generally created on package installation and can only be modified by a process that has the CAP_MAC_ADMIN capability.
@@ -74,11 +72,6 @@ of the socket and determines it's context and creates a new storage for this whi
 on return.  It is the callers responsibility to free
 .I label
 when it is no longer required.
-.PP
-.BR smack_label_length ()
-calculates length of
-.IR label ,
-and validates it.
 .SH RETURN VALUE
 .BR smack_new_label_from_self ()
 and
@@ -91,8 +84,3 @@ is set appropriately).
 returns 1 if allowed, 0 if no access and \-1 on error (in which case,
 .I errno
 is set appropriately).
-
-.BR smack_label_length ()
-returns length of
-.I label
-if it is valid and negative value if it's not.
diff --git a/doc/smack_label_length.3 b/doc/smack_label_length.3
deleted file mode 100644 (file)
index 5040587..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/smack_have_access.3
index 1a29cdc..343b3bb 100644 (file)
@@ -83,6 +83,7 @@ struct smack_cipso {
 
 static int accesses_apply(struct smack_accesses *handle, int clear);
 static inline void parse_access_type(const char *in, char out[ACC_LEN + 1]);
+static int smack_label_length(const char *label) __attribute__((unused));
 
 int smack_accesses_new(struct smack_accesses **accesses)
 {
@@ -739,7 +740,7 @@ static inline void parse_access_type(const char *in, char out[ACC_LEN + 1])
                }
 }
 
-int smack_label_length(const char *label)
+static int smack_label_length(const char *label)
 {
        int i;
 
index f0a49d3..acd8dc0 100644 (file)
@@ -22,10 +22,3 @@ global:
 local:
        *;
 };
-
-LIBSMACK_1.1 {
-global:
-       smack_label_length;
-local:
-       *;
-} LIBSMACK_1.0;
index 61c37d9..912c769 100644 (file)
@@ -246,14 +246,6 @@ int smack_set_label_for_self(const char *label);
  */
 int smack_revoke_subject(const char *subject);
 
-/*!
- * Validate a SMACK label and calculate its length.
- *
- * @param label label to verify
- * @return Returns length of the label on success and negative on failure.
- */
-int smack_label_length(const char *label);
-
 #ifdef __cplusplus
 }
 #endif