diff options
author | Jeremy Allison <jra@samba.org> | 2006-08-04 21:15:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:32 -0500 |
commit | 43c7f6d1d1ca6de7f0185b07d4459350ad6c2ca2 (patch) | |
tree | 6523e983c4b7d226f4272a3522e56937d1d35b92 | |
parent | 6361d151a4c2fa96b84347ccd76f0748e8ecb1bf (diff) | |
download | samba-43c7f6d1d1ca6de7f0185b07d4459350ad6c2ca2.tar.gz samba-43c7f6d1d1ca6de7f0185b07d4459350ad6c2ca2.tar.bz2 samba-43c7f6d1d1ca6de7f0185b07d4459350ad6c2ca2.zip |
r17407: Don't do strchr_m twice when once will do.
Jeremy.
(This used to be commit b5f0b1b6447ac3c77558b32d97ce96d357ce15c0)
-rw-r--r-- | source3/passdb/lookup_sid.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index d4c1ff2059..f612cff092 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -393,14 +393,15 @@ BOOL lookup_name_smbconf(TALLOC_CTX *mem_ctx, DOM_SID *ret_sid, enum SID_NAME_USE *ret_type) { char *qualified_name; + const char *p; /* NB. No winbindd_separator here as lookup_name needs \\' */ - if (strchr_m(full_name, *lp_winbind_separator())) { + if ((p = strchr_m(full_name, *lp_winbind_separator())) != NULL) { /* The name is already qualified with a domain. */ if (*lp_winbind_separator() != '\\') { - char *p, *tmp; + char *tmp; /* lookup_name() needs '\\' as a separator */ @@ -408,9 +409,7 @@ BOOL lookup_name_smbconf(TALLOC_CTX *mem_ctx, if (!tmp) { return False; } - p = strchr_m(tmp, *lp_winbind_separator()); - SMB_ASSERT(p != NULL); - *p = '\\'; + tmp[p - full_name] = '\\'; full_name = tmp; } |