Re: execve() vs system() for chrooted filesystems in dbcommands.c - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: execve() vs system() for chrooted filesystems in dbcommands.c
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE4569F1@algol.sollentuna.se
Whole thread Raw
In response to execve() vs system() for chrooted filesystems in dbcommands.c  (Tom F <tom@printf.net>)
List pgsql-hackers
> The only argument against it, that I'm aware of, is that
> system() is ANSI, while execve() is POSIX: i.e.
> portability... does windows have execve()? That could be done
> the way the current preprocessor conditionals yield rmdir
> instead of rm.

Windows does have execve(), though it's named _execve(). Not sure if
that means it has slightly different behaviour than on Unix. See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/h
tml/_crt__execve.2c_._wexecve.asp.

But looking at the code you will notice that win32 already does not use
system() - copydir() is available to do it internally. Haven't looked at
the details, but perhaps this can just be used straight off on Unix as
well.

From what I can tell, rm is also handled in the rmtree() function, and
not by system(), since version 1.138 of dbcommands.c.

//Magnus



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: libpq and prepared statements progress for 8.0
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: libpq and prepared statements progress for 8.0