mirror of
https://github.com/containers/youki
synced 2024-11-22 17:02:00 +01:00
Don't create a file when it already exists when mounting with bind (#2031)
For example, it is more likely that the /etc/hosts file already exists. In that case, it fails because it tries to open the file with write permission while it is RO. Signed-off-by: utam0k <k0ma@utam0k.jp>
This commit is contained in:
parent
3251599f0f
commit
f5f2242f85
@ -497,7 +497,7 @@ impl Mount {
|
||||
err
|
||||
})?;
|
||||
|
||||
if src.is_file() {
|
||||
if src.is_file() && !dest.exists() {
|
||||
OpenOptions::new()
|
||||
.create(true)
|
||||
.write(true)
|
||||
|
@ -78,8 +78,6 @@ tracepoint:syscalls:sys_enter_setresuid
|
||||
printf("ruid=%d, euid=%d, suid=%d\n", args->ruid, args->euid, args->suid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
END
|
||||
{
|
||||
clear(@filename);
|
||||
|
Loading…
Reference in New Issue
Block a user