subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1849190 - in /subversion/trunk: subversion/svn/svn.c subversion/svn/util.c tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c tools/client-side/svnconflict/svnconflict.c tools/server-side/svnauthz.c
Date Tue, 18 Dec 2018 16:17:59 GMT
Author: brane
Date: Tue Dec 18 16:17:58 2018
New Revision: 1849190

URL: http://svn.apache.org/viewvc?rev=1849190&view=rev
Log:
Start using the safe canonicalize and internal_style functions.

* subversion/svn/svn.c
  (sub_main): Use svn_dirent_internal_style_safe().
* subversion/svn/util.c
  (svn_cl__merge_file_externally): Add comment explaining why we don't have
   to use the 'safe' version in this case.

* tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
  (svn_dirent_internal_style_safe): Use svn_dirent_internal_style_safe().
* tools/client-side/svnconflict/svnconflict.c
  (sub_main): Use svn_dirent_internal_style_safe().

* tools/server-side/svnauthz.c
  (subcommand_accessof): Use svn_dirent_internal_style_safe().
  (canonicalize_access_file): Likewise, also use svn_uri_canonicalize_safe().
  (sub_main): Use svn_dirent_internal_style_safe().

Modified:
    subversion/trunk/subversion/svn/svn.c
    subversion/trunk/subversion/svn/util.c
    subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
    subversion/trunk/tools/client-side/svnconflict/svnconflict.c
    subversion/trunk/tools/server-side/svnauthz.c

Modified: subversion/trunk/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1849190&r1=1849189&r2=1849190&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Tue Dec 18 16:17:58 2018
@@ -2637,7 +2637,8 @@ sub_main(int *exit_code, int argc, const
         break;
       case opt_config_dir:
         SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
-        opt_state.config_dir = svn_dirent_internal_style(utf8_opt_arg, pool);
+        SVN_ERR(svn_dirent_internal_style_safe(&opt_state.config_dir, NULL,
+                                               utf8_opt_arg, pool, pool));
         break;
       case opt_config_options:
         if (!opt_state.config_options)
@@ -3220,7 +3221,10 @@ sub_main(int *exit_code, int argc, const
         {
           svn_node_kind_t kind;
           const char *local_abspath;
-          const char *fname = svn_dirent_internal_style(dash_F_arg, pool);
+          const char *fname;
+
+          SVN_ERR(svn_dirent_internal_style_safe(&fname, NULL, dash_F_arg,
+                                                 pool, pool));
 
           err = svn_dirent_get_absolute(&local_abspath, fname, pool);
 

Modified: subversion/trunk/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/util.c?rev=1849190&r1=1849189&r2=1849190&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/util.c (original)
+++ subversion/trunk/subversion/svn/util.c Tue Dec 18 16:17:58 2018
@@ -163,6 +163,8 @@ svn_cl__merge_file_externally(const char
     arguments[5] = wc_path;
     arguments[6] = NULL;
 
+    /* Presumably apr_filepath_get() returns a valid path, so we don't have
+       to use the safe version of svn_dirent_internal_style() here. */
     SVN_ERR(svn_io_run_cmd(svn_dirent_internal_style(cwd, pool), merge_tool,
                            arguments, &exitcode, NULL, TRUE, NULL, NULL, NULL,
                            pool));

Modified: subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c?rev=1849190&r1=1849189&r2=1849190&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
(original)
+++ subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
Tue Dec 18 16:17:58 2018
@@ -566,7 +566,8 @@ sub_main(int *exit_code, int argc, const
         break;
       case opt_config_dir:
         SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
-        opt_state.config_dir = svn_dirent_internal_style(utf8_opt_arg, pool);
+        SVN_ERR(svn_dirent_internal_style_safe(&opt_state.config_dir, NULL,
+                                               utf8_opt_arg, pool, pool));
         break;
       case opt_config_options:
         if (!opt_state.config_options)

Modified: subversion/trunk/tools/client-side/svnconflict/svnconflict.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/svnconflict/svnconflict.c?rev=1849190&r1=1849189&r2=1849190&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/svnconflict/svnconflict.c (original)
+++ subversion/trunk/tools/client-side/svnconflict/svnconflict.c Tue Dec 18 16:17:58 2018
@@ -717,7 +717,8 @@ sub_main(int *exit_code, int argc, const
         break;
       case opt_config_dir:
         SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
-        opt_state.config_dir = svn_dirent_internal_style(utf8_opt_arg, pool);
+        SVN_ERR(svn_dirent_internal_style_safe(&opt_state.config_dir, NULL,
+                                               utf8_opt_arg, pool, pool));
         break;
       case opt_config_options:
         if (!opt_state.config_options)

Modified: subversion/trunk/tools/server-side/svnauthz.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnauthz.c?rev=1849190&r1=1849189&r2=1849190&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnauthz.c (original)
+++ subversion/trunk/tools/server-side/svnauthz.c Tue Dec 18 16:17:58 2018
@@ -395,7 +395,12 @@ subcommand_accessof(apr_getopt_t *os, vo
 static svn_boolean_t
 use_compat_mode(const char *cmd, apr_pool_t *pool)
 {
-  cmd = svn_dirent_internal_style(cmd, pool);
+  svn_error_t *err = svn_dirent_internal_style_safe(&cmd, NULL, cmd, pool, pool);
+  if (err)
+    {
+      svn_error_clear(err);
+      return FALSE;
+    }
   cmd = svn_dirent_basename(cmd, NULL);
 
   /* Skip over the Libtool command prefix if it exists on the command. */
@@ -437,7 +442,9 @@ canonicalize_access_file(const char **ca
                                    access_file);
         }
 
-      *canonicalized_access_file = svn_uri_canonicalize(access_file, pool);
+      SVN_ERR(svn_uri_canonicalize_safe(
+                  canonicalized_access_file, NULL,
+                  access_file, pool, pool));
     }
   else if (within_txn)
     {
@@ -450,8 +457,9 @@ canonicalize_access_file(const char **ca
     {
       /* If it isn't a URL and there's no transaction flag then it's a
        * dirent to the access file on local disk. */
-      *canonicalized_access_file =
-          svn_dirent_internal_style(access_file, pool);
+      SVN_ERR(svn_dirent_internal_style_safe(
+                  canonicalized_access_file, NULL,
+                  access_file, pool, pool));
     }
 
   return SVN_NO_ERROR;
@@ -626,7 +634,9 @@ sub_main(int *exit_code, int argc, const
                                               pool));
           os->ind++;
 
-          opt_state.repos_path = svn_dirent_internal_style(opt_state.repos_path, pool);
+          SVN_ERR(svn_dirent_internal_style_safe(&opt_state.repos_path, NULL,
+                                                 opt_state.repos_path,
+                                                 pool, pool));
         }
 
       /* Exactly 1 non-option argument */



Mime
View raw message