summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-04-25 19:44:01 +0200
committerHarald Hoyer <harald@redhat.com>2013-04-25 19:44:01 +0200
commit6f4c2dada400f455cf7ee0afcd6bf41974c712d4 (patch)
tree54e8f00b390e813ca5217057b022442ea660e796 /install
parentab42fe38fd1672f83cd3500771caf321ae25080d (diff)
downloaddracut-6f4c2dada400f455cf7ee0afcd6bf41974c712d4.tar.gz
dracut-6f4c2dada400f455cf7ee0afcd6bf41974c712d4.tar.bz2
dracut-6f4c2dada400f455cf7ee0afcd6bf41974c712d4.zip
fixed fips mode
- preserve timestamps - copy /lib*/hmaccalc files - run sha512hmac after kernel module loading - add more fips kernel modules
Diffstat (limited to 'install')
-rw-r--r--install/dracut-install.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/install/dracut-install.c b/install/dracut-install.c
index 2d0412c1..2fad6df1 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -214,8 +214,14 @@ static int cp(const char *src, const char *dst)
ret = clone_file(dest_desc, source_desc);
close(source_desc);
if (ret == 0) {
+ struct timeval tv[2];
if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0)
fchown(dest_desc, -1, sb.st_gid);
+ tv[0].tv_sec = sb.st_atime;
+ tv[0].tv_usec = 0;
+ tv[1].tv_sec = sb.st_mtime;
+ tv[1].tv_usec = 0;
+ futimes(dest_desc, tv);
close(dest_desc);
return ret;
}
@@ -230,7 +236,7 @@ static int cp(const char *src, const char *dst)
normal_copy:
pid = fork();
if (pid == 0) {
- execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode", "-fL", src, dst, NULL);
+ execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps", "-fL", src, dst, NULL);
_exit(EXIT_FAILURE);
}
@@ -350,6 +356,8 @@ static int hmac_install(const char *src, const char *dst, const char *hmacpath)
if (!hmacpath) {
hmac_install(src, dst, "/lib/fipscheck");
hmac_install(src, dst, "/lib64/fipscheck");
+ hmac_install(src, dst, "/lib/hmaccalc");
+ hmac_install(src, dst, "/lib64/hmaccalc");
}
srcpath[dlen] = '\0';