Skip to content

Commit

Permalink
Sqfstar: implement -root-time
Browse files Browse the repository at this point in the history
Due to an oversight, the code for this option was not written.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
  • Loading branch information
plougher committed Jul 30, 2022
1 parent 8969c4c commit 24a5248
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions squashfs-tools/mksquashfs.h
Expand Up @@ -235,6 +235,8 @@ extern struct pathnames *paths;
extern int tarfile;
extern int root_mode_opt;
extern mode_t root_mode;
extern int root_time_opt;
extern unsigned int root_time;
extern struct inode_info *inode_info[INODE_HASH_SIZE];

extern int read_fs_bytes(int, long long, long long, void *);
Expand Down
5 changes: 4 additions & 1 deletion squashfs-tools/tar.c
Expand Up @@ -1581,7 +1581,10 @@ squashfs_inode process_tar_file(int progress)
buf.st_mode = S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR;
buf.st_uid = getuid();
buf.st_gid = getgid();
buf.st_mtime = time(NULL);
if(root_time_opt)
buf.st_mtime = root_time;
else
buf.st_mtime = time(NULL);
buf.st_dev = 0;
buf.st_ino = 0;
dir_ent->inode = lookup_inode(&buf);
Expand Down

0 comments on commit 24a5248

Please sign in to comment.