[Samba] Failed to prepare gensec: NT_STATUS_INVALID_SERVER_STATE

Flole flole at flole.de
Mon Nov 22 18:46:17 UTC 2021


I'm seeing the same issue since updating to 4.13 on my Ubuntu system and 
I have done additional debugging and reported an issue for the Ubuntu 
package at https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1951490.

To sum it up here aswell:

Enabling debug logs show that this is caused by the ownership of a 
directory which samba complains is not matching:

[2021/11/19 01:48:37.482365, 4, effective(30000XX, 100), real(30000XX, 
0)] 
../../source3/rpc_server/rpc_ncacn_np.c:110(make_internal_rpc_pipe_socketpair)
   Create of internal pipe \pipe\spoolss requested
[2021/11/19 01:48:37.485785, 3, effective(30000XX, 100), real(30000XX, 
0)] ../../lib/util/util.c:483(directory_create_or_exist_strict)
   directory_create_or_exist_strict: invalid ownership on directory 
/var/lib/samba/private/msg.sock
[2021/11/19 01:48:37.485807, 1, effective(30000XX, 100), real(30000XX, 
0)] ../../source3/auth/auth_samba4.c:248(prepare_gensec)
   imessaging_init failed

The issue is caused by /var/lib/samba/private/msg.sock being owned by 
root:root in my case (and it gets created with those permissions aswell 
if I delete it), but 
https://github.com/samba-team/samba/blob/db11778b57610e24324aa4342f89918f66157d71/source4/lib/messaging/messaging.c#L507 
uses geteuid() which is sometimes the user ID of the connecting user (as 
can be seen above, XX is the number that represents the uid of the 
windows user connecting).

I am not sure if this is related to my "unable to print"-issue but this 
happens whenever I try to print and whenever the print queue is 
refreshed by a client.





More information about the samba mailing list