Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions src/install/dracut-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,6 @@ static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir
int ret;
bool src_islink = false;
bool src_isdir = false;
mode_t src_mode = 0;
char *hash_path = NULL;
const char *src, *dst;

Expand Down Expand Up @@ -1438,7 +1437,6 @@ static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir
} else {
src_islink = S_ISLNK(sb.st_mode);
src_isdir = S_ISDIR(sb.st_mode);
src_mode = sb.st_mode;
}

/* The install hasn't succeeded yet, but mark this item as successful
Expand All @@ -1461,7 +1459,7 @@ static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir
return 1;
}

if (resolvedeps && S_ISREG(sb.st_mode) && (sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) {
if (resolvedeps && S_ISREG(sb.st_mode)) {
log_debug("'%s' already exists, but checking for any deps", fulldstpath);
if (sysrootdirlen && (strncmp(fulldstpath, sysrootdir, sysrootdirlen) == 0))
ret = resolve_deps(fulldstpath + sysrootdirlen, NULL);
Expand Down Expand Up @@ -1547,18 +1545,16 @@ static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir
return 0;
}

if (src_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
if (resolvedeps) {
/* ensure fullsrcpath contains sysrootdir */
if (sysrootdirlen && (strncmp(fullsrcpath, sysrootdir, sysrootdirlen) == 0))
ret += resolve_deps(fullsrcpath + sysrootdirlen, NULL);
else
ret += resolve_deps(fullsrcpath, NULL);
}
if (arg_hmac) {
/* copy .hmac files also */
hmac_install(src, dst, NULL);
}
if (resolvedeps) {
/* ensure fullsrcpath contains sysrootdir */
if (sysrootdirlen && (strncmp(fullsrcpath, sysrootdir, sysrootdirlen) == 0))
ret += resolve_deps(fullsrcpath + sysrootdirlen, NULL);
else
ret += resolve_deps(fullsrcpath, NULL);
}
if (arg_hmac) {
/* copy .hmac files also */
hmac_install(src, dst, NULL);
}

log_debug("dracut_install ret = %d", ret);
Expand Down
Loading