2.5.6 needs following fix on WinNTs

Andrzej Pruszynski andrzej.pruszynski at autodesk.com
Tue Mar 4 02:24:10 EST 2003


Hi,

Here is the problem (syscall.c, function do_open) on NT, Win2K, WinXP,
with stripped "/" for UNC path convention, detected in release 2.5.5,
2.5.6:

int do_open(char *pathname, int flags, mode_t mode)
{
 if (flags != O_RDONLY) {
     if (dry_run) return -1;
     CHECK_RO
 }
#ifdef O_BINARY
 /* for Windows */
 flags |= O_BINARY;
#endif

 /* some systems can't handle a double / */
 if (pathname[0] == '/' && pathname[1] == '/') pathname++;

 return open(pathname, flags, mode);
}

I suggest the following fix, allowing files to be open even on WinNTs,
if UNC path is provided:

int do_open(char *pathname, int flags, mode_t mode)
{
 if (flags != O_RDONLY) {
     if (dry_run) return -1;
     CHECK_RO
 }
#ifdef O_BINARY
 /* for Windows */
 flags |= O_BINARY;
#else
 /* some systems can't handle a double / */
 if (pathname[0] == '/' && pathname[1] == '/') pathname++;
#endif

 return open(pathname, flags, mode);
}

Cheers,

Andrzej Pruszynski
Autodesk Sarl
Switzerland


More information about the rsync mailing list