[Samba] preexec script problem

daniel.jarboe at custserv.com daniel.jarboe at custserv.com
Wed May 12 11:21:52 GMT 2004


> i'm running into a little problem when using preexec scripts for the
> creation
> of dir's on my samba server....
> 
> script
> ---
> #! /bin/sh
> name=`getent passwd | grep %U | awk -F: '{print $5}'`
> mkdir /samba/test/"$name"
> ---
> 
> snip of smb.conf
> ---
> [test]
>         path = /samba/test
>         preexec = /root/script
>         browseable = Yes
>         writeable = Yes
>         valid users = @mygroup
>         force group = @mygroup
>         create mask = 0770
>         force create mode = 770
> ---
> 
> anyone have any idea why the dir is not created under "/samba/test" ?
> 
> -ipuy

%U will be substituted within smb.conf, not your script.  You could do
something like preexec = /root/script %U in smb.conf, and then
name=`getent passwd | grep $1 ...

Will your users be able to create directories in /samba/test/ (this dir
is group writable and owned by group mygroup?).  Is it your intention
that one user will be able to read/write/delete another user's files?

~ Daniel











-----------------------------------------------------------------------

This message is the property of Time Inc. or its affiliates. It may be
legally privileged and/or confidential and is intended only for the use
of the addressee(s). No addressee should forward, print, copy, or
otherwise reproduce this message in any manner that would allow it to be
viewed by any individual not originally listed as a recipient. If the
reader of this message is not the intended recipient, you are hereby
notified that any unauthorized disclosure, dissemination, distribution,
copying or the taking of any action in reliance on the information
herein is strictly prohibited. If you have received this communication
in error, please immediately notify the sender and delete this message.
Thank you.



More information about the samba mailing list