summaryrefslogtreecommitdiff
path: root/source3/winbindd/nss_info.c
diff options
context:
space:
mode:
authorGerald (Jerry) Carter <jerry@samba.org>2008-09-15 15:41:37 -0500
committerJeremy Allison <jra@samba.org>2008-09-16 10:27:49 -0700
commitd6de32db2f8d080cb746b3032c128f210154b75e (patch)
tree3a28e1eefd2f2c3773aa0bb030372707d4e63f48 /source3/winbindd/nss_info.c
parentf2723d193d8a7963b937414ee32e5c6f529b9032 (diff)
downloadsamba-d6de32db2f8d080cb746b3032c128f210154b75e.tar.gz
samba-d6de32db2f8d080cb746b3032c128f210154b75e.tar.bz2
samba-d6de32db2f8d080cb746b3032c128f210154b75e.zip
winbindd: Add support for name aliasing.
* Add support user and group name aliasing by expanding the ws_name_replace() and ws_name_return() functions. The lookup path is aliases -> qualified name -> SID SID -> fully qualified name -> alias In other words, the name aliasing support is a thin layer built on top of SID/NAME translation. * Rename the ws_name_XX() functions to normalize_name_map() and normalize_name_unmap(). Chaneg interface to return NTSTATUS rather than char *. * Add associated cache validation functions.
Diffstat (limited to 'source3/winbindd/nss_info.c')
-rw-r--r--source3/winbindd/nss_info.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/winbindd/nss_info.c b/source3/winbindd/nss_info.c
index daa3dd037d..0e8cb60257 100644
--- a/source3/winbindd/nss_info.c
+++ b/source3/winbindd/nss_info.c
@@ -281,6 +281,47 @@ static struct nss_domain_entry *find_nss_domain( const char *domain )
/********************************************************************
*******************************************************************/
+ NTSTATUS nss_map_to_alias( TALLOC_CTX *mem_ctx, const char *domain,
+ const char *name, char **alias )
+{
+ struct nss_domain_entry *p;
+ struct nss_info_methods *m;
+
+ if ( (p = find_nss_domain( domain )) == NULL ) {
+ DEBUG(4,("nss_map_to_alias: Failed to find nss domain pointer for %s\n",
+ domain ));
+ return NT_STATUS_NOT_FOUND;
+ }
+
+ m = p->backend->methods;
+
+ return m->map_to_alias( mem_ctx, domain, name, alias );
+}
+
+
+/********************************************************************
+ *******************************************************************/
+
+ NTSTATUS nss_map_from_alias( TALLOC_CTX *mem_ctx, const char *domain,
+ const char *alias, char **name )
+{
+ struct nss_domain_entry *p;
+ struct nss_info_methods *m;
+
+ if ( (p = find_nss_domain( domain )) == NULL ) {
+ DEBUG(4,("nss_map_from_alias: Failed to find nss domain pointer for %s\n",
+ domain ));
+ return NT_STATUS_NOT_FOUND;
+ }
+
+ m = p->backend->methods;
+
+ return m->map_from_alias( mem_ctx, domain, alias, name );
+}
+
+/********************************************************************
+ *******************************************************************/
+
NTSTATUS nss_close( const char *parameters )
{
struct nss_domain_entry *p = nss_domain_list;