f128b7b865062da662127712935dcc58bd022384Stephen Gallagher/*
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher SSSD
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher nss_compat.h
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher Authors:
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher Stephen Gallagher <sgallagh@redhat.com>
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher Copyright (C) 2010 Red Hat
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher This program is free software; you can redistribute it and/or modify
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher it under the terms of the GNU General Public License as published by
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher the Free Software Foundation; either version 3 of the License, or
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher (at your option) any later version.
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher This program is distributed in the hope that it will be useful,
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher but WITHOUT ANY WARRANTY; without even the implied warranty of
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher GNU General Public License for more details.
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher You should have received a copy of the GNU General Public License
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher along with this program. If not, see <http://www.gnu.org/licenses/>.
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher Portions of this source file were copied from nss-pam-ldapd version
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher 0.7.8, licensed under LGPLv2.1+
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher*/
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher#ifndef NSS_COMPAT_H_
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher#define NSS_COMPAT_H_
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher/* We also define struct __netgrent because it's definition is
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher not publically available. This is taken from inet/netgroup.h
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher of the glibc (2.3.6) source tarball.
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher The first part of the struct is the only part that is modified
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher by our getnetgrent() function, all the other fields are not
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher touched at all. */
f128b7b865062da662127712935dcc58bd022384Stephen Gallagherstruct __netgrent
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher{
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher enum { triple_val, group_val } type;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher union
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher {
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher struct
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher {
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher const char *host;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher const char *user;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher const char *domain;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher } triple;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher const char *group;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher } val;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher /* the following stuff is used by some NSS services
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher but not by ours (it's not completely clear how these
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher are shared between different services) or is used
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher by our caller */
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher char *data;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher size_t data_size;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher union
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher {
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher char *cursor;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher unsigned long int position;
60dceaee2014822717a3f22e1b65b228e20cc5f0Sumit Bose } idx; /* added name to union to avoid warning */
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher int first;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher struct name_list *known_groups;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher struct name_list *needed_groups;
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher void *nip; /* changed from `service_user *nip' */
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher};
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher
f128b7b865062da662127712935dcc58bd022384Stephen Gallagher#endif /* NSS_COMPAT_H_ */