X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fnfsd.c;h=6c975f254e162340836c1f5bdab63dbec3ab3e00;hb=5cc2d7413ae0dd76a16d798dcf060effe70cb3f9;hp=f9cbd7f9d598299e6509825e746c59b63ace47f7;hpb=bdb05ff1ad95ab25e13934f66c83452ef00119fe;p=bluesky.git diff --git a/nfs3/nfsd.c b/nfs3/nfsd.c index f9cbd7f..6c975f2 100644 --- a/nfs3/nfsd.c +++ b/nfs3/nfsd.c @@ -10,6 +10,7 @@ * filesystem. */ #include "mount_prot.h" +#include "nfs3_prot.h" #include #include #include @@ -26,6 +27,10 @@ void register_rpc(); BlueSkyFS *fs; BlueSkyStore *store; +/* A cookie value returned for uncommitted writes and verified by commits; this + * should be a unique value each time the server is started. */ +char nfsd_instance_verf_cookie[NFS3_WRITEVERFSIZE]; + static void shutdown_handler(int num) { g_print("SIGINT caught, shutting down...\n"); @@ -48,8 +53,15 @@ int main(int argc, char *argv[]) if (target == NULL) target = "s3"; + const char *key = getenv("BLUESKY_KEY"); + if (key == NULL) + key = ""; + store = bluesky_store_new(target); - fs = bluesky_init_fs("export", store); + fs = bluesky_init_fs("export", store, key); + + bluesky_crypt_random_bytes(nfsd_instance_verf_cookie, + sizeof(nfsd_instance_verf_cookie)); register_rpc();