bug (or feature?) in smbclient3 tar exclusion flag (X)

Aurélien Aptel aurelien.aptel at gmail.com
Mon Jul 1 08:41:16 MDT 2013


Hi,

While writing my test suite for smbclient tarmode I realized that
using the X switch to exclude files (instead of directories) silently
fails. This is inconsistent with the include flag which does include
directory /and/ files.

The man page reads:

  X - Exclude files and directories. Causes files to be excluded from
  an extract or create. See example below. Filename globbing works in
  one of two ways now. See r below.

Lets say the root of my *empty* share has this hierarchy:

- dir/
  - f/
    - a
    - b
  - c
  - d

If I make a backup exluding dir/f and dir/d, dir/d is still included
in the tar file. However, if I remove the first 'dir' in the hierarchy
the file is correctly excluded.

I've attached simple test scripts. Make sure the share you're using is
empty. Here are annoted results:

    $ ./test_with_subdir.sh
    # root
    ./dir/c
    ./dir/d
    ./dir/f/a
    ./dir/f/b
    # include dir/f dir/d
    ./dir/d    <--- OK
    ./dir/f/a
    ./dir/f/b
    # exclude dir/f dir/d
    ./dir/c
    ./dir/d    <--- BUG?

    $ ./test_without_subdir.sh
    # root
    ./c
    ./d
    ./f/a
    ./f/b
    # include f d
    ./d       <--- OK
    ./f/a
    ./f/b
    # exclude f d
    ./c
      <--- OK, d excluded

I wanted to make sure it was a bug before opening a new issue on bugzilla.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_with_subdir.sh
Type: application/x-sh
Size: 470 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130701/fc24d751/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_without_subdir.sh
Type: application/x-sh
Size: 418 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130701/fc24d751/attachment-0001.sh>


More information about the samba-technical mailing list