mirror of
https://github.com/vgough/encfs.git
synced 2024-11-24 17:03:13 +01:00
Correct a segfault in encfsctl (#498)
The context must remain and not die just after init.
Introduced in dcf8435d4c
.
This commit is contained in:
parent
2a24884ff0
commit
b80d30755c
@ -115,6 +115,8 @@ struct CommandOpts {
|
|||||||
gettext_noop(" -- print version number and exit")},
|
gettext_noop(" -- print version number and exit")},
|
||||||
{0, 0, 0, 0, 0, 0}};
|
{0, 0, 0, 0, 0, 0}};
|
||||||
|
|
||||||
|
auto ctx = std::make_shared<EncFS_Context>();
|
||||||
|
|
||||||
static void usage(const char *name) {
|
static void usage(const char *name) {
|
||||||
cerr << autosprintf(_("encfsctl version %s"), VERSION) << "\n"
|
cerr << autosprintf(_("encfsctl version %s"), VERSION) << "\n"
|
||||||
<< _("Usage:\n")
|
<< _("Usage:\n")
|
||||||
@ -252,7 +254,6 @@ static RootPtr initRootInfo(int &argc, char **&argv) {
|
|||||||
--argc;
|
--argc;
|
||||||
++argv;
|
++argv;
|
||||||
|
|
||||||
auto ctx = std::make_shared<EncFS_Context>();
|
|
||||||
ctx->publicFilesystem = opts->ownerCreate;
|
ctx->publicFilesystem = opts->ownerCreate;
|
||||||
if (checkDir(opts->rootDir)) result = initFS(ctx.get(), opts);
|
if (checkDir(opts->rootDir)) result = initFS(ctx.get(), opts);
|
||||||
|
|
||||||
@ -273,7 +274,6 @@ static RootPtr initRootInfo(const char *crootDir) {
|
|||||||
opts->createIfNotFound = false;
|
opts->createIfNotFound = false;
|
||||||
opts->checkKey = false;
|
opts->checkKey = false;
|
||||||
|
|
||||||
auto ctx = std::make_shared<EncFS_Context>();
|
|
||||||
ctx->publicFilesystem = opts->ownerCreate;
|
ctx->publicFilesystem = opts->ownerCreate;
|
||||||
result = initFS(ctx.get(), opts);
|
result = initFS(ctx.get(), opts);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user