[Samba] prexec change between 3.0.24 to 3.0.25

Jeremy Allison jra at samba.org
Fri May 18 06:52:18 GMT 2007


On Fri, May 18, 2007 at 01:38:39PM +0700, mitrohin a.s. wrote:
> 
> hmm... now i must rewrite this example?

Yes, sorry.

>         root preexec = ( /bin/mkdir -m 0700 '/home/.shares/profiles/%U' && \
>                 /usr/sbin/chown '%U:%G' '/home/.shares/profiles/%U' ) || {\
>                 /usr/bin/find '/home/.shares/profiles/%U/Main menu' \
>                         -type f -name desktop.ini -delete; \
>                 /usr/bin/find '/home/.shares/profiles/%U/Recent' \
>                         -type f -name '*.lnk' -delete; \
>                 /bin/rm -rvf '/home/.shares/profiles/%U/Application Data' \
>                         '/home/.shares/profiles/%U/My Documents'; \
>                 }
> please, make example with shell exploit what impossibility to rewrite safely 
> on shell self.

Rather than putting executable shell script in smb.conf,
move this into a file as a shell script and pass %U, %G
as parameters to it from smb.conf - that should be much
safer.

Jeremy.


More information about the samba mailing list