if '%u' or '%U' is used in a root preexec script, you do not get the correct usename returned. Previously (i.e. last time I used such a script) it would return the same username as 'getent passwd'. I created a simple test script: #!/bin/bash uSERNAME="$1" Username="$2" logger "$0: %u: $uSERNAME" logger "$0: %U: $Username" The share was this: [testshare] path = /srv/test read only = no root preexec = /usr/local/sbin/testparm.sh %u %U Connecting to the share resulted in this in syslog: 2025-03-14T17:07:28.486254+00:00 rpi5mem root: /usr/local/sbin/testparm.sh: %u: SAMDOMrowland 2025-03-14T17:07:28.488798+00:00 rpi5mem root: /usr/local/sbin/testparm.sh: %U: rowland_samdom.example.com I expected 'rowland' for both.