X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Finvitation.c;h=6c0b0afb825f75cd7846c42a2a715aa329eb8f45;hb=7972a780945299b992643838e61426323b161cfe;hp=110e3953be34be066c0add8ce0785db69d838f09;hpb=2e318f379992a730f592b4c5261d26d8e1a38cfd;p=meshlink diff --git a/src/invitation.c b/src/invitation.c index 110e3953..6c0b0afb 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -1,6 +1,6 @@ /* invitation.c -- Create and accept invitations - Copyright (C) 2013 Guus Sliepen + Copyright (C) 2014 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,10 +24,7 @@ #include "ecdsa.h" #include "ecdsagen.h" #include "invitation.h" -#include "names.h" #include "netutl.h" -#include "rsagen.h" -#include "script.h" #include "sptps.h" #include "tincctl.h" #include "utils.h" @@ -434,22 +431,6 @@ int cmd_invite(int argc, char *argv[]) { char *url; xasprintf(&url, "%s/%s%s", address, hash, cookie); - // Call the inviation-created script - char *envp[6] = {}; - xasprintf(&envp[0], "NAME=%s", myname); - xasprintf(&envp[1], "NETNAME=%s", netname); - xasprintf(&envp[2], "NODE=%s", argv[1]); - xasprintf(&envp[3], "INVITATION_FILE=%s", filename); - xasprintf(&envp[4], "INVITATION_URL=%s", url); - execute_script("invitation-created", envp); - for(int i = 0; i < 6 && envp[i]; i++) - free(envp[i]); - - puts(url); - free(url); - free(filename); - free(address); - return 0; } @@ -563,13 +544,6 @@ static bool finalize_join(void) { char temp_netname[32]; make_names: - if(!confbasegiven) { - free(confbase); - confbase = NULL; - } - - make_names(); - free(tinc_conf); free(hosts_dir); @@ -737,19 +711,7 @@ make_names: sptps_send_record(&sptps, 1, b64key, strlen(b64key)); free(b64key); - - rsa_t *rsa = rsa_generate(2048, 0x1001); - xasprintf(&filename, "%s" SLASH "rsa_key.priv", confbase); - f = fopenmask(filename, "w", 0600); - - rsa_write_pem_private_key(rsa, f); - fclose(f); - - rsa_write_pem_public_key(rsa, fh); - fclose(fh); - ecdsa_free(key); - rsa_free(rsa); check_port(name); @@ -775,7 +737,6 @@ ask_netname: free(newbase); netname = line; - make_names(); } fprintf(stderr, "Configuration stored in: %s\n", confbase); @@ -836,11 +797,6 @@ int cmd_join(int argc, char *argv[]) { } // Make sure confbase exists and is accessible. - if(!confbase_given && mkdir(confdir, 0755) && errno != EEXIST) { - fprintf(stderr, "Could not create directory %s: %s\n", confdir, strerror(errno)); - return 1; - } - if(mkdir(confbase, 0777) && errno != EEXIST) { fprintf(stderr, "Could not create directory %s: %s\n", confbase, strerror(errno)); return 1;