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

Re: svn commit: r1823966 - in /subversion/trunk/subversion/svn: shelf-cmd.c shelve-cmd.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Mon, 12 Feb 2018 14:35:10 +0000

julianfoad_at_apache.org wrote on Mon, 12 Feb 2018 13:17 +0000:
> +++ subversion/trunk/subversion/svn/shelf-cmd.c Mon Feb 12 13:17:16 2018
> @@ -71,6 +71,36 @@ friendly_duration_str(apr_time_t duratio
> +#ifndef WIN32
> +/* Run CMD with ARGS.
> + * Send its stdout to the parent's stdout. Disconnect its stdin and stderr.
> + */
> +static svn_error_t *
> +run_cmd(const char *cmd,
> + const char *const *args,
> + apr_pool_t *scratch_pool)
> +++ subversion/trunk/subversion/svn/shelve-cmd.c Mon Feb 12 13:17:16
> 2018
> @@ -84,6 +84,36 @@ list_sorted_by_date(apr_array_header_t *
> +#ifndef WIN32
> +/* Run CMD with ARGS.
> + * Send its stdout to the parent's stdout. Disconnect its stdin and stderr.
> + */
> +static svn_error_t *
> +run_cmd(const char *cmd,
> + const char *const *args,
> + apr_pool_t *scratch_pool)

Why the duplication? We could deduplicate by renaming to svn_cl__run_cmd()
and declaring it in subversion/svn/*.h.

> @@ -79,14 +109,19 @@ show_diffstat(svn_client_shelf_version_t
> SVN_ERR(svn_client_shelf_get_patch_abspath(&patch_abspath, shelf_version,
> scratch_pool));
> + args[0] = "diffstat";
> + args[1] = "-p0";
> + args[2] = patch_abspath;
> + args[3] = NULL;
> + err = run_cmd("diffstat", args, scratch_pool);
> @@ -84,6 +84,36 @@ list_sorted_by_date(apr_array_header_t *
> + args[0] = "diffstat";
> + args[1] = "-p0";
> + args[2] = info->patch_path;
> + args[3] = NULL;

Maybe add "--" guards to these calls? The path arguments are absolute, but
a "--" guard would minimize the impact of any quoting bug in svn_io_run_cmd().

Cheers,

Daniel
Received on 2018-02-12 15:35:20 CET

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.