diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-02-20 14:59:42 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-02-20 05:31:19 +0100 |
commit | f3c0d1d7fe71be7e8b2d1a9780586f8654b46469 (patch) | |
tree | 6a810060c42d3798eaa6f39534a311bbdbf830f6 /libcli/smb | |
parent | 48a42708aead320bfbcee16ae76d095c014802de (diff) | |
download | samba-f3c0d1d7fe71be7e8b2d1a9780586f8654b46469.tar.gz samba-f3c0d1d7fe71be7e8b2d1a9780586f8654b46469.tar.bz2 samba-f3c0d1d7fe71be7e8b2d1a9780586f8654b46469.zip |
dbwrap_local_open: open NTDB if extension is .ntdb
This switches dbwrap_local_open() based on the extension of the
database name, so it handles both TDB and NTDB files.
Moreover, if asked to open a .ntdb, and there's no ntdb file but
there's a .tdb file, it converts that then moves it to .tdb.bak before
opening, and turn the .tdb file into a dangling symlink to make sure
it's never accidentally re-created or used:
$ ls -l secrets.tdb
lrwxrwxrwx 1 rusty rusty 23 Feb 11 11:31 secrets.tdb -> This is now in an NTDB
This provides transparent upgrade if people decide to use NTDB on a
database. Downgrade would be manual, eg:
ntdbdump foo.ntdb | tdbrestore foo.tdb && mv foo.ntdb foo.ntdb.bak
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'libcli/smb')
0 files changed, 0 insertions, 0 deletions