int optc;
security_context_t scontext = NULL;
struct mkdir_options options;
- int ret = 0;
options.make_ancestor_function = NULL;
options.mode = S_IRWXUGO;
if (scontext)
{
+ int ret = 0;
if (is_smack_enabled ())
ret = smack_set_label_for_self (scontext);
else
ret = setfscreatecon (scontext);
+
+ if (ret < 0)
+ error (EXIT_FAILURE, errno,
+ _("failed to set default file creation context to %s"),
+ quote (scontext));
}
- if (ret < 0)
- error (EXIT_FAILURE, errno,
- _("failed to set default file creation context to %s"),
- quote (scontext));
if (options.make_ancestor_function || specified_mode)
{
int exit_status = EXIT_SUCCESS;
int optc;
security_context_t scontext = NULL;
- int ret = 0;
initialize_main (&argc, &argv);
set_program_name (argv[0]);
if (scontext)
{
+ int ret = 0;
if (is_smack_enabled ())
ret = smack_set_label_for_self (scontext);
else
ret = setfscreatecon (scontext);
- }
- if (ret < 0)
- error (EXIT_FAILURE, errno,
- _("failed to set default file creation context to %s"),
- quote (scontext));
+ if (ret < 0)
+ error (EXIT_FAILURE, errno,
+ _("failed to set default file creation context to %s"),
+ quote (scontext));
+ }
newmode = MODE_RW_UGO;
if (specified_mode)
int expected_operands;
mode_t node_type;
security_context_t scontext = NULL;
- int ret = 0;
initialize_main (&argc, &argv);
set_program_name (argv[0]);
if (scontext)
{
+ int ret = 0;
if (is_smack_enabled ())
ret = smack_set_label_for_self (scontext);
else
ret = setfscreatecon (scontext);
- }
- if (ret < 0)
- error (EXIT_FAILURE, errno,
- _("failed to set default file creation context to %s"),
- quote (scontext));
+ if (ret < 0)
+ error (EXIT_FAILURE, errno,
+ _("failed to set default file creation context to %s"),
+ quote (scontext));
+ }
/* Only check the first character, to allow mnemonic usage like
'mknod /dev/rst0 character 18 0'. */