summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/nsswitch/winbindd_ads.c21
-rw-r--r--source3/nsswitch/winbindd_user.c2
-rw-r--r--source3/param/loadparm.c8
-rw-r--r--source3/sam/idmap_ad.c2
4 files changed, 20 insertions, 13 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 868a7bc2ac..3041b736f7 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -95,7 +95,7 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
return NULL;
}
- if (lp_winbind_sfu_support() && (!ads_check_sfu_mapping(ads))) {
+ if (use_nss_info("sfu") && (!ads_check_sfu_mapping(ads))) {
DEBUG(0,("ads_cached_connection: failed to check sfu attributes\n"));
return NULL;
}
@@ -163,7 +163,9 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
i = 0;
for (msg = ads_first_entry(ads, res); msg; msg = ads_next_entry(ads, msg)) {
- char *name, *gecos, *homedir, *shell;
+ char *name, *gecos;
+ char *homedir = NULL;
+ char *shell = NULL;
uint32 group;
uint32 atype;
@@ -175,9 +177,11 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
name = ads_pull_username(ads, mem_ctx, msg);
gecos = ads_pull_string(ads, mem_ctx, msg, "name");
- homedir = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_homedir_attr);
- shell = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_shell_attr);
-
+ if (use_nss_info("sfu")) {
+ homedir = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_homedir_attr);
+ shell = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_shell_attr);
+ }
+
if (!ads_pull_sid(ads, msg, "objectSid",
&(*info)[i].user_sid)) {
DEBUG(1,("No sid for %s !?\n", name));
@@ -418,8 +422,11 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
info->acct_name = ads_pull_username(ads, mem_ctx, msg);
info->full_name = ads_pull_string(ads, mem_ctx, msg, "name");
- info->homedir = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_homedir_attr);
- info->shell = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_shell_attr);
+
+ if (use_nss_info("sfu")) {
+ info->homedir = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_homedir_attr);
+ info->shell = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_shell_attr);
+ }
if (!ads_pull_uint32(ads, msg, "primaryGroupID", &group_rid)) {
DEBUG(1,("No primary group for %s !?\n",
diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c
index f849bff42d..ab5da3edd0 100644
--- a/source3/nsswitch/winbindd_user.c
+++ b/source3/nsswitch/winbindd_user.c
@@ -43,7 +43,7 @@ static BOOL fillup_pw_field(const char *lp_template,
if (out == NULL)
return False;
- if (in && !strequal(in,"") && lp_security() == SEC_ADS && lp_winbind_sfu_support()) {
+ if (in && !strequal(in,"") && lp_security() == SEC_ADS && use_nss_info("sfu")) {
safe_strcpy(out, in, sizeof(fstring) - 1);
return True;
}
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index bb6feaf2a1..a1dcf28491 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -225,7 +225,7 @@ typedef struct
int oplock_break_wait_time;
int winbind_cache_time;
int winbind_max_idle_children;
- BOOL bWinbindSFUSupport;
+ char **szWinbindNssInfo;
int iLockSpinCount;
int iLockSpinTime;
char *szLdapMachineSuffix;
@@ -1237,7 +1237,7 @@ static struct parm_struct parm_table[] = {
{"winbind trusted domains only", P_BOOL, P_GLOBAL, &Globals.bWinbindTrustedDomainsOnly, NULL, NULL, FLAG_ADVANCED},
{"winbind nested groups", P_BOOL, P_GLOBAL, &Globals.bWinbindNestedGroups, NULL, NULL, FLAG_ADVANCED},
{"winbind max idle children", P_INTEGER, P_GLOBAL, &Globals.winbind_max_idle_children, NULL, NULL, FLAG_ADVANCED},
- {"winbind sfu support", P_BOOL, P_GLOBAL, &Globals.bWinbindSFUSupport, NULL, NULL, FLAG_ADVANCED},
+ {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED},
{NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0}
};
@@ -1583,7 +1583,7 @@ static void init_globals(void)
Globals.bWinbindTrustedDomainsOnly = False;
Globals.bWinbindNestedGroups = False;
Globals.winbind_max_idle_children = 3;
- Globals.bWinbindSFUSupport = False;
+ Globals.szWinbindNssInfo = str_list_make("template", NULL);
Globals.bEnableRidAlgorithm = True;
@@ -2008,7 +2008,7 @@ FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize);
FN_LOCAL_CHAR(lp_magicchar, magic_char)
FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time)
FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children)
-FN_GLOBAL_BOOL(lp_winbind_sfu_support, &Globals.bWinbindSFUSupport)
+FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo)
FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase)
FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout)
FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing)
diff --git a/source3/sam/idmap_ad.c b/source3/sam/idmap_ad.c
index 5126246f6e..47e349483d 100644
--- a/source3/sam/idmap_ad.c
+++ b/source3/sam/idmap_ad.c
@@ -54,7 +54,7 @@ static BOOL ad_idmap_check_attr_mapping(ADS_STRUCT *ads)
return True;
}
- if (lp_winbind_sfu_support()) {
+ if (use_nss_info("sfu")) {
if (!ads_check_sfu_mapping(ads)) {
DEBUG(0,("ad_idmap_check_attr_mapping: failed to check for SFU schema\n"));