From: Volker Lendecke Date: Mon, 21 Oct 2024 10:20:55 +0000 (+0200) Subject: smbd: Don't print cwd before tcon is done X-Git-Tag: tdb-1.4.13~536 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ab88a1fe7b48bd22e8516849ad4f21e9365fcd9;p=thirdparty%2Fsamba.git smbd: Don't print cwd before tcon is done vfs_GetWd depends upon a current tcon in fake_acls, otherwise it will call openat with an invalid dirfd on a relative pathname. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index e8f51003a1e..74ab3d9dd08 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -453,9 +453,8 @@ static void print_impersonation_info(connection_struct *conn) return; } - cwdfname = vfs_GetWd(talloc_tos(), conn); - if (cwdfname == NULL) { - return; + if (conn->tcon_done) { + cwdfname = vfs_GetWd(talloc_tos(), conn); } DBG_INFO("Impersonated user: uid=(%d,%d), gid=(%d,%d), cwd=[%s]\n", @@ -463,7 +462,7 @@ static void print_impersonation_info(connection_struct *conn) (int)geteuid(), (int)getgid(), (int)getegid(), - cwdfname->base_name); + cwdfname ? cwdfname->base_name : "no cwd"); TALLOC_FREE(cwdfname); }