run clang-format

This commit is contained in:
Valient Gough 2016-09-08 20:27:04 +02:00
parent 250b257b7f
commit 95c7d92f94
No known key found for this signature in database
GPG Key ID: B515DCEB95967051
7 changed files with 29 additions and 23 deletions

View File

@ -81,8 +81,9 @@ class EncFS_Context {
* us. * us.
*/ */
typedef std::unordered_map< typedef std::unordered_map<std::string,
std::string, std::forward_list<std::shared_ptr<FileNode>>> FileMap; std::forward_list<std::shared_ptr<FileNode>>>
FileMap;
mutable pthread_mutex_t contextMutex; mutable pthread_mutex_t contextMutex;
FileMap openFiles; FileMap openFiles;

View File

@ -100,8 +100,7 @@ static bool setIV(const std::shared_ptr<FileIO> &io, uint64_t iv) {
bool FileNode::setName(const char *plaintextName_, const char *cipherName_, bool FileNode::setName(const char *plaintextName_, const char *cipherName_,
uint64_t iv, bool setIVFirst) { uint64_t iv, bool setIVFirst) {
// Lock _lock( mutex ); // Lock _lock( mutex );
if (cipherName_) if (cipherName_) VLOG(1) << "calling setIV on " << cipherName_;
VLOG(1) << "calling setIV on " << cipherName_;
if (setIVFirst) { if (setIVFirst) {
if (fsConfig->config->externalIVChaining && !setIV(io, iv)) return false; if (fsConfig->config->externalIVChaining && !setIV(io, iv)) return false;

View File

@ -866,8 +866,9 @@ static void selectBlockMAC(int *macBytes, int *macRandBytes, bool forceMac) {
"performance but it also means [almost] any modifications or errors\n" "performance but it also means [almost] any modifications or errors\n"
"within a block will be caught and will cause a read error.")); "within a block will be caught and will cause a read error."));
} else { } else {
cout << "\n\n" << _("You specified --require-macs. " cout << "\n\n"
"Enabling block authentication code headers...") << _("You specified --require-macs. "
"Enabling block authentication code headers...")
<< "\n\n"; << "\n\n";
addMAC = true; addMAC = true;
} }
@ -1545,8 +1546,7 @@ RootPtr initFS(EncFS_Context *ctx, const std::shared_ptr<EncFS_Opts> &opts) {
/* Reverse mounts are read-only by default (set in main.cpp). /* Reverse mounts are read-only by default (set in main.cpp).
* If uniqueIV is off, writing can be allowed, because there * If uniqueIV is off, writing can be allowed, because there
* is no header that could be overwritten */ * is no header that could be overwritten */
if (config->uniqueIV == false) if (config->uniqueIV == false) opts->readOnly = false;
opts->readOnly = false;
} }
// first, instanciate the cipher. // first, instanciate the cipher.

View File

@ -82,7 +82,8 @@ Interface RawFileIO::interface() const { return RawFileIO_iface; }
be called with a lock around it so that there won't be a race condition be called with a lock around it so that there won't be a race condition
with calls to lstat picking up the wrong permissions. with calls to lstat picking up the wrong permissions.
This works around the problem described in https://github.com/vgough/encfs/issues/181 This works around the problem described in
https://github.com/vgough/encfs/issues/181
Without this, "umask 0777 ; echo foo > bar" fails. Without this, "umask 0777 ; echo foo > bar" fails.
*/ */
static int open_readonly_workaround(const char *path, int flags) { static int open_readonly_workaround(const char *path, int flags) {

View File

@ -220,7 +220,7 @@ int encfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
st.st_ino = inode; st.st_ino = inode;
st.st_mode = fileType << 12; st.st_mode = fileType << 12;
// TODO: add offset support. // TODO: add offset support.
#if defined(fuse_fill_dir_flags) #if defined(fuse_fill_dir_flags)
if (filler(buf, name.c_str(), &st, 0, 0)) break; if (filler(buf, name.c_str(), &st, 0, 0)) break;
#else #else

View File

@ -182,27 +182,31 @@ static int showInfo(int argc, char **argv) {
return EXIT_FAILURE; return EXIT_FAILURE;
case Config_V3: case Config_V3:
// xgroup(diag) // xgroup(diag)
cout << "\n" << autosprintf(_("Version 3 configuration; " cout << "\n"
"created by %s\n"), << autosprintf(_("Version 3 configuration; "
config->creator.c_str()); "created by %s\n"),
config->creator.c_str());
break; break;
case Config_V4: case Config_V4:
// xgroup(diag) // xgroup(diag)
cout << "\n" << autosprintf(_("Version 4 configuration; " cout << "\n"
"created by %s\n"), << autosprintf(_("Version 4 configuration; "
config->creator.c_str()); "created by %s\n"),
config->creator.c_str());
break; break;
case Config_V5: case Config_V5:
// xgroup(diag) // xgroup(diag)
cout << "\n" << autosprintf(_("Version 5 configuration; " cout << "\n"
"created by %s (revision %i)\n"), << autosprintf(_("Version 5 configuration; "
config->creator.c_str(), config->subVersion); "created by %s (revision %i)\n"),
config->creator.c_str(), config->subVersion);
break; break;
case Config_V6: case Config_V6:
// xgroup(diag) // xgroup(diag)
cout << "\n" << autosprintf(_("Version 6 configuration; " cout << "\n"
"created by %s (revision %i)\n"), << autosprintf(_("Version 6 configuration; "
config->creator.c_str(), config->subVersion); "created by %s (revision %i)\n"),
config->creator.c_str(), config->subVersion);
break; break;
} }

View File

@ -155,7 +155,8 @@ static void usage(const char *name) {
" encfs ~/.crypt ~/crypt\n" " encfs ~/.crypt ~/crypt\n"
"\n") "\n")
// xgroup(usage) // xgroup(usage)
<< _("For more information, see the man page encfs(1)") << "\n" << endl; << _("For more information, see the man page encfs(1)") << "\n"
<< endl;
} }
static void FuseUsage() { static void FuseUsage() {