Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mv loses file permissions on some linux systems #26907

Closed
staticfloat opened this issue Apr 25, 2018 · 3 comments · Fixed by #27295
Closed

mv loses file permissions on some linux systems #26907

staticfloat opened this issue Apr 25, 2018 · 3 comments · Fixed by #27295
Labels
bug Indicates an unexpected problem or unintended behavior filesystem Underlying file system and functions that use it system:linux Affects only Linux

Comments

@staticfloat
Copy link
Member

staticfloat commented Apr 25, 2018

Over the course of debugging JuliaLang/Pkg.jl#261, @KristofferC and I discovered that, on some Linux systems, moving a file from /tmp/ to a folder on the local filesystem loses permissions set on it, e.g. a file goes from 0775 to 0664. This seems to have some interaction with it being moved from one filesystem to another.

Example:

shell> mkdir /home/sabae/file_test

shell> mkdir /tmp/file_test

shell> cd /tmp/file_test
/tmp/file_test

shell> touch foo

shell> chmod +x foo

shell> ls -la
total 0
drwxr-xr-x   2 sabae sabae   60 Apr 25 14:17 .
drwxrwxrwt 198 root  root  4720 Apr 25 14:16 ..
-rwxr-xr-x   1 sabae sabae    0 Apr 25 14:17 foo

julia> mv("foo", "/home/sabae/file_test/foo")

shell> ls -la /home/sabae/file_test/
total 8
drwxr-xr-x  2 sabae sabae 4096 Apr 25 14:17 .
drwx------ 53 sabae sabae 4096 Apr 25 14:16 ..
-rw-r--r--  1 sabae sabae    0 Apr 25 14:17 foo

This is happening on the latest master:

Julia Version 0.7.0-DEV.4941
Commit 9f5351c36a (2018-04-24 14:26 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E3-1230 v6 @ 3.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake)
Environment:

The relevant lines from mount:

$ mount
/dev/sda2 on / type ext4 (rw,relatime,data=ordered)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
@staticfloat staticfloat added bug Indicates an unexpected problem or unintended behavior system:linux Affects only Linux filesystem Underlying file system and functions that use it labels Apr 25, 2018
@fredrikekre
Copy link
Member

See also #20925

@KristofferC
Copy link
Member

Anything that can be done to work around this?

@staticfloat
Copy link
Member Author

Confirmed that #27295 fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior filesystem Underlying file system and functions that use it system:linux Affects only Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants