Skip to content

zstd -t modifies /dev/null file mode bits #851

@ghost

Description

If I run "zstd -t" as root on a Linux system, zstd modifies file mode bits of /dev/null:

# ls -la /dev/null
crw-rw-rw- 1 root root 1, 3 Sep 18 13:12 /dev/null

# zstd -t linux.tgz
linux.tgz : 27002880 bytes

# ls -la /dev/null
crw-r----- 1 root root 1, 3 Sep 18 13:12 /dev/null

A strace shows:

# strace -o trace.txt -f zstd -t linux.tgz
linux.tgz : 27002880 bytes

# grep "/dev/null" trace.txt
20269 open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
20269 utime("/dev/null", {actime=2017-09-18T13:50:14+0200, modtime=2017-09-18T13:12:41+0200}) = 0
20269 chown("/dev/null", 0, 0) = 0
20269 chmod("/dev/null", 0640) = 0

I see this bug with version 1.3.0 and version 1.3.1. I didn't test earlier versions.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions