-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Inplace flag overwrites symlinks with file contents when data file and /tmp are on the same partition #2155
Comments
Verbose log when
|
Verbose log when
|
Don't use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The
-i
inplace flag overwrites symlinks with the file contents instead of modifying the symlinked file when data file and /tmp are on the same partition.Version of yq: v4.44.3
Operating system: linux
Installed via: binary release
Thanks to #1306 for helping me investigate the root cause.
Input Yaml
data1.yml
is on a the same filesystem partition as/tmp
data1.yml:
data2.yml:
symlink to data1.yml
Command
The command you ran:
Actual behavior
Before running yq command
After running yq command
$ ls -l | grep data -rw-rw-r-- 1 sestegra sestegra 50 Sep 21 14:55 data1.yml -rw-rw-r-- 1 sestegra sestegra 67 Sep 21 14:58 data2.yml
Expected behavior
data2.yml
file must be a symlink after update.Additional context
If the same command is ran with
data1.yml
and/tmp
on different filesystem partitions, it works as expected.The difference occurs when calling
renameat
. If on a different partitions, the first strace occurs.The text was updated successfully, but these errors were encountered: