summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-03-16 20:32:14 +0000
committerGerald Carter <jerry@samba.org>2004-03-16 20:32:14 +0000
commit2f8a18c093938f7aa31541f9b56da9be23fb861b (patch)
tree117593c55f8e8edca9f37e905cbc1c641ce39176
parent4b27ffd821b8b46d837afda1c7602359314263d5 (diff)
downloadsamba-2f8a18c093938f7aa31541f9b56da9be23fb861b.tar.gz
samba-2f8a18c093938f7aa31541f9b56da9be23fb861b.tar.bz2
samba-2f8a18c093938f7aa31541f9b56da9be23fb861b.zip
merges from 3.0
(This used to be commit fed98658a5cc82e9fdc65aa73f74e118c1104178)
-rw-r--r--source3/auth/auth_util.c7
-rw-r--r--source3/nsswitch/winbindd.c2
-rw-r--r--source3/nsswitch/winbindd_group.c4
3 files changed, 9 insertions, 4 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index c74f01ab67..0de47f9107 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -995,6 +995,7 @@ struct passwd *smb_getpwnam( char *domuser, fstring save_username, BOOL create )
struct passwd *pw = NULL;
char *p;
fstring mapped_username;
+ fstring strip_username;
/* we only save a copy of the username it has been mangled
by winbindd use default domain */
@@ -1032,9 +1033,11 @@ struct passwd *smb_getpwnam( char *domuser, fstring save_username, BOOL create )
}
/* setup for lookup of just the username */
- p++;
- fstrcpy( mapped_username, p );
+ /* remember that p and mapped_username are overlapping memory */
+ p++;
+ fstrcpy( strip_username, p );
+ fstrcpy( mapped_username, strip_username );
}
/* just lookup a plain username */
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index c4319d493a..283b2e4a89 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -786,7 +786,7 @@ int main(int argc, char **argv)
{ "foreground", 'F', POPT_ARG_VAL, &Fork, False, "Daemon in foreground mode" },
{ "interactive", 'i', POPT_ARG_NONE, NULL, 'i', "Interactive mode" },
{ "single-daemon", 'Y', POPT_ARG_VAL, &opt_dual_daemon, False, "Single daemon mode" },
- { "no-caching", 'n', POPT_ARG_VAL, &opt_nocache, False, "Disable caching" },
+ { "no-caching", 'n', POPT_ARG_VAL, &opt_nocache, True, "Disable caching" },
POPT_COMMON_SAMBA
POPT_TABLEEND
};
diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c
index 74ede8621b..3bdf83cfdf 100644
--- a/source3/nsswitch/winbindd_group.c
+++ b/source3/nsswitch/winbindd_group.c
@@ -25,6 +25,8 @@
#include "includes.h"
#include "winbindd.h"
+extern BOOL opt_nocache;
+
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
@@ -1028,7 +1030,7 @@ enum winbindd_result winbindd_getgroups(struct winbindd_cli_state *state)
/* Treat the info3 cache as authoritative as the
lookup_usergroups() function may return cached data. */
- if ((info3 = netsamlogon_cache_get(mem_ctx, &user_sid))) {
+ if ( !opt_nocache && (info3 = netsamlogon_cache_get(mem_ctx, &user_sid))) {
DEBUG(10, ("winbindd_getgroups: info3 has %d groups, %d other sids\n",
info3->num_groups2, info3->num_other_sids));