1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

s3/service: convert lp_force_user() to const

Avoid set_conn_force_user_group() talloc stackframe leaks in doing so.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
David Disseldorp 2018-06-25 02:22:31 +02:00 committed by Jeremy Allison
parent c53646bccd
commit c58194e3d2
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
<samba:parameter name="force user"
type="string"
constant="1"
context="S"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>

View File

@ -372,7 +372,7 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
{
NTSTATUS status;
if (*lp_force_user(talloc_tos(), snum)) {
if (*lp_force_user(snum)) {
/*
* Replace conn->session_info with a completely faked up one
@ -384,7 +384,7 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
struct auth_session_info *forced_serverinfo;
bool guest;
fuser = talloc_string_sub(conn, lp_force_user(talloc_tos(), snum), "%S",
fuser = talloc_string_sub(conn, lp_force_user(snum), "%S",
lp_const_servicename(snum));
if (fuser == NULL) {
return NT_STATUS_NO_MEMORY;