MCPcopy Create free account
hub / github.com/RsyncProject/rsync / do_open_checklinks

Function do_open_checklinks

syscall.c:2143–2149  ·  view source on GitHub ↗

varient of do_open/do_open_nofollow which does do_open() if the copy_links or copy_unsafe_links options are set and does do_open_nofollow() otherwise This is used to prevent a race condition where an attacker could be switching a file between being a symlink and being a normal file The open is always done with O_RDONLY flags */

Source from the content-addressed store, hash-verified

2141 The open is always done with O_RDONLY flags
2142 */
2143int do_open_checklinks(const char *pathname)
2144{
2145 if (copy_links || copy_unsafe_links) {
2146 return do_open(pathname, O_RDONLY, 0);
2147 }
2148 return do_open_nofollow(pathname, O_RDONLY);
2149}

Callers 4

send_filesFunction · 0.85
file_checksumFunction · 0.85
make_fileFunction · 0.85
recv_generatorFunction · 0.85

Calls 2

do_openFunction · 0.85
do_open_nofollowFunction · 0.85

Tested by

no test coverage detected