diff options
author | Volker Lendecke <vl@samba.org> | 2009-12-06 12:50:51 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-12-06 13:07:04 +0100 |
commit | da8b405065dc5731865b2f4530ff9bb034c780a4 (patch) | |
tree | 1a68f560ade7a909fa6d6cf4a95036b3c692f935 | |
parent | 3b8e85d68f11321988232ff4cfea481cc0862b2d (diff) | |
download | samba-da8b405065dc5731865b2f4530ff9bb034c780a4.tar.gz samba-da8b405065dc5731865b2f4530ff9bb034c780a4.tar.bz2 samba-da8b405065dc5731865b2f4530ff9bb034c780a4.zip |
s3: Fix a const discard warning
-rw-r--r-- | source3/rpc_server/srv_wkssvc_nt.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/rpc_server/srv_wkssvc_nt.c b/source3/rpc_server/srv_wkssvc_nt.c index f85dcd3fb2..d7f3f82298 100644 --- a/source3/rpc_server/srv_wkssvc_nt.c +++ b/source3/rpc_server/srv_wkssvc_nt.c @@ -466,7 +466,8 @@ static struct wkssvc_NetWkstaEnumUsersCtr1 *create_enum_users1( struct wkssvc_NetWkstaEnumUsersCtr1 *ctr1; char **users; struct dom_usr *dom_users; - char *pwd_server; + const char *pwd_server; + char *pwd_tmp; int i, j, num_users, num_dom_users; ctr1 = talloc(mem_ctx, struct wkssvc_NetWkstaEnumUsersCtr1); @@ -500,21 +501,22 @@ static struct wkssvc_NetWkstaEnumUsersCtr1 *create_enum_users1( return NULL; } - if ((pwd_server = talloc_strdup(ctr1->user1, lp_passwordserver()))) { + pwd_server = ""; + + if ((pwd_tmp = talloc_strdup(ctr1->user1, lp_passwordserver()))) { /* The configured password server is a full DNS name but * for the logon server we need to return just the first * component (machine name) of it in upper-case */ - char *p = strchr(pwd_server, '.'); + char *p = strchr(pwd_tmp, '.'); if (p) { *p = '\0'; } else { - p = pwd_server + strlen(pwd_server); + p = pwd_tmp + strlen(pwd_tmp); } - while (--p >= pwd_server) { + while (--p >= pwd_tmp) { *p = toupper(*p); } - } else { - pwd_server = ""; + pwd_server = pwd_tmp; } /* Put in local users first */ |