vidb8
Manually edit sfs user-authentication database file
Usage
vidb [-w]
[-R]
{-S | -a
[-f
file] | [-e
editor]}
sfs-users-file
Overview
vidb manually edits an SFS user-authentication file , acquiring locks to prevent concurrent updates from overwriting each other. If sfsauthd has been compiled with Sleepycat database (http://www.sleepycat.com/) support, and the name of the file ends in .db/, vidb will consider the user authentication file to be a database directory, and convert the contents into regular ASCII text for editing. If the name of the file ends in .db, vidb assumes the user authentication file is database file (unless the pathname corresponds to an existing directory). Note that database files (as opposed to directories) are required to be read-only, and thus cannot be updated by vidb.
Options
vidb has the following options:
- -a [-f file]
-
The
-aoption adds SFS user records in text form to a database. The records are taken from standard input, or from file if specified. Records for an existing user or group will replace the values already in the database. Unlikevidb's ordinary mode of operation,-adoes not add all records atomically. In the event of a system crash, some but not all of the records may have been added to the database. Simply re-running the samevidbcommand after a crash is perfectly safe, however, since previously added entries will just be overwritten (by themselves) the second time through. For database files, because-adoes not accumulate records into one large transaction, it can be significantly more efficient than simply adding the records in an editor, usingvidb's ordinary mode of operation.
-
-e editor -
Specifies the editor to use for editing the file. The default is to use the command specified by the environment variable EDITOR. If there is no environment variable and
-eis not specified,vidbusesvi.
-
-w -
One of the points of
vidbis to avoid concurrent edits to the database and the corresponding inconsistencies that might result. Ordinarily, if the database is already being edited,vidbwill just exit with an error message. The-wflag tellsvidbto wait until it can acquire the lock on the database before launching the editor.
-
-R -
Runs catastrophic recovery on the database environment. (For those familiar with Sleepycat database software, this corresponds to the
-cflag of thedb_recoverutility, or theDB_RECOVER_FATALflag of the API.) Essentially,-Rreplays all of the database log records present in the supporting files directory. You may need to use this, for example, when restoring a database from backup tapes if the log files were backed up more recently than the entire database. The-Rhas no effect on flat text databases, or if the-Shas been specified.Warning:The authors have encountered bugs in the catastrophic recovery code of at least some versions of the Sleepycat database package. As a precaution, before attempting to use-R, we strongly recommend salvaging whatever records possible from the database file itself using vidb -S sfs-users-file>saved_sfs_users. If, subsequently, the-Roption corrupts the database, you can at least salvage some of the records from the saved_sfs_users file.
-
-S -
Attempt to salvage a database file with corrupt or lost logs by dumping the contents of the database itself. Ordinarily, databases use write-ahead logging. Before opening a database file, both
vidbandsfsauthdattempt to recover from any previous incomplete transactions using the log. The-Soption opens and prints out the contents of a database without regard to the log files. This is useful if you have lost the log files or are worried that they are corrupt, or if you wish to examine the contents of a database you have read but not write permission to. Ordinarily, however, if you wish to dump the contents of a database to standard output, use the command vidb -e cat sfs-users-file.
Releases
2 releases since Debian 3.1 (Sarge); the text changed 1 time.