summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-20 23:07:36 +0000
committerJeremy Allison <jra@samba.org>2001-03-20 23:07:36 +0000
commitbeec1ea8291c9c2b12745d37ffe307dd4e3bd6ec (patch)
tree5cefe9d779e5f11b398c8029796053ddfc61aceb /source3/passdb
parent344fb49fbf4df55492bfa9cc1aee2d8210c32ca6 (diff)
downloadsamba-beec1ea8291c9c2b12745d37ffe307dd4e3bd6ec.tar.gz
samba-beec1ea8291c9c2b12745d37ffe307dd4e3bd6ec.tar.bz2
samba-beec1ea8291c9c2b12745d37ffe307dd4e3bd6ec.zip
Fix for crash when doing name lookup with a quoted string. Part of
lookup_name was expecting to be able to write to the string. Changed lookup_name to use const. Jeremy. (This used to be commit 80c18d88491f1148ade623e81c33f84ba4f952f3)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 2b318eca53..918fdcd088 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -504,11 +504,21 @@ BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use)
Convert a name into a SID. Used in the lookup name rpc.
********************************************************************/
-BOOL local_lookup_name(char *domain, char *user, DOM_SID *psid, enum SID_NAME_USE *psid_name_use)
+BOOL local_lookup_name(const char *c_domain, const char *c_user, DOM_SID *psid, enum SID_NAME_USE *psid_name_use)
{
extern DOM_SID global_sid_World_Domain;
struct passwd *pass = NULL;
DOM_SID local_sid;
+ fstring user;
+ fstring domain;
+
+ /*
+ * domain and user may be quoted const strings, and map_username and
+ * friends can modify them. Make a modifiable copy. JRA.
+ */
+
+ fstrcpy(domain, c_domain);
+ fstrcpy(user, c_user);
sid_copy(&local_sid, &global_sam_sid);