The Samba-Bugzilla – Attachment 18152 Details for
Bug 15488
print command %i/%I/%m/%M substitution broken (with tentative patch)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
tentative patch
samba-4.19-spoolss-subst-fix.patch (text/plain), 3.21 KB, created by
Franz Sirl
on 2023-10-06 09:35:24 UTC
(
hide
)
Description:
tentative patch
Filename:
MIME Type:
Creator:
Franz Sirl
Created:
2023-10-06 09:35:24 UTC
Size:
3.21 KB
patch
obsolete
>diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c >index 73938dc2b88..bfe3ac47eb3 100644 >--- a/source3/auth/auth_ntlmssp.c >+++ b/source3/auth/auth_ntlmssp.c >@@ -171,7 +171,8 @@ struct tevent_req *auth3_check_password_send( > /* The client has given us its machine name (which we only get over NBT transport). > We need to possibly reload smb.conf if smb.conf includes depend on the machine name. */ > >- set_remote_machine_name(user_info->workstation_name, True); >+ DEBUG(2, ("user_info->workstation_name %s\n", user_info->workstation_name)); >+ set_remote_machine_name(user_info->workstation_name, False); > > nt_status = make_user_info_map(talloc_tos(), > &mapped_user_info, >diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c >index 40eb15aee04..5fc8cf0de3c 100644 >--- a/source3/lib/substitute.c >+++ b/source3/lib/substitute.c >@@ -90,7 +90,9 @@ bool set_remote_machine_name(const char *remote_name, bool perm) > static bool already_perm = False; > char tmp[MACHINE_NAME_SIZE]; > >+ DEBUG(2, ("set_remote_machine_name/perm=%s: %s\n", perm ? "true" : "false", remote_name)); > if (already_perm) { >+ DEBUG(2, ("set_remote_machine_name/already_perm=true: %s\n", remote_machine)); > return true; > } > >diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c >index 883eebc6474..72d0c1cd452 100644 >--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c >+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c >@@ -65,6 +65,7 @@ > #include "printing/nt_printing_migrate_internal.h" > #include "lib/util/string_wrappers.h" > #include "lib/global_contexts.h" >+#include "source3/lib/substitute.h" > > /* macros stolen from s4 spoolss server */ > #define SPOOLSS_BUFFER_UNION(fn,info,level) \ >@@ -1681,11 +1682,14 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p, > { > struct dcesrv_call_state *dce_call = p->dce_call; > struct dcesrv_connection *dcesrv_conn = dce_call->conn; >+ const struct tsocket_address *local_address = >+ dcesrv_connection_get_local_address(dcesrv_conn); > const struct tsocket_address *remote_address = > dcesrv_connection_get_remote_address(dcesrv_conn); > struct auth_session_info *session_info = > dcesrv_call_session_info(dce_call); > int snum; >+ char *laddr; > char *raddr; > char *rhost; > struct printer_handle *Printer=NULL; >@@ -1869,6 +1873,13 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p, > } > > /* check smb.conf parameters and the the sec_desc */ >+ laddr = tsocket_address_inet_addr_string(local_address, >+ p->mem_ctx); >+ if (laddr == NULL) { >+ return WERR_NOT_ENOUGH_MEMORY; >+ } >+ >+ DEBUG(2, ("remote:laddr = %s\n", laddr)); > raddr = tsocket_address_inet_addr_string(remote_address, > p->mem_ctx); > if (raddr == NULL) { >@@ -1881,6 +1892,8 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p, > if (rc < 0) { > return WERR_NOT_ENOUGH_MEMORY; > } >+ DEBUG(2, ("remote:raddr = %s\n", raddr)); >+ DEBUG(2, ("remote:rhost = %s\n", rhost)); > if (strequal(rhost, "UNKNOWN")) { > rhost = raddr; > } >@@ -1925,6 +1938,7 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p, > p->msg_ctx, > lp_const_servicename(snum)); > >+ sub_set_socket_ids(raddr, rhost, laddr); > break; > > default:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15488
: 18152