diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-08 17:25:45 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-08 17:25:45 -0800 |
commit | d40e47db4b5da41c8604a2058f3a0b0a82164f08 (patch) | |
tree | 1974bfa70d7b527714b8c68c40e33f2b88efb9e1 /source3/rpc_server | |
parent | 976b0ec487720982e456f8c3634be3df64882dae (diff) | |
download | samba-d40e47db4b5da41c8604a2058f3a0b0a82164f08.tar.gz samba-d40e47db4b5da41c8604a2058f3a0b0a82164f08.tar.bz2 samba-d40e47db4b5da41c8604a2058f3a0b0a82164f08.zip |
Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
(This used to be commit 2a0173743d2cf615d52278f3dd87cc804abe2d16)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 8 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 12 |
2 files changed, 11 insertions, 9 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index ea2bc0fa7b..5c2e1b6f01 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -1927,10 +1927,12 @@ NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_I /* ugly temp hack for these next two */ /* This should be a 'netbios domain -> DNS domain' mapping */ - dnsdomname[0] = '\0'; - get_mydnsdomname(dnsdomname); + dnsdomname = get_mydnsdomname(p->mem_ctx); + if (!dnsdomname) { + return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; + } strlower_m(dnsdomname); - + dns_name = dnsdomname; forest_name = dnsdomname; diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index aba56c2d05..fe7a12940e 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2401,20 +2401,20 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *ctx, fstring value, uint return WERR_OK; } - if (!StrCaseCmp(value, "DNSMachineName")) { - pstring hostname; - - if (!get_mydnsfullname(hostname)) + if (!StrCaseCmp(value, "DNSMachineName")) { + const char *hostname = get_mydnsfullname(); + + if (!hostname) return WERR_BADFILE; *type = REG_SZ; - *needed = 2*(strlen(hostname)+1); + *needed = 2*(strlen(hostname)+1); if((*data = (uint8 *)TALLOC(ctx, (*needed > in_size) ? *needed:in_size )) == NULL) return WERR_NOMEM; memset(*data, 0, (*needed > in_size) ? *needed:in_size); for (i=0; i<strlen(hostname); i++) { (*data)[2*i]=hostname[i]; (*data)[2*i+1]='\0'; - } + } return WERR_OK; } |