gfcombinefs is a side project I did some work on a few weeks ago. It combines several "shares" of a secret file previously split using Shamir secret sharing, to produce the original secret, and presents it as a file in a FUSE filesystem. It uses libgfshare for the actual mathematics, and expects its input to have been split with the gfsplit tool shipped with libgfshare.

At this stage of development, I suggest not trusting it with important data, like the GnuPG secret keyrings it's designed for. However, I hope that with some feedback from others I can get it into a state where it's ready to be released and packaged (perhaps I'm being unnecessarily conservative, but for something that deals with GnuPG keys, it seems wise to be careful).

Source code is available in a git repository, and I'd welcome contributions, bug reports (other than the limitations that are already listed in the documentation) and in particular, a systematic code audit from someone (the good news is that there isn't very much code, so that shouldn't actually take long).

Missing mutex initialisation?

Don't you need to initialise the mutex first?

e.g:

void * gfc_init () { pthread_mutex_init (&_g_lock, NULL); return 0; }

Similarly destroy:

void gfc_destroy () { pthread_mutex_destroy (&_g_lock); }

Then update your gfs_ops structure to include to have:

    .init = gfc_init,
    .destroy = gfc_destroy,

I hope that didn't get mangled too much!

Comment by steve [org.uk] Fri 18 Dec 2009 02:39:52 GMT
D'oh
Clearly I meant mutex - and I see now that you do destroy it at the end of main. Late night.
Comment by steve [org.uk] Fri 18 Dec 2009 02:41:57 GMT
comment 3
Noticed you are still getting a gcc warning. I've prepared a couple of patches to address the warning, although it is pretty clear the warning is a non-issue when the hooks provided are used sanely. However, I found no documentation indicating that fuse_operations::read would always recieve a non-negative forth argument, so I figured at least a sanity check inside the function makes sense. My patches are in the master branch of git://git.iguanasuicide.net/srv/git/gfcombinefs.
Comment by bss03 [launchpad.net] Fri 18 Dec 2009 06:03:35 GMT
comment 4
Oh man... I started writing exactly the same piece of software some months ago and never got around to finishing it. Hopefully I'll learn the lesson and release early code as fast as possible the next time.
Comment by costela.net Fri 18 Dec 2009 22:55:24 GMT
bss03/master merged
bss03, thanks for your patch: I don't get those warnings anyway, but the changes look fine.
Comment by smcv [pseudorandom.co.uk] Mon 18 Jan 2010 14:30:47 GMT