mirror of
https://github.com/schoebel/mars
synced 2024-12-22 06:40:52 +00:00
main: safeguard creation of orphaned files
This commit is contained in:
parent
9491714e28
commit
a615ef907b
@ -2765,6 +2765,10 @@ int run_bone(struct mars_peerinfo *peer, struct mars_dent *remote_dent)
|
||||
if (is_deleted ?
|
||||
(stat_ok && update_mtime) :
|
||||
(!stat_ok || update_mtime)) {
|
||||
/* safeguard any replacement of files with symlinks */
|
||||
if (stat_ok && S_ISREG(local_stat.mode)) {
|
||||
(void)mars_unlink(remote_path);
|
||||
}
|
||||
status = ordered_symlink(remote_dent->new_link,
|
||||
remote_path,
|
||||
&remote_dent->new_stat.mtime);
|
||||
|
Loading…
Reference in New Issue
Block a user