index 72ee9cc6986b25073c696701398ae25dc805d535..858991598438a2f805a88ab6c8d3d0e14c3c4810 100644 (file)
#include <arpa/inet.h>
#include <unistd.h>
+#include "common/username.h"
#include "libpq/auth.h"
#include "libpq/crypt.h"
#include "libpq/ip.h"
index a046c1cf0ffd4654b903429d546890fa179578c3..4ee8a153d93cd30cb7b28197339764a12ea0ea4a 100644 (file)
#endif
#include "bootstrap/bootstrap.h"
+#include "common/username.h"
#include "postmaster/postmaster.h"
#include "tcop/tcopprot.h"
#include "utils/help_config.h"
index 3f1ce0567493cf87ddca82e6ad91a3fa131d28b9..a9aa7a487f661587d54b94b34544e72b5f97c3d5 100644 (file)
#include "sys/mman.h"
#endif
+#include "common/username.h"
#include "mb/pg_wchar.h"
#include "getaddrinfo.h"
#include "getopt_long.h"
index d7c31e0b1b42af4fd22bf73b179682ba76dd033d..baa94175ea1ed20dcde44a8934f863719dfd36e1 100644 (file)
#endif
#include "common.h"
+#include "common/username.h"
#include "help.h"
#include "input.h"
#include "settings.h"
index 4944c46a4b2a943e0aa686b8b507bb251793f361..691f6c6a02f43a909446e8918e2d4e7b5d071bd4 100644 (file)
#ifndef COMMON_H
#define COMMON_H
+#include "common/username.h"
#include "libpq-fe.h"
#include "getopt_long.h" /* pgrminclude ignore */
#include "pqexpbuffer.h" /* pgrminclude ignore */
index 62ca8ab0c353986c491934aed9eb1d01429ba2b4..7edbaaa2c1a707f59cbf6b9c137838c201f28cb8 100644 (file)
@@ -23,7 +23,7 @@ include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
LIBS += $(PTHREAD_LIBS)
-OBJS_COMMON = exec.o pgfnames.o psprintf.o relpath.o rmtree.o wait_error.o
+OBJS_COMMON = exec.o pgfnames.o psprintf.o relpath.o rmtree.o username.o wait_error.o
OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * src/port/username.c
+ * src/common/username.c
*
*-------------------------------------------------------------------------
*/
#include <unistd.h>
#include <sys/types.h>
+#include "common/username.h"
/*
* Returns the current user name in a static buffer, or NULL on error and
new file mode 100644
(file)
index 0000000..
115d1ed
--- /dev/null
+/*
+ * username.h
+ * lookup effective username
+ *
+ * Copyright (c) 2003-2014, PostgreSQL Global Development Group
+ *
+ * src/include/common/username.h
+ */
+#ifndef USERNAME_H
+#define USERNAME_H
+
+extern const char *get_user_name(char **errstr);
+extern const char *get_user_name_or_exit(const char *progname);
+
+#endif /* USERNAME_H */
index bc275c0c1c2d9047e050da3901fc3b8c2ac07e4e..f50fbecf0109fcca47a10be182bf5463598d6ba5 100644 (file)
@@ -473,10 +473,6 @@ extern pqsigfunc pqsignal(int signo, pqsigfunc func);
/* port/quotes.c */
extern char *escape_single_quotes_ascii(const char *src);
-/* port/username.c */
-extern const char *get_user_name(char **errstr);
-extern const char *get_user_name_or_exit(const char *progname);
-
/* port/wait_error.c */
extern char *wait_result_to_str(int exit_status);
index a50e0af2143c39e5f83815e5b3aa30e680be8f00..1be4ff57a2f5fc46dba49c247dbd68532388cfe2 100644 (file)
OBJS = $(LIBOBJS) chklocale.o dirmod.o erand48.o fls.o inet_net_ntop.o \
noblock.o path.o pgcheckdir.o pg_crc.o pgmkdirp.o pgsleep.o \
pgstrcasecmp.o pqsignal.o \
- qsort.o qsort_arg.o quotes.o sprompt.o tar.o thread.o username.o
+ qsort.o qsort_arg.o quotes.o sprompt.o tar.o thread.o
# foo_srv.o and foo.o are both built from foo.c, but only foo.o has -DFRONTEND
OBJS_SRV = $(OBJS:%.o=%_srv.o)
index d6b6eaf158438e48c407b8461ff2835d02717652..a8324ff7b20ff2f96a47c9c057e5c9d2df7401d8 100644 (file)
erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c noblock.c path.c
pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c pqsignal.c
qsort.c qsort_arg.c quotes.c
- sprompt.c tar.c thread.c getopt.c getopt_long.c dirent.c rint.c username.c
+ sprompt.c tar.c thread.c getopt.c getopt_long.c dirent.c rint.c
win32env.c win32error.c win32setlocale.c);
our @pgcommonallfiles = qw(
- exec.c pgfnames.c psprintf.c relpath.c rmtree.c wait_error.c);
+ exec.c pgfnames.c psprintf.c relpath.c rmtree.c username.c wait_error.c);
our @pgcommonfrontendfiles = (@pgcommonallfiles, qw(fe_memutils.c));