2.5.6 needs following fix on WinNTs

jw schultz jw at pegasys.ws
Tue Mar 4 10:16:03 EST 2003


On Mon, Mar 03, 2003 at 04:24:10PM +0100, Andrzej Pruszynski wrote:
> 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);
> }

I think this belongs in sanitize_path(), not here.
I know it shouldn't be dependent of O_BINARY.
It should probably be done only for those few systems that
have a problem with double leading //

-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt


More information about the rsync mailing list