mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
stat: fix option -Z segv (bug 1454)
This commit is contained in:
parent
22a80d1e7d
commit
501bfe2630
@ -342,8 +342,11 @@ static bool do_statfs(char const *filename, char const *format)
|
||||
security_context_t scontext = NULL;
|
||||
|
||||
if (option_mask32 & OPT_SELINUX) {
|
||||
if ((option_mask32 & OPT_DEREFERENCE ? lgetfilecon(filename, scontext):
|
||||
getfilecon(filename, scontext))< 0) {
|
||||
if ((option_mask32 & OPT_DEREFERENCE
|
||||
? lgetfilecon(filename, &scontext)
|
||||
: getfilecon(filename, &scontext)
|
||||
) < 0
|
||||
) {
|
||||
bb_perror_msg(filename);
|
||||
return 0;
|
||||
}
|
||||
@ -448,9 +451,12 @@ static bool do_stat(char const *filename, char const *format)
|
||||
security_context_t scontext = NULL;
|
||||
|
||||
if (option_mask32 & OPT_SELINUX) {
|
||||
if ((option_mask32 & OPT_DEREFERENCE ? lgetfilecon(filename, scontext):
|
||||
getfilecon(filename, scontext))< 0) {
|
||||
bb_perror_msg (filename);
|
||||
if ((option_mask32 & OPT_DEREFERENCE
|
||||
? lgetfilecon(filename, &scontext)
|
||||
: getfilecon(filename, &scontext)
|
||||
) < 0
|
||||
) {
|
||||
bb_perror_msg(filename);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -98,6 +98,6 @@ int bb_make_directory (char *path, long mode, int flags)
|
||||
|
||||
} while (1);
|
||||
|
||||
bb_perror_msg ("cannot %s directory '%s'", fail_msg, path);
|
||||
bb_perror_msg("cannot %s directory '%s'", fail_msg, path);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user