diff options
author | Gerald Carter <jerry@samba.org> | 2007-01-24 01:48:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:23 -0500 |
commit | b9b26be1744b792a54f0a77af140237b4dc5a870 (patch) | |
tree | 96501a60f415248f226902f790420dec7758a540 /source3/include | |
parent | 78f5f4b260d877ce615dbbdc2bccbb0cd251f08a (diff) | |
download | samba-b9b26be1744b792a54f0a77af140237b4dc5a870.tar.gz samba-b9b26be1744b792a54f0a77af140237b4dc5a870.tar.bz2 samba-b9b26be1744b792a54f0a77af140237b4dc5a870.zip |
r20986: Commit the prototype of the nss_info plugin interface.
This allows a provider to supply the homedirectory, etc...
attributes for a user without requiring support in core
winbindd code. The idmap_ad.c module has been modified
to provide the idmap 'ad' library as well as the rfc2307 and sfu
"winbind nss info" support.
The SID/id mapping is working in idmap_ad but the nss_info
still has a few quirks that I'm in the process of resolving.
(This used to be commit aaec0115e2c96935499052d9a637a20c6445986e)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/ads.h | 21 | ||||
-rw-r--r-- | source3/include/includes.h | 2 | ||||
-rw-r--r-- | source3/include/nss_info.h | 68 |
3 files changed, 81 insertions, 10 deletions
diff --git a/source3/include/ads.h b/source3/include/ads.h index 1d8b1f3d32..d97ae1531f 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -57,18 +57,19 @@ typedef struct { time_t current_time; int tried_closest_dc; } config; +} ADS_STRUCT; - /* info derived from the servers schema */ - struct { - enum wb_posix_mapping map_type; - char *posix_homedir_attr; - char *posix_shell_attr; - char *posix_uidnumber_attr; - char *posix_gidnumber_attr; - char *posix_gecos_attr; - } schema; +/* used to remember the names of the posix attributes in AD */ +/* see the rfc2307 & sfu nss backends */ + +struct posix_schema { + char *posix_homedir_attr; + char *posix_shell_attr; + char *posix_uidnumber_attr; + char *posix_gidnumber_attr; + char *posix_gecos_attr; +}; -} ADS_STRUCT; /* there are 5 possible types of errors the ads subsystem can produce */ enum ads_error_type {ENUM_ADS_ERROR_KRB5, ENUM_ADS_ERROR_GSS, diff --git a/source3/include/includes.h b/source3/include/includes.h index b341d1ee95..84bd90cc27 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -768,6 +768,8 @@ enum flush_reason_enum { /* NUM_FLUSH_REASONS must remain the last value in the enumeration. */ NUM_FLUSH_REASONS}; +#include "nss_info.h" + /***** automatically generated prototypes *****/ #ifndef NO_PROTO_H #include "proto.h" diff --git a/source3/include/nss_info.h b/source3/include/nss_info.h new file mode 100644 index 0000000000..f442bf0db5 --- /dev/null +++ b/source3/include/nss_info.h @@ -0,0 +1,68 @@ +/* + Unix SMB/CIFS implementation. + Idmap NSS headers + + Copyright (C) Gerald Carter 2006 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef _IDMAP_NSS_H +#define _IDMAP_NSS_H + +/* The interface version specifier */ + +#define SMB_NSS_INFO_INTERFACE_VERSION 1 + +/* List of available backends. All backends must + register themselves */ + +struct nss_function_entry { + struct nss_function_entry *prev, *next; + + const char *name; + struct nss_info_methods *methods; +}; + +/* List of configured domains. Each domain points + back to its configured backend. */ + +struct nss_domain_entry { + struct nss_domain_entry *prev, *next; + + const char *domain; + + NTSTATUS init_status; + struct nss_function_entry *backend; + + /* hold state on a per domain basis */ + + void *state; +}; + +/* API */ + +struct nss_info_methods { + NTSTATUS (*init)( struct nss_domain_entry *e ); + NTSTATUS (*get_nss_info)( struct nss_domain_entry *e, + const DOM_SID *sid, + TALLOC_CTX *ctx, + ADS_STRUCT *ads, LDAPMessage *msg, + char **homedir, char **shell, char **gecos, gid_t *p_gid); + NTSTATUS (*close_fn)( void ); +}; + +#endif /* _IDMAP_NSS_H_ */ |