]> git.notmuchmail.org Git - notmuch/commit
Avoid segmentation fault with NOTMUCH_CONFIG=/new/config/file notmuch setup
authorCarl Worth <cworth@cworth.org>
Tue, 20 Jul 2010 00:16:18 +0000 (17:16 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 20 Jul 2010 00:16:18 +0000 (17:16 -0700)
commit676d25111e1343ce31cb4a51b26f05a06305cda5
tree1a9fff507d8ddc3160fe7b617778f333382e5259
parent6607fd65b1da6fbd9e617ff1b6d2a1a25c469333
Avoid segmentation fault with NOTMUCH_CONFIG=/new/config/file notmuch setup

Since commit f41a35e2923b0b3ef2f66e91cd30e20b4c1a336a running a command
such as:

NOTMUCH_CONFIG=/new/config/file notmuch setup

would result in a segmentation fault.

The purpose of that commit was to ensure that an attempt to manipulate
a non-standard database would not inadvertently manipulate the default
database only due to a typo in the NOTMUCH_CONFIG environment
variable. That is, a command like:

NOTMUCH_CONFIG=mistyped-config-filename notmuch tag -new tag:new

shouldn't modify the database at ${HOME}/mail, but should instead
simply report that the mistype configuration filename does not exist.

We fix both cases simultaneously by reporting the error message
whenever the function calling notmuch_config_open is not explicitly
prepared for a default configuration file.
notmuch-config.c