summaryrefslogtreecommitdiffstats
path: root/src/sss_client/nss_compat.h
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-08-23 16:05:47 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-10-13 09:49:37 -0400
commitf128b7b865062da662127712935dcc58bd022384 (patch)
treebef6687ca4bebddf3d57c49f77a65697eecba44b /src/sss_client/nss_compat.h
parentf1ac7d7859b26f0f36f5e8ffacda609f8ece80e5 (diff)
downloadsssd-f128b7b865062da662127712935dcc58bd022384.tar.gz
sssd-f128b7b865062da662127712935dcc58bd022384.tar.xz
sssd-f128b7b865062da662127712935dcc58bd022384.zip
Add support for netgroups to NSS sss_client
Diffstat (limited to 'src/sss_client/nss_compat.h')
-rw-r--r--src/sss_client/nss_compat.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/sss_client/nss_compat.h b/src/sss_client/nss_compat.h
new file mode 100644
index 000000000..37871c230
--- /dev/null
+++ b/src/sss_client/nss_compat.h
@@ -0,0 +1,67 @@
+/*
+ SSSD
+
+ nss_compat.h
+
+ Authors:
+ Stephen Gallagher <sgallagh@redhat.com>
+
+ Copyright (C) 2010 Red Hat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ Portions of this source file were copied from nss-pam-ldapd version
+ 0.7.8, licensed under LGPLv2.1+
+*/
+
+#ifndef NSS_COMPAT_H_
+#define NSS_COMPAT_H_
+
+/* We also define struct __netgrent because it's definition is
+ not publically available. This is taken from inet/netgroup.h
+ of the glibc (2.3.6) source tarball.
+ The first part of the struct is the only part that is modified
+ by our getnetgrent() function, all the other fields are not
+ touched at all. */
+struct __netgrent
+{
+ enum { triple_val, group_val } type;
+ union
+ {
+ struct
+ {
+ const char *host;
+ const char *user;
+ const char *domain;
+ } triple;
+ const char *group;
+ } val;
+ /* the following stuff is used by some NSS services
+ but not by ours (it's not completely clear how these
+ are shared between different services) or is used
+ by our caller */
+ char *data;
+ size_t data_size;
+ union
+ {
+ char *cursor;
+ unsigned long int position;
+ } insertedname; /* added name to union to avoid warning */
+ int first;
+ struct name_list *known_groups;
+ struct name_list *needed_groups;
+ void *nip; /* changed from `service_user *nip' */
+};
+
+#endif /* NSS_COMPAT_H_ */