X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fnfsd.c;h=e95ac7ca69bc5de7114da12543671e350a14a777;hb=f53cd8284a0461840cea01c7c6dbc875c52fac50;hp=fc1f955e91a229288962731bfe6979dc744a64e3;hpb=348aaaad42163d6829112c9b18026c16b09e1914;p=bluesky.git diff --git a/nfs3/nfsd.c b/nfs3/nfsd.c index fc1f955..e95ac7c 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,12 +53,21 @@ int main(int argc, char *argv[]) if (target == NULL) target = "s3"; + const char *key = getenv("BLUESKY_KEY"); + if (key == NULL) + key = ""; + + const char *profile_output = getenv("BLUESKY_PROFILE_OUT"); + if (profile_output != NULL) + bluesky_profile_set_output(fopen(profile_output, "a")); + store = bluesky_store_new(target); - fs = bluesky_init_fs("export", store); + fs = bluesky_init_fs("export", store, key); - register_rpc(); + bluesky_crypt_random_bytes(nfsd_instance_verf_cookie, + sizeof(nfsd_instance_verf_cookie)); - bluesky_debug_dump(fs); + register_rpc(); svc_run(); fprintf(stderr, "%s", "svc_run returned");