-
Notifications
You must be signed in to change notification settings - Fork 50
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
copyExecutable function overwrites file perfmission for non owners #125
Comments
It seems in sbt 0.13.x, the file permission was retained. |
We need to retain the original file permission before setting these flags. I'll create a PR to fix this. |
@eed3si9n One question. Should we add |
If you need more detailed permission, maybe use POSIX permission operations that were added in #76? |
@eed3si9n Yes. That is an option as well. If disregarding the source file permission is the expected behavior, sbt-pack sets the permission manually. If not, sbt-io needs to be modified to retain the original permission. |
For preserving the original file permission, setting preserveExecutable=false conflicts with preservePermssion (like |
In sbt 0.13 there was no parameter on
Disregarding the source file permission, sort of is the behavior of In reality, as you point out, the result came out to be inconsistent and clumsy at least on the system that you're testing (macOS?). I am not sure how we should proceed on this. At the least, copyExecutable should NOT lose permission. /cc @dwijnand |
Is this your observation from running the code? |
I just tested on macOS, and I was not able to reproduce the behavior that preserves the permission in 0.13. scala> IO.copyFile(new File("/tmp/io/A.sh"), new File("/tmp/io/B.sh"), false)
scala> IO.copyFile(new File("/tmp/io/A.sh"), new File("/tmp/io/C.sh"), true) Here's the result:
|
Right. also it makes copying POSIX specific, so Windows ppl might run into issues. |
Pending question here - xerial/sbt-pack#135 (comment) |
@eed3si9n I responded in the referenced issue. |
In the current implementation, copyExecutable does not favor the original file permission except the file owner:
For example, if the original file permission is 775 (rwxrwxr-x), and copied by sbt.io.IO.copyExecutable, it will results in 764 (rwxrw-r--) executable flag are removed from the group and others).
We've found this issue in xerial/sbt-pack#135
The text was updated successfully, but these errors were encountered: