#include <EtcFstab.h>
Public Member Functions | |
| EtcFstab (const string &prefix="", bool rootMounted=true) | |
| bool | findDevice (const string &dev, FstabEntry &entry) const |
| bool | findDevice (const std::list< string > &dl, FstabEntry &entry) const |
| bool | findMount (const string &mount, FstabEntry &entry) const |
| bool | findMount (const string &mount) const |
| bool | findUuidLabel (const string &uuid, const string &label, FstabEntry &entry) const |
| bool | findIdPath (const list< string > &id, const string &path, FstabEntry &entry) const |
| void | setDevice (const FstabEntry &entry, const string &device) |
| int | updateEntry (const FstabChange &entry) |
| int | addEntry (const FstabChange &entry) |
| int | removeEntry (const FstabEntry &entry) |
| int | changeRootPrefix (const string &prfix) |
| void | getFileBasedLoops (const string &prefix, std::list< FstabEntry > &l) const |
| list< FstabEntry > | getEntries () const |
| Text | addText (bool doing, bool crypto, const string &mp) const |
| Text | updateText (bool doing, bool crypto, const string &mp) const |
| Text | removeText (bool doing, bool crypto, const string &mp) const |
| int | flush () |
Protected Member Functions | |
| void | readFiles () |
| int | findPrefix (const AsciiFile &tab, const string &mount) const |
| AsciiFile * | findFile (const FstabEntry &e, AsciiFile *&fstab, AsciiFile *&cryptotab, int &lineno) const |
| bool | findCrtab (const FstabEntry &e, const AsciiFile &crtab, int &lineno) const |
| bool | findCrtab (const string &device, const AsciiFile &crtab, int &lineno) const |
| string | updateLine (const std::list< string > &ol, const std::list< string > &nl, const string &line) const |
| string | createLine (const std::list< string > &ls, unsigned fields, const unsigned *flen) const |
| string | createTabLine (const FstabEntry &e) const |
| string | createCrtabLine (const FstabEntry &e) const |
| void | updateTabLine (list< string >(*fnc)(const FstabEntry &e), const FstabEntry &old, const FstabEntry &nnew, string &line) const |
Static Protected Member Functions | |
| static string | fstabEncode (const string &) |
| static string | fstabDecode (const string &) |
Protected Attributes | |
| string | prefix |
| std::list< Entry > | co |
Static Protected Attributes | |
| static const unsigned | fstabFields [6] = { 20, 20, 10, 21, 1, 1 } |
| static const unsigned | cryptotabFields [6] = { 11, 15, 20, 10, 10, 1 } |
| static const unsigned | crypttabFields [6] = { 15, 20, 10, 1 } |
Classes | |
| struct | Entry |
| storage::EtcFstab::EtcFstab | ( | const string & | prefix = "", |
|
| bool | rootMounted = true | |||
| ) |
References readFiles(), and y2mil.
| bool storage::EtcFstab::findDevice | ( | const string & | dev, | |
| FstabEntry & | entry | |||
| ) | const |
| bool storage::EtcFstab::findDevice | ( | const std::list< string > & | dl, | |
| FstabEntry & | entry | |||
| ) | const |
References co.
| bool storage::EtcFstab::findMount | ( | const string & | mount, | |
| FstabEntry & | entry | |||
| ) | const |
References co.
Referenced by storage::Volume::doFstabUpdate(), findMount(), storage::Volume::getFstabData(), and storage::TmpfsCo::getTmpfsData().
| bool storage::EtcFstab::findMount | ( | const string & | mount | ) | const [inline] |
References findMount().
| bool storage::EtcFstab::findUuidLabel | ( | const string & | uuid, | |
| const string & | label, | |||
| FstabEntry & | entry | |||
| ) | const |
| bool storage::EtcFstab::findIdPath | ( | const list< string > & | id, | |
| const string & | path, | |||
| FstabEntry & | entry | |||
| ) | const |
| void storage::EtcFstab::setDevice | ( | const FstabEntry & | entry, | |
| const string & | device | |||
| ) |
References co, storage::FstabEntry::dentry, and y2mil.
Referenced by storage::Volume::getFstabData().
| int storage::EtcFstab::updateEntry | ( | const FstabChange & | entry | ) |
References storage::EtcFstab::Entry::ADD, co, storage::FstabChange::dentry, storage::FstabChange::device, storage::FSTAB_ENTRY_NOT_FOUND, storage::FstabChange::mount, storage::EtcFstab::Entry::NONE, storage::EtcFstab::Entry::REMOVE, storage::EtcFstab::Entry::UPDATE, and y2mil.
Referenced by storage::Volume::doFstabUpdate().
| int storage::EtcFstab::addEntry | ( | const FstabChange & | entry | ) |
| int storage::EtcFstab::removeEntry | ( | const FstabEntry & | entry | ) |
| int storage::EtcFstab::changeRootPrefix | ( | const string & | prfix | ) |
References storage::EtcFstab::Entry::ADD, co, storage::FSTAB_CHANGE_PREFIX_IMPOSSIBLE, storage::EtcFstab::Entry::NONE, prefix, readFiles(), and y2mil.
Referenced by storage::Storage::rootMounted().
| void storage::EtcFstab::getFileBasedLoops | ( | const string & | prefix, | |
| std::list< FstabEntry > & | l | |||
| ) | const |
References storage::checkNormalFile(), co, and storage::EtcFstab::Entry::NONE.
Referenced by storage::LoopCo::getLoopData().
| list< FstabEntry > storage::EtcFstab::getEntries | ( | ) | const |
References co, and storage::EtcFstab::Entry::NONE.
Referenced by storage::NfsCo::getNfsData(), and storage::Storage::readFstab().
| Text storage::EtcFstab::addText | ( | bool | doing, | |
| bool | crypto, | |||
| const string & | mp | |||
| ) | const |
| Text storage::EtcFstab::updateText | ( | bool | doing, | |
| bool | crypto, | |||
| const string & | mp | |||
| ) | const |
References storage::_(), and storage::sformat().
Referenced by storage::Volume::doFstabUpdate(), and storage::Volume::fstabUpdateText().
| Text storage::EtcFstab::removeText | ( | bool | doing, | |
| bool | crypto, | |||
| const string & | mp | |||
| ) | const |
References storage::_(), and storage::sformat().
Referenced by storage::Volume::doFstabUpdate(), and storage::Volume::fstabUpdateText().
| int storage::EtcFstab::flush | ( | ) |
References storage::EtcFstab::Entry::ADD, storage::AsciiFile::append(), storage::checkDir(), co, createCrtabLine(), storage::createPath(), createTabLine(), storage::extractNthWord(), findCrtab(), findFile(), findPrefix(), storage::FSTAB_REMOVE_ENTRY_NOT_FOUND, storage::FSTAB_UPDATE_ENTRY_NOT_FOUND, storage::AsciiFile::insert(), storage::makeCrStringList(), storage::makeStringList(), storage::EtcFstab::Entry::NONE, prefix, storage::AsciiFile::remove(), storage::EtcFstab::Entry::REMOVE, storage::AsciiFile::save(), storage::EtcFstab::Entry::UPDATE, updateTabLine(), y2mil, and y2war.
Referenced by storage::Storage::addFstabEntry(), and storage::Volume::doFstabUpdate().
| void storage::EtcFstab::readFiles | ( | ) | [protected] |
References storage::EtcFstab::Entry::ADD, storage::FstabEntry::calcDependent(), storage::checkNormalFile(), storage::classic(), co, storage::FstabEntry::cr_key, storage::FstabEntry::cr_opts, storage::FstabEntry::cryptotab, storage::FstabEntry::crypttab, storage::FstabEntry::dentry, storage::FstabEntry::device, storage::FstabEntry::dmcrypt, storage::ENC_LUKS, storage::ENC_UNKNOWN, storage::FstabEntry::encr, storage::FstabEntry::freq, storage::FstabEntry::fs, fstabDecode(), getline(), storage::FstabEntry::loop, storage::FstabEntry::loop_dev, storage::FstabEntry::mount, storage::EtcFstab::Entry::nnew, storage::FstabEntry::noauto, storage::EtcFstab::Entry::old, storage::FstabEntry::opts, storage::FstabEntry::passno, prefix, storage::splitString(), storage::FstabEntry::tmpcrypt, storage::toValueWithFallback(), and y2mil.
Referenced by changeRootPrefix(), and EtcFstab().
| int storage::EtcFstab::findPrefix | ( | const AsciiFile & | tab, | |
| const string & | mount | |||
| ) | const [protected] |
References storage::AsciiFile::find_if_idx(), storage::AsciiFile::name(), and y2mil.
Referenced by flush().
| AsciiFile * storage::EtcFstab::findFile | ( | const FstabEntry & | e, | |
| AsciiFile *& | fstab, | |||
| AsciiFile *& | cryptotab, | |||
| int & | lineno | |||
| ) | const [protected] |
References storage::FstabEntry::cryptotab, storage::FstabEntry::dentry, storage::AsciiFile::find_if_idx(), fstabEncode(), storage::FstabEntry::mount, prefix, and y2mil.
Referenced by flush().
| bool storage::EtcFstab::findCrtab | ( | const FstabEntry & | e, | |
| const AsciiFile & | crtab, | |||
| int & | lineno | |||
| ) | const [protected] |
References storage::FstabEntry::dentry, storage::FstabEntry::device, storage::AsciiFile::find_if_idx(), and y2mil.
Referenced by flush().
| bool storage::EtcFstab::findCrtab | ( | const string & | device, | |
| const AsciiFile & | crtab, | |||
| int & | lineno | |||
| ) | const [protected] |
References storage::AsciiFile::find_if_idx(), and y2mil.
| string storage::EtcFstab::updateLine | ( | const std::list< string > & | ol, | |
| const std::list< string > & | nl, | |||
| const string & | line | |||
| ) | const [protected] |
References storage::app_ws.
| string storage::EtcFstab::createLine | ( | const std::list< string > & | ls, | |
| unsigned | fields, | |||
| const unsigned * | flen | |||
| ) | const [protected] |
| string storage::EtcFstab::createTabLine | ( | const FstabEntry & | e | ) | const [protected] |
| string storage::EtcFstab::createCrtabLine | ( | const FstabEntry & | e | ) | const [protected] |
References createLine(), crypttabFields, storage::FstabEntry::dentry, storage::FstabEntry::device, storage::lengthof(), storage::makeCrStringList(), storage::FstabEntry::mount, and y2mil.
Referenced by flush().
| void storage::EtcFstab::updateTabLine | ( | list< string >(*)(const FstabEntry &e) | fnc, | |
| const FstabEntry & | old, | |||
| const FstabEntry & | nnew, | |||
| string & | line | |||
| ) | const [protected] |
Referenced by flush().
| string storage::EtcFstab::fstabEncode | ( | const string & | s | ) | [static, protected] |
Referenced by createLine(), and findFile().
| string storage::EtcFstab::fstabDecode | ( | const string & | s | ) | [static, protected] |
Referenced by readFiles().
const unsigned storage::EtcFstab::fstabFields = { 20, 20, 10, 21, 1, 1 } [static, protected] |
Referenced by createTabLine().
const unsigned storage::EtcFstab::cryptotabFields = { 11, 15, 20, 10, 10, 1 } [static, protected] |
Referenced by createTabLine().
const unsigned storage::EtcFstab::crypttabFields = { 15, 20, 10, 1 } [static, protected] |
Referenced by createCrtabLine().
string storage::EtcFstab::prefix [protected] |
Referenced by changeRootPrefix(), findFile(), flush(), and readFiles().
std::list<Entry> storage::EtcFstab::co [protected] |
Referenced by addEntry(), changeRootPrefix(), findDevice(), findIdPath(), findMount(), findUuidLabel(), flush(), getEntries(), getFileBasedLoops(), readFiles(), removeEntry(), setDevice(), and updateEntry().
1.5.6