Use it directly in libsmack.c. It will be declared as local symbol
in DSO because we declare visible symbols explicitly in libsmack.sym.
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
#define SMACKFSMNT "/sys/fs/smackfs/"
#define OLDSMACKFSMNT "/smack"
-static char *smack_mnt = NULL;
+char *smack_mnt = NULL;
void set_smackmnt(const char *mnt)
{
return;
}
-const char *smack_smackfs_path(void)
-{
- return smack_mnt;
-}
-
void fini_smackmnt(void)
{
free(smack_mnt);
#define READ_BUF_SIZE LOAD_LEN + 1
#define SELF_LABEL_FILE "/proc/self/attr/current"
-const char *smack_mnt;
+extern char *smack_mnt;
struct smack_rule {
char subject[LABEL_LEN + 1];
int access2 = 1;
char path[PATH_MAX];
- smack_mnt = smack_smackfs_path();
if (!smack_mnt) {
errno = EFAULT;
return -1;
return NULL;
}
+const char *smack_smackfs_path(void)
+{
+ return smack_mnt;
+}
+
int smack_cipso_apply(struct smack_cipso *cipso)
{
struct cipso_mapping *m = NULL;
int i;
char path[PATH_MAX];
- smack_mnt = smack_smackfs_path();
if (!smack_mnt) {
errno = EFAULT;
return -1;
close(fd);
return 0;
}
+
int smack_new_label_from_self(char **label)
{
char *result;
int load2 = 1;
char path[PATH_MAX];
- smack_mnt = smack_smackfs_path();
if (!smack_mnt) {
errno = EFAULT;
return -1;