** New features
- ls -Z and id -Z report the SMACK security context where available.
+ id and ls with -Z report the SMACK security context where available.
+ mkdir, mkfifo and mknod with -Z set the SMACK context where available.
join accepts a new option: --zero-terminated (-z). As with the sort,uniq
option of the same name, this makes join consume and produce NUL-terminated
src_ls_LDADD += $(LIB_SELINUX)
src_ls_LDADD += $(LIB_SMACK)
src_mkdir_LDADD += $(LIB_SELINUX)
+src_mkdir_LDADD += $(LIB_SMACK)
src_mkfifo_LDADD += $(LIB_SELINUX)
+src_mkfifo_LDADD += $(LIB_SMACK)
src_mknod_LDADD += $(LIB_SELINUX)
+src_mknod_LDADD += $(LIB_SMACK)
src_runcon_LDADD += $(LIB_SELINUX)
src_stat_LDADD += $(LIB_SELINUX)
#include <sys/types.h>
#include <selinux/selinux.h>
+#ifdef HAVE_SMACK
+# include <sys/smack.h>
+#endif
+
#include "system.h"
#include "error.h"
#include "mkdir-p.h"
int optc;
security_context_t scontext = NULL;
struct mkdir_options options;
+ int ret = 0;
options.make_ancestor_function = NULL;
options.mode = S_IRWXUGO;
usage (EXIT_FAILURE);
}
- if (scontext && setfscreatecon (scontext) < 0)
+ if (scontext)
+ {
+#ifdef HAVE_SMACK
+ if (smack_smackfs_path ())
+ ret = smack_set_label_for_self (scontext);
+ else
+#endif
+ ret = setfscreatecon (scontext);
+ }
+
+ if (ret < 0)
error (EXIT_FAILURE, errno,
_("failed to set default file creation context to %s"),
quote (scontext));
#include <sys/types.h>
#include <selinux/selinux.h>
+#ifdef HAVE_SMACK
+# include <sys/smack.h>
+#endif
+
#include "system.h"
#include "error.h"
#include "modechange.h"
int exit_status = EXIT_SUCCESS;
int optc;
security_context_t scontext = NULL;
+ int ret = 0;
initialize_main (&argc, &argv);
set_program_name (argv[0]);
usage (EXIT_FAILURE);
}
- if (scontext && setfscreatecon (scontext) < 0)
+ if (scontext)
+ {
+#ifdef HAVE_SMACK
+ if (smack_smackfs_path ())
+ ret = smack_set_label_for_self (scontext);
+ else
+#endif
+ ret = setfscreatecon (scontext);
+ }
+
+ if (ret < 0)
error (EXIT_FAILURE, errno,
_("failed to set default file creation context to %s"),
quote (scontext));
#include <sys/types.h>
#include <selinux/selinux.h>
+#ifdef HAVE_SMACK
+# include <sys/smack.h>
+#endif
+
#include "system.h"
#include "error.h"
#include "modechange.h"
int expected_operands;
mode_t node_type;
security_context_t scontext = NULL;
+ int ret = 0;
initialize_main (&argc, &argv);
set_program_name (argv[0]);
usage (EXIT_FAILURE);
}
- if (scontext && setfscreatecon (scontext) < 0)
+ if (scontext)
+ {
+#ifdef HAVE_SMACK
+ if (smack_smackfs_path ())
+ ret = smack_set_label_for_self (scontext);
+ else
+#endif
+ ret = setfscreatecon (scontext);
+ }
+
+ if (ret < 0)
error (EXIT_FAILURE, errno,
_("failed to set default file creation context to %s"),
quote (scontext));