Skip to content

Commit

Permalink
Preserve device file mode during untar to actually create devices wit…
Browse files Browse the repository at this point in the history
…h mknod, not files
  • Loading branch information
folbricht committed Aug 3, 2019
1 parent 2c00bf2 commit b5d3c38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion untar.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func makeDevice(base string, n NodeDevice, opts UntarOptions) error {
if err := syscall.Unlink(dst); err != nil && !os.IsNotExist(err) {
return err
}
if err := syscall.Mknod(dst, 0666, int(mkdev(n.Major, n.Minor))); err != nil {
if err := syscall.Mknod(dst, uint32(n.Mode)|0666, int(mkdev(n.Major, n.Minor))); err != nil {
return errors.Wrapf(err, "mknod %s", dst)
}
if !opts.NoSameOwner {
Expand Down

0 comments on commit b5d3c38

Please sign in to comment.