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)
commiteb1fecaef9aa5cb85dff7d4f7af8a9878deabed8
tree2d0eac3268db73fb4dd4a7f737610705587ca882
parent318abeb4b913a8d846e7eaf4cf5c2a67b61ce974
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>
config/functions