@@ -24,6 +24,7 @@
* selinux_is_enabled - is SELinux enabled?
*/
bool selinux_is_enabled(void);
+int security_current_sid_to_context(char **scontext, u32 *scontext_len);
#else
static inline bool selinux_is_enabled(void)
@@ -6463,3 +6463,15 @@ int selinux_disable(void)
return 0;
}
#endif
+
+/**
+ * RPCSEC_GSS Version 3 Full Mode labeling needs this interface
+ * or one like it.
+ */
+int security_current_sid_to_context(char **scontext, u32 *scontext_len)
+{
+ const struct task_security_struct *ts = current_security();
+
+ return security_sid_to_context(ts->sid, scontext, scontext_len);
+}
+EXPORT_SYMBOL_GPL(security_current_sid_to_context);