[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

WinNT svn import issue

From: Mats Nilsson <mats.nilsson_at_xware.se>
Date: 2001-06-29 10:39:17 CEST

Hi list

I've started to investigate the WinNT import problem. Two of the problems
are directly related to apr, while one is related to subversion's use of
apr. None of this have been reported to the apr team.

The problems are these:

1. Sometimes the apr translates the import directory name into something
that certain Win32 functions don't like.

Specifically if the directory to be imported is given like "d:/some/dir",
this gets translated inside apr into "\\?\d:\some\dir", a filename format
that GetNamedSecurityInfoW will not accept.

On the other hand, if the directory name is given like "d:\some\dir", the
translation will not take place, and the above mentioned function works.

2. There is a bug in apr\file_io\win32\dir.c (apr_dir_read). Subsequent
calls to this function will cause the internal variable wdirname to build up.

This function is repeatedly called from libsvn_client/commit.c (import_dir)
to read directory entries.

The first time wdirname contains d:\some\dir\.
Second time d:\some\dir\...
Third time d:\some\dir\...somefile.txt

*** apr.orig/file_io/win32/dir.c Thu Apr 12 18:26:22 2001
--- apr/file_io/win32/dir.c Fri Jun 29 10:08:28 2001
*** 222,227 ****
--- 222,228 ----
           if (os_level >= APR_WIN_NT) {
+ apr_status_t err;
               /* Almost all our work is done. Tack on the wide file name
                * to the end of the wdirname (already / delimited)
*** 228,234 ****
               if (!eos)
                   eos = wcschr(wdirname, '\0');
               wcscpy(eos, thedir->w.entry->cFileName);
! return more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC,
           else {
               /* Don't waste stack space on a second buffer, the one we set
--- 229,237 ----
               if (!eos)
                   eos = wcschr(wdirname, '\0');
               wcscpy(eos, thedir->w.entry->cFileName);
! err = more_finfo(finfo, wdirname, wanted, MORE_OF_WFSPEC,
! eos[0] = '\0';
! return err;
           else {
               /* Don't waste stack space on a second buffer, the one we set

3. libsvn_client/commit.c (import_dir), the calls to apr_dir_read takes a
parameter APR_FINFO_NORM, indicating that all of the files attributes are
to be retrieved. This might be fine on a *nix system, but on WinNT
requesting dev and inode doesn't make sense.

the problem, but maybe this is still an overkill. Wouldn't APR_FINFO_DIRENT
be enough?


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:32 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.