summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-06-24 21:03:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-06-24 21:03:42 +0000
commitb15f9b08efb0665f0c145ebf928b7e11c0a602ed (patch)
tree3921a026032a8ff2f1f61f49361d2c67f949312b /src/include
parentb5b9e33564b453c6c15495b8eb93d988a22cdf3c (diff)
downloadpostgresql-b15f9b08efb0665f0c145ebf928b7e11c0a602ed.tar.gz
Replace direct fprintf(stderr) calls by write_stderr(), and cause this
routine to do something appropriate on Win32. Also, add a security check on Win32 that parallels the can't-run-as-root check on Unix. Magnus Hagander
Diffstat (limited to 'src/include')
-rw-r--r--src/include/port/win32.h6
-rw-r--r--src/include/utils/elog.h12
2 files changed, 16 insertions, 2 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index c10eb078c4..28a583690d 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.25 2004/05/27 14:39:33 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.26 2004/06/24 21:03:33 tgl Exp $ */
/* undefine and redefine after #include */
#undef mkdir
@@ -138,6 +138,10 @@ int pgwin32_recv(SOCKET s, char* buf, int len, int flags);
int pgwin32_send(SOCKET s, char* buf, int len, int flags);
const char *pgwin32_socket_strerror(int err);
+
+/* in backend/port/win32/security.c */
+extern int pgwin32_is_admin(void);
+extern int pgwin32_is_service(void);
#endif
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index e3c8f9152a..84ff8bdee1 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.68 2004/04/05 03:02:10 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.69 2004/06/24 21:03:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -186,4 +186,14 @@ extern unsigned int Log_destination;
/* Other exported functions */
extern void DebugFileOpen(void);
+/*
+ * Write errors to stderr (or by equal means when stderr is
+ * not available). Used before ereport/elog can be used
+ * safely (memory context, GUC load etc)
+ */
+extern void write_stderr(const char *fmt,...)
+/* This extension allows gcc to check the format string for consistency with
+ the supplied arguments. */
+__attribute__((format(printf, 1, 2)));
+
#endif /* ELOG_H */