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

Outdated check in import?

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Thu, 19 Apr 2012 08:26:41 -0500

I've been poking around import, and I discovered this snippet of
decade-old code:

  /* The repository doesn't know about the reserved administrative
     directory. */
  if (new_entries->nelts
      /* What's this, what's this? This assignment is here because we
         use the value to construct the error message just below. It
         may not be aesthetically pleasing, but it's less ugly than
         calling APR_ARRAY_IDX twice. */
      && svn_wc_is_adm_dir(temp = APR_ARRAY_IDX(new_entries,
                                                new_entries->nelts - 1,
                                                const char *),
                           scratch_pool))
    return svn_error_createf
      (SVN_ERR_CL_ADM_DIR_RESERVED, NULL,
       _("'%s' is a reserved name and cannot be imported"),
       svn_dirent_local_style(temp, scratch_pool));

new_entries is the list of basenames of to-be-created parents (similar
to what happens with 'mkdir --parents'). It appears this is a very
specific check that if the second-to-last of those basenames is the wc
admin directory, don't do the import.

I'm trying to figure out if this is still a valid check. It feels
like it's looking at a very specific case, and there are any number of
ways a determined user to circumvent this check. And even if they
did, it's not illegal, folks would just end up with '.svn' in the
repository.

It feels like this is just a relic of a bygone era when users were
still experimenting with Subversion, and I just have a hard time
seeing it as needed these days.

Thoughts?

-Hyrum

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2012-04-19 15:27:15 CEST

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.