Re: segfault using python bindings

2019-08-26 Thread David Bremner
Floris Bruynooghe  writes:

>
> I'll try and send a first patch series in the coming week.
>

Sounds great. Thanks for you work on this, and for not being scared of
by the bikeshedding ;).

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: segfault using python bindings

2019-08-26 Thread Floris Bruynooghe
On Wed 21 Aug 2019 at 12:02 -0400, Daniel Kahn Gillmor wrote:

> On Tue 2019-08-20 19:20:30 +0200, Floris Bruynooghe wrote:
>> For path series what did you have in mind?  One single patch with the
>> whole lot?  The original history at https:://github/flub/notdb?
>> Something in between?
>
> I would be happy with a series of patches, but the cited github history
> has only one commit in the first place :P

hah!  Perhaps the actual history is somewhere in a hg repo, but I can't
even find that.  Not that it matters much.

>> I also recall some comments about the naming not being liked much
>> (notdb).  I'm open to some bikeshedding on the naming if it bothers
>> people.  I was only aiming for something short but under a different
>> import name, which are probably still useful features to keep.
>
> fwiw, "notdb" doesn't really resonate with me, but i wouldn't block you
> if you decided to stick with it.
>
> I'd generally prefer something like "notmuch2" because it makes it much
> clearer that it is associated with notmuch, and that it is the successor
> to the original notmuch bindings.

>From the ensuing conversation I'm concluding that "notmuch2" is the most
liked option, so I'll go with that (and yes, I share many of the
disappointed sentiments raised on that naming convention, but it's how
things are in python).


I'll try and send a first patch series in the coming week.

Cheers,
Floris
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH v2] configure: fix out of tree build; check unsafe characters in srcdir

2019-08-26 Thread Tomi Ollila
While check for GMime session key extraction support... was made
out of tree build compatible, related (and some unrelated) unsafe
characters are now checked in notmuch source directory path.

The known unsafe characters in NOTMUCH_SRCDIR are:

