aboutsummaryrefslogtreecommitdiff
path: root/src/port/exec.c
Commit message (Collapse)AuthorAge
* Switch dependency order of libpgcommon and libpgportPeter Eisentraut2013-10-17
| | | | | | | | | | | Continuing 63f32f3416a8b4f8e057dc184e8e8eae734ccc8a, libpgcommon should depend on libpgport, but not vice versa. But wait_result_to_str() in wait_error.c depends on pstrdup() in libpgcommon. So move exec.c and wait_error.c from libpgport to libpgcommon. Also switch the link order in the place that's actually used by the failing ecpg builds. The function declarations have been left in port.h for now. That should perhaps be separated sometime.
* Add support for piping COPY to/from an external program.Heikki Linnakangas2013-02-27
| | | | | | | | | | | | | | | | | | This includes backend "COPY TO/FROM PROGRAM '...'" syntax, and corresponding psql \copy syntax. Like with reading/writing files, the backend version is superuser-only, and in the psql version, the program is run in the client. In the passing, the psql \copy STDIN/STDOUT syntax is subtly changed: if you the stdin/stdout is quoted, it's now interpreted as a filename. For example, "\copy foo from 'stdin'" now reads from a file called 'stdin', not from standard input. Before this, there was no way to specify a filename called stdin, stdout, pstdin or pstdout. This creates a new function in pgport, wait_result_to_str(), which can be used to convert the exit status of a process, as returned by wait(3), to a human-readable string. Etsuro Fujita, reviewed by Amit Kapila.
* Update copyrights for 2013Bruce Momjian2013-01-01
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* Fix typo in comment for pclose_check() function.Kevin Grittner2012-09-12
| | | | | | Backpatch to 9.2. Etsuro Fujit
* Add strerror() string to chdir() error messagePeter Eisentraut2012-08-28
|
* Improve reporting of error situations in find_other_exec().Tom Lane2012-07-27
| | | | | | | | | | | This function suppressed any stderr output from the called program, which is unnecessary in the normal case and unhelpful in error cases. It also gave a rather opaque message along the lines of "fgets failure: Success" in case the called program failed to return anything on stdout. Since we've seen multiple reports of people not understanding what's wrong when pg_ctl reports this, improve the message. Back-patch to all active branches.
* Remove now redundant pgpipe code.Andrew Dunstan2012-03-28
|
* Update copyright notices for year 2012.Bruce Momjian2012-01-01
|
* Use consistent format for reporting GetLastError()Peter Eisentraut2011-08-23
| | | | | | Use something like "error code %lu" for reporting GetLastError() values on Windows. Previously, a mix of different wordings and formats were in use.
* pgindent run before PG 9.1 beta 1.Bruce Momjian2011-04-10
|
* Rename function to first_path_var_separator() to clarify it works withBruce Momjian2011-02-02
| | | | path variables, not directory paths.
* Stamp copyrights for year 2011.Bruce Momjian2011-01-01
|
* Avoid clobbering errno, per comment from Tom.Alvaro Herrera2010-12-16
|
* Fix inconsequential FILE pointer leakageAlvaro Herrera2010-12-16
|
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* pgindent run for 9.0Bruce Momjian2010-02-26
|
* Simplify validate_exec() by using access(2) to check file permissions,Tom Lane2010-01-14
| | | | | | | | | | rather than trying to implement the equivalent logic by hand. The motivation for the original coding appears to have been to check with the effective uid's permissions not the real uid's; but there is no longer any difference, because we don't run the postmaster setuid (indeed, main.c enforces that they're the same). Using access() means we will get it right in situations the original coding failed to handle, such as ACL-based permissions. Besides it's a lot shorter, cleaner, and more thread-safe. Per bug #5275 from James Bellinger.
* Update copyright for the year 2010.Bruce Momjian2010-01-02
|
* Add inheritable ACE when creating a restricted token for execution onMagnus Hagander2009-11-14
| | | | | | | | Win32. Also refactor the code around it to be more clear. Jesse Morris
* Fix minor memory leak in Win32 SID handling functions. Not a big issueMagnus Hagander2009-07-27
| | | | | | | since it's only called during process startup, thus no backpatch. Found by TAKATSUKA Haruka, patch by Magnus Hagander and Andrew Chernow
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Append major version number and for libraries soname major version numberPeter Eisentraut2008-12-11
| | | | | | | to the gettext domain name, to simplify parallel installations. Also, rename set_text_domain() to pg_bindtextdomain(), because that is what it does.
* Fix MinGW warnings re formats and unused variables. per ITAGAKI TakahiroAndrew Dunstan2008-04-16
|
* Fix a number of places that were making file-type tests infelicitously.Tom Lane2008-03-31
| | | | | | | | | | | | | | | | | The places that did, eg, (statbuf.st_mode & S_IFMT) == S_IFDIR were correct, but there is no good reason not to use S_ISDIR() instead, especially when that's what the other 90% of our code does. The places that did, eg, (statbuf.st_mode & S_IFDIR) were flat out *wrong* and would fail in various platform-specific ways, eg a symlink could be mistaken for a regular file on most Unixen. The actual impact of this is probably small, since the problem cases seem to always involve symlinks or sockets, which are unlikely to be found in the directories that PG code might be scanning. But it's clearly trouble waiting to happen, so patch all the way back anyway. (There seem to be no occurrences of the mistake in 7.4.)
* Fix handling of restricted processes for Windows Vista (mainly),Magnus Hagander2008-02-29
| | | | | | | | | by explicitly adding back the user to the DACL of the new process. This fixes the failure case when executing as the Administrator user, which had no permissions left at all after we dropped the Administrators group. Dave Page with some modifications from me
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Use sizeof() for snprintf() buffer length.Bruce Momjian2007-01-29
|
* Update process termination message to display signal number and nameBruce Momjian2007-01-29
| | | | from exec.c and postmaster.c.
* Drat, can't fit an additional argument into log_error. Is it worth anTom Lane2007-01-28
| | | | | sprintf pushup to be sure we can report something useful for out-of-range exitstatus?
* Clean up broken usage of HAVE_DECL_SYS_SIGLIST and inconsistent/poorlyTom Lane2007-01-28
| | | | formatted error messages.
* Use autoconf build-in sys_siglist macro AC_DECL_SYS_SIGLIST, rather thanBruce Momjian2007-01-28
| | | | create our own.
* Add signal.h for sys_siglist reference.Bruce Momjian2007-01-28
|
* Use sys_siglist[] to print out signal names for signal exits, ratherBruce Momjian2007-01-28
| | | | than just numbers.
* Remove newline from error message because URL is gone.Bruce Momjian2007-01-23
|
* Back out use of FormatMessage(), does error values, not exceptionBruce Momjian2007-01-23
| | | | | values. Point to /include/ntstatus.h for an exception list, rather than a URL.
* Print meaningfull error text for abonormal process exit on Win32, ratherBruce Momjian2007-01-23
| | | | than hex codes, using FormatMessage().
* When system() fails in Win32, report it as an exception, print theBruce Momjian2007-01-22
| | | | exception value in hex, and give a URL where the value can be looked-up.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* Move set_pglocale_pgservice() from path.c to exec.c, so that pulling inTom Lane2006-09-11
| | | | | path.c does not in itself force linking of both exec.c and libintl. Should fix current ecpglib build failure on pickier platforms.
* Prepare code to be built by MSVC:Bruce Momjian2006-06-07
| | | | | | | | | | o remove many WIN32_CLIENT_ONLY defines o add WIN32_ONLY_COMPILER define o add 3rd argument to open() for portability o add include/port/win32_msvc directory for system includes Magnus Hagander
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Use _() macro consistently rather than gettext(). Add translationBruce Momjian2005-02-22
| | | | macros around strings that were missing them.
* Add missing gettext() calls in find_my_exec(). It's probably too lateTom Lane2005-01-14
| | | | | to get these strings translated, but we may as well have them be translatable as not.
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-31
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Remove 'optimization' to skip resolve_symlinks() when the foundTom Lane2004-12-24
| | | | | | | | executable file isn't itself a symlink. We still need to run the algorithm so that any directory symlinks in the path to the executable are replaced by a true path. Noticed this on seeing pg_config give me a completely wrong answer for --pkglibdir when I called it through a symlink to the installation bindir.
* In pipe_read_line Windows code, loop to ensure we get a whole lineTom Lane2004-12-20
| | | | | from the child process; fixes observed problems when the returned version number is '8.0.0' rather than '8.0.0rc1'. Magnus Hagander