nss-pam-ldapd commit: r1262 - nss-pam-ldapd-solaris/nss
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd commit: r1262 - nss-pam-ldapd-solaris/nss
- From: Commits of the nss-pam-ldapd project <nss-pam-ldapd-commits [at] lists.arthurdejong.org>
- To: nss-pam-ldapd-commits [at] lists.arthurdejong.org
- Reply-to: nss-pam-ldapd-users [at] lists.arthurdejong.org
- Subject: nss-pam-ldapd commit: r1262 - nss-pam-ldapd-solaris/nss
- Date: Mon, 11 Oct 2010 22:13:00 +0200 (CEST)
Author: arthur
Date: Mon Oct 11 22:12:59 2010
New Revision: 1262
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1262
Log:
also try to support older Solaris releases that do not have the returnlen
member of struct nss_XbyY_args
Modified:
nss-pam-ldapd-solaris/nss/ethers.c
nss-pam-ldapd-solaris/nss/group.c
nss-pam-ldapd-solaris/nss/hosts.c
nss-pam-ldapd-solaris/nss/networks.c
nss-pam-ldapd-solaris/nss/passwd.c
nss-pam-ldapd-solaris/nss/protocols.c
nss-pam-ldapd-solaris/nss/rpc.c
nss-pam-ldapd-solaris/nss/services.c
nss-pam-ldapd-solaris/nss/shadow.c
Modified: nss-pam-ldapd-solaris/nss/ethers.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/ethers.c Mon Oct 11 21:37:38 2010 (r1261)
+++ nss-pam-ldapd-solaris/nss/ethers.c Mon Oct 11 22:12:59 2010 (r1262)
@@ -96,6 +96,8 @@
#define NSS_BUFLEN_ETHERS 1024
#endif /* NSS_BUFLEN_ETHERS */
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_etherstring(TFILE *fp,nss_XbyY_args_t *args)
{
/* TODO: padl uses struct ether, verify */
@@ -129,8 +131,17 @@
NSS_ARGS(args)->buf.result? \
read_etherent(fp,(struct etherent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno):
\
read_etherstring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_etherent(fp,(struct etherent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno);
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
/* map a hostname to the corresponding ethernet address */
static nss_status_t get_gethostton(nss_backend_t UNUSED(*be),void *args)
Modified: nss-pam-ldapd-solaris/nss/group.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/group.c Mon Oct 11 21:37:38 2010 (r1261)
+++ nss-pam-ldapd-solaris/nss/group.c Mon Oct 11 22:12:59 2010 (r1262)
@@ -183,6 +183,8 @@
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_groupstring(TFILE *fp,nss_XbyY_args_t *args)
{
struct group result;
@@ -219,8 +221,17 @@
NSS_ARGS(args)->buf.result? \
read_group(fp,(struct group
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno):
\
read_groupstring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_group(fp,(struct group
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno);
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
static nss_status_t get_getgrnam_r(nss_backend_t UNUSED(*be),void *args)
{
Modified: nss-pam-ldapd-solaris/nss/hosts.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/hosts.c Mon Oct 11 21:37:38 2010 (r1261)
+++ nss-pam-ldapd-solaris/nss/hosts.c Mon Oct 11 22:12:59 2010 (r1262)
@@ -242,6 +242,8 @@
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_hoststring(TFILE *fp,nss_XbyY_args_t *args,int
erronempty)
{
struct hostent result;
@@ -298,16 +300,29 @@
NSS_ARGS(args)->buf.result? \
read_hostent_erronempty(fp,NSS_ARGS(args)->key.hostaddr.type,(struct
hostent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno,&(NSS_ARGS(args)->h_errno)):
\
read_hoststring(fp,args,1); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
#define READ_RESULT_NEXTONEMPTY(fp) \
NSS_ARGS(args)->buf.result? \
read_hostent_nextonempty(fp,NSS_ARGS(args)->key.hostaddr.type,(struct
hostent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno,&(NSS_ARGS(args)->h_errno)):
\
read_hoststring(fp,args,0); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT_ERRONEMPTY(fp) \
+ read_hostent_erronempty(fp,NSS_ARGS(args)->key.hostaddr.type,(struct hostent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno,&(NSS_ARGS(args)->h_errno));
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#define READ_RESULT_NEXTONEMPTY(fp) \
+ read_hostent_nextonempty(fp,NSS_ARGS(args)->key.hostaddr.type,(struct
hostent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno,&(NSS_ARGS(args)->h_errno));
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
/* hack to set the correct errno and h_errno */
#define h_errnop &(NSS_ARGS(args)->h_errno)
Modified: nss-pam-ldapd-solaris/nss/networks.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/networks.c Mon Oct 11 21:37:38 2010
(r1261)
+++ nss-pam-ldapd-solaris/nss/networks.c Mon Oct 11 22:12:59 2010
(r1262)
@@ -162,6 +162,8 @@
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_netentstring(TFILE *fp,nss_XbyY_args_t *args)
{
struct netent result;
@@ -199,8 +201,17 @@
NSS_ARGS(args)->buf.result? \
read_netent(fp,(struct netent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno,&(NSS_ARGS(args)->h_errno)):
\
read_netentstring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_netent(fp,(struct netent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno,&(NSS_ARGS(args)->h_errno));
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
/* more of a dirty hack */
#define h_errnop (&(NSS_ARGS(args)->h_errno))
Modified: nss-pam-ldapd-solaris/nss/passwd.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/passwd.c Mon Oct 11 21:37:38 2010 (r1261)
+++ nss-pam-ldapd-solaris/nss/passwd.c Mon Oct 11 22:12:59 2010 (r1262)
@@ -97,6 +97,8 @@
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_passwdstring(TFILE *fp,nss_XbyY_args_t *args)
{
struct passwd result;
@@ -127,8 +129,17 @@
NSS_ARGS(args)->buf.result? \
read_passwd(fp,(struct passwd
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno):
\
read_passwdstring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_passwd(fp,(struct passwd
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno);
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
static nss_status_t get_getpwnam(nss_backend_t UNUSED(*be),void *args)
{
Modified: nss-pam-ldapd-solaris/nss/protocols.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/protocols.c Mon Oct 11 21:37:38 2010
(r1261)
+++ nss-pam-ldapd-solaris/nss/protocols.c Mon Oct 11 22:12:59 2010
(r1262)
@@ -93,6 +93,8 @@
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_protostring(TFILE *fp,nss_XbyY_args_t *args)
{
struct protoent result;
@@ -128,8 +130,17 @@
NSS_ARGS(args)->buf.result? \
read_protoent(fp,(struct protoent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno):
\
read_protostring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_protoent(fp,(struct protoent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno);
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
static nss_status_t get_getprotobyname(nss_backend_t UNUSED(*be),void *args)
{
Modified: nss-pam-ldapd-solaris/nss/rpc.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/rpc.c Mon Oct 11 21:37:38 2010 (r1261)
+++ nss-pam-ldapd-solaris/nss/rpc.c Mon Oct 11 22:12:59 2010 (r1262)
@@ -93,6 +93,8 @@
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_rpcstring(TFILE *fp,nss_XbyY_args_t *args)
{
struct rpcent result;
@@ -128,8 +130,17 @@
NSS_ARGS(args)->buf.result? \
read_rpcent(fp,(struct rpcent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno):
\
read_rpcstring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_rpcent(fp,(struct rpcent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno);
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
static nss_status_t get_getrpcbyname_r(nss_backend_t UNUSED(*be),void *args)
{
Modified: nss-pam-ldapd-solaris/nss/services.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/services.c Mon Oct 11 21:37:38 2010
(r1261)
+++ nss-pam-ldapd-solaris/nss/services.c Mon Oct 11 22:12:59 2010
(r1262)
@@ -97,6 +97,8 @@
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_servstring(TFILE *fp,nss_XbyY_args_t *args)
{
struct servent result;
@@ -132,8 +134,17 @@
NSS_ARGS(args)->buf.result? \
read_servent(fp,(struct servent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno):
\
read_servstring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_servent(fp,(struct servent
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno);
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
static nss_status_t get_getservbyname_r(nss_backend_t UNUSED(*be),void *args)
{
Modified: nss-pam-ldapd-solaris/nss/shadow.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/shadow.c Mon Oct 11 21:37:38 2010 (r1261)
+++ nss-pam-ldapd-solaris/nss/shadow.c Mon Oct 11 22:12:59 2010 (r1262)
@@ -89,6 +89,8 @@
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_spwdstring(TFILE *fp,nss_XbyY_args_t *args)
{
struct spwd result;
@@ -153,8 +155,17 @@
NSS_ARGS(args)->buf.result? \
read_spwd(fp,(struct spwd
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno):
\
read_spwdstring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_spwd(fp,(struct spwd
*)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno);
\
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
static nss_status_t get_getspnam_r(nss_backend_t UNUSED(*be),void *args)
{
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits
- nss-pam-ldapd commit: r1262 - nss-pam-ldapd-solaris/nss,
Commits of the nss-pam-ldapd project