X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/2b086e033cfcf377d6668ae121a7142766f4a6e8..14175f1e7700e4e800692fc2c466cbd27a60176e:/syscall.c diff --git a/syscall.c b/syscall.c index 58760664..56d88b48 100644 --- a/syscall.c +++ b/syscall.c @@ -76,12 +76,17 @@ int do_rmdir(char *pathname) int do_open(char *pathname, int flags, mode_t mode) { - if (dry_run) return -1; + if (flags != O_RDONLY) { + if (dry_run) return -1; + CHECK_RO + } #ifdef O_BINARY /* for Windows */ flags |= O_BINARY; #endif - CHECK_RO + /* some systems can't handle a double / */ + if (pathname[0] == '/' && pathname[1] == '/') pathname++; + return open(pathname, flags, mode); }