- Single quote (') -- NOTMUCH_SRCDIR='${NOTMUCH_SRCDIR}'
  is written to sh.config in configure line 1328.

- Double quote (") -- configure line 521 *now* writes "$srcdir"
  into generated c source file ($NOTMUCH_SRCDIR includes $srcdir).

- Backslash (\) could also be problematic in configure line 521.

- The added $ and ` are potentially unsafe -- inside double quotes
  in shell script those have special meaning.

  Other characters don't expand inside double quoted strings.
---

V2: added missing \ to the case pattern

 configure | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 1e7b9f7a..ef81e71b 100755
--- a/configure
+++ b/configure
@@ -26,6 +26,11 @@ readonly DEFAULT_IFS="$IFS"
 srcdir=$(dirname "$0")
 NOTMUCH_SRCDIR=$(cd "$srcdir" && pwd)
 
+case $NOTMUCH_SRCDIR in ( *\'* | *['\"`$']* )
+   echo "Definitely unsafe characters in source path '$NOTMUCH_SRCDIR'".
+   exit 1
+esac
+
 subdirs="util compat lib parse-time-string completion doc emacs"
 subdirs="${subdirs} performance-test test test/test-databases"
 subdirs="${subdirs} bindings"
@@ -513,7 +518,7 @@ int main () {
 
 g_mime_init ();
 parser = g_mime_parser_new ();
-g_mime_parser_init_with_stream (parser, 
g_mime_stream_file_open("test/corpora/crypto/basic-encrypted.eml", "r", 
));
+g_mime_parser_init_with_stream (parser, 
g_mime_stream_file_open("$srcdir/test/corpora/crypto/basic-encrypted.eml", "r", 
));
 if (error) return !! fprintf (stderr, "failed to instantiate parser with 
test/corpora/crypto/basic-encrypted.eml\n");
 
 body = GMIME_MULTIPART_ENCRYPTED(g_mime_message_get_mime_part 
(g_mime_parser_construct_message (parser, NULL)));
@@ -533,7 +538,7 @@ EOF
 printf 'No.\nCould not make tempdir for testing session-key support.\n'
 errors=$((errors + 1))
 elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c 
${gmime_ldflags} -o _check_session_keys \
-   && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < 
test/gnupg-secret-key.asc \
+   && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < 
"$srcdir"/test/gnupg-secret-key.asc \
&& SESSION_KEY=$(GNUPGHOME=${TEMP_GPG} ./_check_session_keys) \
&& [ $SESSION_KEY = 
9:0BACD64099D1468AB07C796F0C0AC4851948A658A15B34E803865E9FC635F2F5 ]
 then
-- 
2.21.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] configure: fix out of tree build; check unsafe characters in srcdir

2019-08-26 Thread Tomi Ollila
While check for GMime session key extraction support... was made
out of tree build compatible, related (and some unrelated) unsafe
characters are now checked in notmuch source directory path.

The known unsafe characters in NOTMUCH_SRCDIR are:

- Single quote (') -- NOTMUCH_SRCDIR='${NOTMUCH_SRCDIR}'
  is written to sh.config in configure line 1328.

- Double quote (") -- configure line 521 *now* writes "$srcdir"
  into generated c source file ($NOTMUCH_SRCDIR includes $srcdir).

- The added $ and ` and \ are potentially unsafe -- inside double
  quotes in shell script those have special meaning. Other characters
  (except ", of course) don't expand inside double quoted strings.
---
 configure | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 1e7b9f7a..d757ae82 100755
--- a/configure
+++ b/configure
@@ -26,6 +26,11 @@ readonly DEFAULT_IFS="$IFS"
 srcdir=$(dirname "$0")
 NOTMUCH_SRCDIR=$(cd "$srcdir" && pwd)
 
+case $NOTMUCH_SRCDIR in ( *\'* | *['"`$']* )
+   echo "Definitely unsafe characters in source path '$NOTMUCH_SRCDIR'".
+   exit 1
+esac
+
 subdirs="util compat lib parse-time-string completion doc emacs"
 subdirs="${subdirs} performance-test test test/test-databases"
 subdirs="${subdirs} bindings"
@@ -513,7 +518,7 @@ int main () {
 
 g_mime_init ();
 parser = g_mime_parser_new ();
-g_mime_parser_init_with_stream (parser, 
g_mime_stream_file_open("test/corpora/crypto/basic-encrypted.eml", "r", 
));
+g_mime_parser_init_with_stream (parser, 
g_mime_stream_file_open("$srcdir/test/corpora/crypto/basic-encrypted.eml", "r", 
));
 if (error) return !! fprintf (stderr, "failed to instantiate parser with 
test/corpora/crypto/basic-encrypted.eml\n");
 
 body = GMIME_MULTIPART_ENCRYPTED(g_mime_message_get_mime_part 
(g_mime_parser_construct_message (parser, NULL)));
@@ -533,7 +538,7 @@ EOF
 printf 'No.\nCould not make tempdir for testing session-key support.\n'
 errors=$((errors + 1))
 elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c 
${gmime_ldflags} -o _check_session_keys \
-   && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < 
test/gnupg-secret-key.asc \
+   && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < 
"$srcdir"/test/gnupg-secret-key.asc \
&& SESSION_KEY=$(GNUPGHOME=${TEMP_GPG} ./_check_session_keys) \
&& [ $SESSION_KEY = 
9:0BACD64099D1468AB07C796F0C0AC4851948A658A15B34E803865E9FC635F2F5 ]
 then
-- 
2.21.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: WISH: command notmuch-show-message-up with key bindung u

2019-08-26 Thread David Bremner
Gregor Zattler  writes:

> Dear notmuch developers, when reading a long going discussion
> which is deeply threaded, it often would come in handy if it was
> possible to jump up to the parent message of the message on is
> reading, unfolding this message in notmuch-show if necessary.
> This command notmuch-show-message-up or
> notmuch-show-parent-message could be bound to "u" since this key
> is not used in notmuch-show-mode-map.

Hi Gregor;

The idea seems reasonable; I'm not sure how hard it would to impliment,
since iirc all of the data structures point from parent to child. I've
added it to the list at

https://nmbug.notmuchmail.org/status/#Wish-list
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch