Ulrich Sibiller
2025-Jul-15 11:10 UTC
[Samba] Dynamic share configuration at connection time?
Ulrich Sibiller via samba schrieb am 07.07.2025 17:30:> Hello, > > tl/dr: Is it possible to have a script that this run when a client > connects to a share which determines and sets the config of that share on > the fly?...> I would like to spare the manual maintenance of the config file and > instead have a script that runs when a client connects to > <server>/<filesystem>. This script should determine the correct > configuration and apply it on the fly for that share (or connection) only. > (Note that the determination cannot be done by the DFS generation script > as it has limited access to the required information.)Unfortunately no-one has reacted so far. I am thinking about writing an own VFS module for this but I am unsure if that is possible at all via a VFS module. Does anybody know? Thanks, Ulrich Sibiller -- Dipl.-Inf. Ulrich Sibiller Senior IT Consultant T: +49 (0) 7071 9457 681 (Hotline) Hagellocher Weg 73?? 72070 T?bingen?? Germany eviden.com Eviden Germany GmbH; Gesch?ftsf?hrung: Christian Peter Ernst, Boris Hecker; Vorsitzender des Aufsichtsrates: Paul Peterson; Sitz der Gesellschaft: M?nchen; Registergericht: Amtsgericht M?nchen, HRB 281696
Ralph Boehme
2025-Jul-15 11:47 UTC
[Samba] Dynamic share configuration at connection time?
On 7/15/25 1:10 PM, Ulrich Sibiller via samba wrote:> Unfortunately no-one has reacted so far.at least to me this just required too much mind bending for which I didn't have the time on a volunteer basis.> I am thinking about writing an own VFS module for this but I am > unsure if that is possible at all via a VFS module. Does anybody > know?Without really understanding what you're aiming at, but have you considered "root preexec"? The script receives a bunch of useful information: if (*lp_root_preexec(talloc_tos(), lp_sub, snum)) { char *cmd = talloc_sub_full(talloc_tos(), lp_const_servicename(SNUM(conn)), conn->session_info->unix_info->unix_name, conn->connectpath, conn->session_info->unix_token->gid, conn->session_info->unix_info->sanitized_username, conn->session_info->info->domain_name, lp_root_preexec(talloc_tos(), lp_sub, snum)); -slow -- SerNet Samba Team Lead https://sernet.com/ Samba Team Member https://samba.org/ Samba Support and Dev https://samba.plus/services/ SAMBA+ packages https://samba.plus/products/samba -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20250715/adaf0ae1/OpenPGP_signature.sig>