From: Karel Zak Date: Tue, 15 Jan 2019 10:44:25 +0000 (+0100) Subject: fsck.cramfs: fix utimes() usage X-Git-Tag: v2.34-rc1~157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12d12102d6e79c3627dbf0569f1c97b00202ce4c;p=thirdparty%2Futil-linux.git fsck.cramfs: fix utimes() usage The bug has been introduced by untested commit ad7ac3d598e2d541d9eba70975e68dff7e52c7d9 ;-( Signed-off-by: Karel Zak --- diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c index 76ed303b0e..ee9c20ab26 100644 --- a/disk-utils/fsck.cramfs.c +++ b/disk-utils/fsck.cramfs.c @@ -416,10 +416,10 @@ static void do_uncompress(char *path, int outfd, unsigned long offset, curr = next; } while (size); } - +#include static void change_file_status(char *path, struct cramfs_inode *i) { - const struct timeval epoch = { 0, 0 }; + const struct timeval epoch[] = { {0,0}, {0,0} }; if (euid == 0) { if (lchown(path, i->uid, i->gid) < 0) @@ -431,7 +431,7 @@ static void change_file_status(char *path, struct cramfs_inode *i) } if (S_ISLNK(i->mode)) return; - if (utimes(path, &epoch) < 0) + if (utimes(path, epoch) < 0) err(FSCK_EX_ERROR, _("utimes failed: %s"), path); }