Clean up ctdb_check_directories* eventscript functions.
authorMartin Schwenke <martin@meltin.net>
Mon, 12 Oct 2009 05:32:49 +0000 (16:32 +1100)
committerMartin Schwenke <martin@meltin.net>
Mon, 12 Oct 2009 05:32:49 +0000 (16:32 +1100)
commitab98c1b0f100d2bed1a5def42a5b6dde01cc904c
treefe4e202314db7ee118a7f2f667715318d78b27d5
parentd8e2ddc5a823b676b6f040852c0f53220ba0ada2
Clean up ctdb_check_directories* eventscript functions.

There are 2 problems with this code:

* The loop in ctdb_check_directories_probe() breaks on filenames
  containing whitespace.

  The fix to protect them is to pass "$@" to this function and have it
  operate on "$@".

  Note that there's still a problem with whitespace in filenames in
  the 50.samba eventscript.  To fix this ctdb_check_directories_probe
  should read the filenames from stdin.  Another time...

* The check for '%' in filenames in ctdb_check_directories_probe()
  ends up involving several forks.  On a modern machine this can cost
  a couple of minutes when checking a large number of directories.

  The fix is to use a case statement.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit eb1fecaef9aa5cb85dff7d4f7af8a9878deabed8)
ctdb/config/functions