Typos in source4/scripting/bin/samba_backup

Michael Wood esiotrot at gmail.com
Sat Jan 8 06:36:40 MST 2011


Hi

Sorry, I forgot to copy the list.

On 7 January 2011 23:59, Matthieu Patou <mat at samba.org> wrote:
> Hi Micheal,
>>>
>>> I agree that the samba_backup script should not back up all the data
>>> on all of the shares, but just stuff that's necessary for Samba to
>>> function properly.
>>>
>>> By the way, there are some typos in the script.  A variable called
>>> relativedirname is set at the top of the loop, and then further down,
>>> refativedirname and relativedirname are both used a few times.
>>>
>>> This probably works because you cd to $FROMWHERE before the loop and
>>> the "find $refativedirname -name ..." expands to "find -name ..."
>>> which is treated the same as "find . -name ..." by GNU find (but not
>>> BSD find and the versions from proprietary UNIXes as far as I
>>> remember.)
>>>
>>> I haven't tested to see what happens if I rename all instances of
>>> refativedirname to relativedirname.
>
> Thanks for your eagle's eye !
>
> Can you either fill a bug of (better) provide us a patch I'll sign it off.

Here's the patch.

By the way, I noticed another minor issue.  If you have run an
upgradeprovision and you still have the backup, then relativedirname
will contain both the current and the old paths for sysvol:

# for d in private etc sysvol; do
> rel=`find . -type d -name "$d" -prune`
> echo rel: $rel
> n=`echo $d | sed 's/\//_/g'`
> echo n: $n
> done
rel: ./private
n: private
rel: ./etc
n: etc
rel: ./private/backupprovisionQ9w8wA/sysvol ./sysvol
n: sysvol

It seems it will just back up a little more than necessary, so it's
not a big problem.

-- 
Michael Wood <esiotrot at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s4-samba_backup-Fix-typos.patch
Type: text/x-diff
Size: 1317 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20110108/aacb0420/attachment.patch>


More information about the samba-technical mailing list