Re: [gmime-devel] issue with g_mime_multipart_encrypted_decrypt / fsync



On 7/22/2012 11:04 AM, Dirk-Jan C. Binnema wrote:
Hi all,

I'm trying to use g_mime_multipart_encrypted_decrypt in my app[1], but
it keeps returning NULL without 'err' being set. I'm using GMime 2.6.x

I've debugged this to the function stream_flush in gmime-stream-pipe.c,
where `fsync' returns -1, with errno set to EINVAL. This is called from
gmime-gpg-context.c, around line 1194:
       if (g_mime_stream_flush (passwd) == -1)

Maybe fsync on a pipe is not allowed?

I don't have a Linux machine handy, but presumably it's the same as on Mac OS X. The man page says that EINVAL can occur if/when you try to fsync() on a pipe or socket which seems to match what you are seeing.

I've removed the fsync() call in gmime-stream-pipe.c. I suspect the reason I've not seen the error you ran into was because I had a gpg agent installed which makes the code bypass sending a password to gpg over a pipe.

Thanks for the bug report!

Jeff



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]