Index: subversion/svnserve/main.c =================================================================== --- subversion/svnserve/main.c (revision 22552) +++ subversion/svnserve/main.c (working copy) @@ -40,6 +40,7 @@ #include "svn_repos.h" #include "svn_fs.h" #include "svn_version.h" +#include "svn_io.h" #include "svn_private_config.h" #include "winservice.h" @@ -324,6 +325,7 @@ int family = APR_INET; int mode_opt_count = 0; const char *pid_filename = NULL; + svn_node_kind_t kind; /* Initialize the app. */ if (svn_cmdline_init("svnserve", stderr) != EXIT_SUCCESS) @@ -360,7 +362,11 @@ if (err) return svn_cmdline_handle_exit_error(err, pool, "svnserve: "); +#ifdef WIN32 + params.root = NULL; +#else params.root = "/"; +#endif /* WIN32 */ params.tunnel = FALSE; params.tunnel_user = NULL; params.read_only = FALSE; @@ -432,6 +438,24 @@ case 'r': SVN_INT_ERR(svn_utf_cstring_to_utf8(¶ms.root, arg, pool)); + + err = svn_io_check_resolved_path(params.root, &kind, pool); + if (err) + { + svn_handle_error2(err, stderr, FALSE, "svnserve: "); + svn_error_clear(err); + return EXIT_FAILURE; + } + if (kind != svn_node_dir) + { + svn_error_clear + (svn_cmdline_fprintf + (stderr, pool, + _("svnserve: Root path '%s' does not exist " + "or is not a directory.\n"), params.root)); + return EXIT_FAILURE; + } + params.root = svn_path_internal_style(params.root, pool); SVN_INT_ERR(svn_path_get_absolute(¶ms.root, params.root, pool)); break; @@ -463,6 +487,18 @@ } } + +#ifdef WIN32 + if (! params.root) + { + svn_error_clear + (svn_cmdline_fputs + (_("You must specify a root path with the --root option.\n"), + stderr, pool)); + return EXIT_FAILURE; + } +#endif /* WIN32 */ + if (os->ind != argc) usage(argv[0], pool);