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

Re: svn system() replacement ?

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-01-28 10:51:33 CET

On Mon, Jan 28, 2002 at 09:59:38AM +0100, Daniel Stenberg wrote:
> The editor-code for commit does this right now:
>
> [psedo code]
>
> sprintf(buffer, "%s %s", editor, file)
> system(buffer)
>
> But, as reviewers pointed out, the svn_io_run_cmd() might be a better option.

It's not just a "better option" but a requirement :-) system() isn't
portable, and it isn't exactly the safest function in the world. Granted,
this is all client stuff, but I'd still not like to see system-based
exploits in the code.

>...
> After the function has run, the variables above say:
>
> (gdb) p exitcode
> $1 = 255

The program did an exit(-1). I believe this is also symptomatic of not
finding the program.

> (gdb) p exitwhy
> $2 = APR_PROC_EXIT

Standard exit.

> (gdb) p error
> $3 = (svn_error_t *) 0x0

No error.

> Can anyone tellme what I'm doing wrong or what am I missing?

It may be that your editor program isn't being found? Or is it actually
being popped up? (you didn't describe the behavior; only the exit)

CHeers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:00 2006

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.