Hi! We have three Sun E450 fileserver serving a total of 20000 users, theese fileservers NFS export all homedirs to our samba-servers (four boxes running ix86 Solaris). Instead of having an NT machine serving profiles, we have profiles over Samba. Now to the problem: Is it possible to get the Path= in the smb.conf to be "dynamical" ie. dependent on the machine the request came from? To claryfy this, I'll make an example: Let's say you have two different computer labs which require two different profiles, then we want something like this: [profile] path = %H/.profile/__labdependent__/ What would've been great if it was possible to make samba check a file for hostnames and if connecting host is found, it should use path= from that file. ie: lab1-h02.domain.com path=%H/.profile/lab1-pc02/ lab1-h??.domain.com path=%H/.profile/lab1/ lab2-h??.domain.com path=%H/.profile/lab2/ lab3-h*.domain.com path=%H/.profile/lab3/ This way, one only need to specify one share. If you have a lot of labs, it'll get messy to maintain a config file for all the diff. labs. If it's not possible today, could someone please give some small directions about where I should alter the code to implement this? -- -Thomas
> Let's say you have two different computer labs which require two different > profiles, then we want something like this: > > [profile] > path = %H/.profile/__labdependent__/ > > What would've been great if it was possible to make samba check a file for > hostnames and if connecting host is found, it should use path= from that > file. ie: > > lab1-h02.domain.com path=%H/.profile/lab1-pc02/ > lab1-h??.domain.com path=%H/.profile/lab1/ > lab2-h??.domain.com path=%H/.profile/lab2/ > lab3-h*.domain.com path=%H/.profile/lab3/ > > This way, one only need to specify one share. If you have a lot of labs, > it'll get messy to maintain a config file for all the diff. labs.A useful addition to Samba would be the ability to take the output of a command to be part of the smb.conf (as a more general way of doing Thomas's suggestion above. As an example, I'd like to be able to do something like the following: [profile] path = %H/.profile/`/usr/local/samba/etc/labdependent %M`/ where /usr/local/samba/etc/labdependent would be a script taking a single argument, and having a string as output. This could be made arbitrarily complex - for example, you could allow certain users to connect only from certain machines. The example uses the backtick character (`) because it's logical in this context. I'm not really a coder, so I'm not volunteering to produce a patch. But does this look like a sensible way of doing this? Martin -- Martin Radford | "Only wimps use tape backup: _real_ martin@zamenhof.demon.co.uk | men just upload their important stuff -o) Registered Linux user #9257 | on ftp and let the rest of the world /\\ - see http://counter.li.org | mirror it ;)" - Linus Torvalds _\_V
Martin Radford:> [profile] > path = %H/.profile/`/usr/local/samba/etc/labdependent %M`/ > where /usr/local/samba/etc/labdependent would be a script taking a > single argument, and having a string as output. This could be made > arbitrarily complex - for example, you could allow certain users to > connect only from certain machines.I actually started working on something now that would work like this: enhanced path = /program/bin/returnpath.sh %I The value of "enhanced path" will be treated like a program, and popen will be called on it. popen will read one line, and continue. This means that the script/program itself can return the whole path as it should be (ie. with %H etc). -- -Thomas