Re: The --password and clumsy users issue
From: Gabriela Gibson <gabriela.gibson_at_gmail.com>
Date: Fri, 4 Jul 2014 00:50:24 +0100
Oh, I was playing about with this earlier, but didn't get all that far:
I go this far in svn.c (has breakpoint marker in it)
[[[
main(int argc, char **argv)
{
apr_pool_t *pool;
int exit_code = EXIT_SUCCESS;
svn_error_t *err;
const char **argv_org;
/* Initialize the app. */
if (svn_cmdline_init("svn", stderr) != EXIT_SUCCESS)
return EXIT_FAILURE;
/* Create our top-level pool. Use a separate mutexless allocator,
* given this application is single threaded.
*/
pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
{
argv_org = apr_palloc(pool, sizeof(argv));
B for(i = 0; i < argc; i++)
{
argv_org[i] = apr_pstrdup(pool, argv[i]);
if (i > 2 && !strcmp(argv[i-1],"--password"))
{
argv[i-1] = "#####\0";
}
if (i > 2 && !strcmp(argv[i-1],"--username"))
{
argv[i-1] = "#####\0";
}
}
}
it compiles and runs and in gdb the vars do change, but the compiler isn't
subversion/svn/svn.c:3048:23: warning: assignment discards 'const'
argv[i-1] = "#####\0";
^
subversion/svn/svn.c:3052:23: warning: assignment discards 'const'
argv[i-1] = "#####\0";
At breakpoint B, gdb gives me:
(gdb) p argv
$1 = (char **) 0x7fffffffe468
(gdb) p argv[1]
$2 = 0x7fffffffe81e "svn"
(gdb) p argv[2]
$3 = 0x7fffffffe822 "help"
(gdb) p argv[3]
$4 = 0x4438b3 "#####"
(gdb)
So it def. does change it.
On Fri, Jul 4, 2014 at 12:40 AM, Ben Reser <ben_at_reser.org> wrote:
> On 7/3/14 4:23 PM, Gabriela Gibson wrote:
-- Visit my Coding Diary: http://gabriela-gibson.blogspot.com/Received on 2014-07-04 01:50:57 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.