diff options
author | asau <asau> | 2013-03-17 14:12:02 +0000 |
---|---|---|
committer | asau <asau> | 2013-03-17 14:12:02 +0000 |
commit | 2a20b1e7134580d5ea7244b0d557bbd042188254 (patch) | |
tree | 7b6c852c97c0431dcf16dc34df9d4ba356f4960c /databases/nss-pgsql/patches | |
parent | 9b5816b14d57bf456d6ef26f8cdcf815c17935f8 (diff) | |
download | pkgsrc-2a20b1e7134580d5ea7244b0d557bbd042188254.tar.gz |
Import libnss-pgsql version 1.5.0-beta as databases/nss-pgsql
Packaged by Matthew Bauer <matthew.justin.bauer@gmail.com> during Google Code-In.
Name Service Switch module for PostgreSQL.
Diffstat (limited to 'databases/nss-pgsql/patches')
-rw-r--r-- | databases/nss-pgsql/patches/patch-config.h.in | 30 | ||||
-rw-r--r-- | databases/nss-pgsql/patches/patch-src_Makefile.in | 15 | ||||
-rw-r--r-- | databases/nss-pgsql/patches/patch-src_backend.c | 76 | ||||
-rw-r--r-- | databases/nss-pgsql/patches/patch-src_nss-pgsql.h | 39 |
4 files changed, 160 insertions, 0 deletions
diff --git a/databases/nss-pgsql/patches/patch-config.h.in b/databases/nss-pgsql/patches/patch-config.h.in new file mode 100644 index 00000000000..9bb883f4ca5 --- /dev/null +++ b/databases/nss-pgsql/patches/patch-config.h.in @@ -0,0 +1,30 @@ +# $NetBSD: patch-config.h.in,v 1.1.1.1 2013/03/17 14:12:02 asau Exp $ + +Defines NSSWITCH_H and SHADOW_H variables + +--- config.h.in.orig 2008-08-19 10:10:55.000000000 +0000 ++++ config.h.in +@@ -25,10 +25,14 @@ + /* Define to 1 if you have the <nss.h> header file. */ + #undef HAVE_NSS_H + ++#undef HAVE_NSSWITCH_H ++ + /* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ + #undef HAVE_REALLOC + ++#undef HAVE_SHADOW_H ++ + /* Define to 1 if you have the <stdint.h> header file. */ + #undef HAVE_STDINT_H + +@@ -106,3 +110,8 @@ + + /* Define to `int' if <sys/types.h> doesn't define. */ + #undef uid_t ++ ++#ifdef __NetBSD__ ++#include "netbsd.h" ++#endif ++ diff --git a/databases/nss-pgsql/patches/patch-src_Makefile.in b/databases/nss-pgsql/patches/patch-src_Makefile.in new file mode 100644 index 00000000000..428b1d9f94f --- /dev/null +++ b/databases/nss-pgsql/patches/patch-src_Makefile.in @@ -0,0 +1,15 @@ +# $NetBSD: patch-src_Makefile.in,v 1.1.1.1 2013/03/17 14:12:02 asau Exp $ + +Adds netbsd.c to source list - should we make it only used by NetBSD? + +--- src/Makefile.in.orig 2008-08-19 10:10:56.000000000 +0000 ++++ src/Makefile.in +@@ -86,7 +86,7 @@ VERSION = @VERSION@ + docdir = @docdir@ + + lib_LTLIBRARIES = libnss_pgsql.la +-libnss_pgsql_la_SOURCES = interface.c config.c backend.c util.c ++libnss_pgsql_la_SOURCES = interface.c config.c backend.c util.c netbsd.c + libnss_pgsql_la_LDFLAGS = -module -version-info 2 + EXTRA_DIST = nss-pgsql.h + mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs diff --git a/databases/nss-pgsql/patches/patch-src_backend.c b/databases/nss-pgsql/patches/patch-src_backend.c new file mode 100644 index 00000000000..667a1483344 --- /dev/null +++ b/databases/nss-pgsql/patches/patch-src_backend.c @@ -0,0 +1,76 @@ +# $NetBSD: patch-src_backend.c,v 1.1.1.1 2013/03/17 14:12:02 asau Exp $ + +Changes name of libpq-fe.h so it works on our PostgreSQL installation +Reorders list of copy_attr_colname as it references copy_attr_string + +--- src/backend.c.orig 2008-08-19 09:44:37.000000000 +0000 ++++ src/backend.c +@@ -11,7 +11,7 @@ + */ + + #include "nss-pgsql.h" +-#include <postgresql/libpq-fe.h> ++#include <libpq-fe.h> + #include <stdlib.h> + #include <string.h> + #include <stdio.h> +@@ -205,22 +205,6 @@ inline void getent_close(char type) + Assign a single value to *valptr from the specified row in the result + */ + enum nss_status +-copy_attr_colnum(PGresult *res, int attrib_number, char **valptr, +- char **buffer, size_t *buflen, int *errnop, int row) +-{ +- +- const char *sptr; +- size_t slen; +- +- sptr = PQgetvalue(res, row, attrib_number); +- return copy_attr_string(sptr, valptr, buffer, buflen, errnop); +-} +- +-/* +- With apologies to nss_ldap... +- Assign a single value to *valptr from the specified row in the result +-*/ +-enum nss_status + copy_attr_string(char *sptr, char **valptr, + char **buffer, size_t *buflen, int *errnop) + { +@@ -244,6 +228,22 @@ copy_attr_string(char *sptr, char **valp + } + + /* ++ With apologies to nss_ldap... ++ Assign a single value to *valptr from the specified row in the result ++*/ ++enum nss_status ++copy_attr_colnum(PGresult *res, int attrib_number, char **valptr, ++ char **buffer, size_t *buflen, int *errnop, int row) ++{ ++ ++ const char *sptr; ++ size_t slen; ++ ++ sptr = PQgetvalue(res, row, attrib_number); ++ return copy_attr_string(sptr, valptr, buffer, buflen, errnop); ++} ++ ++/* + * return array of strings containing usernames that are member of group with gid 'gid' + */ + enum nss_status getgroupmem(gid_t gid, +@@ -778,6 +778,7 @@ size_t backend_initgroups_dyn(const char + return *start; + } + ++#ifdef HAVE_SHADOW_H + /* + * 'convert' a PGresult to struct shadow + */ +@@ -863,4 +864,4 @@ enum nss_status backend_getspnam(const c + + return status; + } +- ++#endif diff --git a/databases/nss-pgsql/patches/patch-src_nss-pgsql.h b/databases/nss-pgsql/patches/patch-src_nss-pgsql.h new file mode 100644 index 00000000000..a1e70482792 --- /dev/null +++ b/databases/nss-pgsql/patches/patch-src_nss-pgsql.h @@ -0,0 +1,39 @@ +# $NetBSD: patch-src_nss-pgsql.h,v 1.1.1.1 2013/03/17 14:12:02 asau Exp $ + +Adds checks for header files + +--- src/nss-pgsql.h.orig 2006-01-09 22:33:07.000000000 +0000 ++++ src/nss-pgsql.h +@@ -11,11 +11,15 @@ + + # ifdef HAVE_NSS_H + # include <nss.h> ++# elsif HAVE_NSSWITCH_H ++# include <nsswitch.h> + # endif + + # include <pwd.h> + # include <grp.h> +-# include <shadow.h> ++# ifdef HAVE_SHADOW_H ++# include <shadow.h> ++# endif + # include <sys/types.h> + + #define CFGFILE SYSCONFDIR"/nss-pgsql.conf" +@@ -71,6 +75,7 @@ size_t backend_initgroups_dyn(const char + long int limit, + int *errnop); + ++#ifdef HAVE_SHADOW_H + enum nss_status backend_getspent(struct spwd *result, + char *buffer, + size_t buflen, +@@ -82,6 +87,7 @@ enum nss_status backend_getspnam(const c + size_t buflen, + int *errnop); + ++#endif + void print_err(const char *msg, ...); + void print_msg(const char *msg, ...); + |