Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ntdb(3) [centos man page]

NTDB(3) 						    System Administration tools 						   NTDB(3)

NAME
ntdb - A not-so trivial keyword/data database system SYNOPSIS
#include <ntdb.h> DESCRIPTION
If you have previously used the tdb library from Samba, much of this will seem familiar, but there are some API changes which a compiler will warn you about if you simply replace 'tdb' with 'ntdb' in your code! The on-disk format for ntdb is incompatible with tdb. tdb's API was based on gdbm, and ntdb continues this tradition, with enhancements. A differences guide is available in the text file lib/ntdb/doc/TDB_porting.txt in the SAMBA source tree. NTDB API OVERVIEW
The complete API is documented in the ntdb.h header, which is kept up-to-date and recommended reading. Normal usage is to call ntdb_open() to create or open an ntdb file. ntdb_store() is used to add records, ntdb_fetch() is used to fetch them. Traversals are supported via callback (ntdb_traverse()) or iteration (ntdb_firstkey() and ntdb_nextkey()). Transactions are supported for batching updates or reads atomically, using ntdb_transaction_start() and ntdb_transaction_commit(). Use With Talloc ntdb_open() takes an optional linked list of attributes: in particular you can specify an alternate allocator (such as talloc): #include <talloc.h> #include <ntdb.h> static void *my_alloc(const void *owner, size_t len, void *priv) { return talloc_size(owner, len); } static void *my_expand(void *old, size_t newlen, void *priv) { return talloc_realloc_size(NULL, old, newlen); } static void my_free(void *old, void *priv) { talloc_free(old); } /* This opens an ntdb file as a talloc object with given parent. */ struct ntdb_context *ntdb_open_talloc(const void *parent, const char *filename) { struct ntdb_context *ntdb; union ntdb_attribute alloc; alloc.base.attr = NTDB_ATTRIBUTE_ALLOCATOR; alloc.base.next = NULL; alloc.alloc.alloc = my_alloc; alloc.alloc.expand = my_expand; alloc.alloc.free = my_free; ntdb = ntdb_open(filename, NTDB_DEFAULT, O_RDWR|O_CREAT, 0600, &alloc); if (ntdb) { talloc_steal(parent, ntdb); talloc_set_name(ntdb, "%s", filename); } return ntdb; } SEE ALSO
http://tdb.samba.org/ AUTHOR
The original tdb software was created by Andrew Tridgell, and is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. ntdb was derived from tdb, but mostly rewritten by Rusty Russell. COPYRIGHT
/LICENSE Copyright (C) Rusty Russell 2013, IBM Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/. Samba 4.1 06/17/2014 NTDB(3)

Check Out this Related Man Page

TDBBACKUP(8)						    System Administration tools 					      TDBBACKUP(8)

NAME
tdbbackup - tool for backing up and for validating the integrity of samba .tdb files SYNOPSIS
tdbbackup [-s suffix] [-v] [-h] DESCRIPTION
This tool is part of the samba(1) suite. tdbbackup is a tool that may be used to backup samba .tdb files. This tool may also be used to verify the integrity of the .tdb files prior to samba startup or during normal operation. If it finds file damage and it finds a prior backup the backup file will be restored. OPTIONS
-h Get help information. -s suffix The -s option allows the adminisistrator to specify a file backup extension. This way it is possible to keep a history of tdb backup files by using a new suffix for each backup. -v The -v will check the database for damages (currupt data) which if detected causes the backup to be restored. COMMANDS
GENERAL INFORMATION The tdbbackup utility can safely be run at any time. It was designed so that it can be used at any time to validate the integrity of tdb files, even during Samba operation. Typical usage for the command will be: tdbbackup [-s suffix] *.tdb Before restarting samba the following command may be run to validate .tdb files: tdbbackup -v [-s suffix] *.tdb Note that Samba 4 can use .ntdb files instead, so you should use ntdbbackup on those files. Samba .tdb files are stored in various locations, be sure to run backup all .tdb file on the system. Important files includes: o secrets.tdb - usual location is in the /usr/local/samba/private directory, or on some systems in /etc/samba. o passdb.tdb - usual location is in the /usr/local/samba/private directory, or on some systems in /etc/samba. o *.tdb located in the /usr/local/samba/var directory or on some systems in the /var/cache or /var/lib/samba directories. VERSION
This man page is correct for version 3 of the Samba suite. AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. The tdbbackup man page was written by John H Terpstra. Samba 3.6 06/10/2014 TDBBACKUP(8)
Man Page