]> git.meshlink.io Git - meshlink/blobdiff - src/invitation.c
Remove everything GPL that is not copyright Guus Sliepen, update copyright statements.
[meshlink] / src / invitation.c
index cdef3d0480efa04278ecb834156ef9332de99ec0..f75bf40928f91af97b3241c12862756eba9fab73 100644 (file)
@@ -1,6 +1,6 @@
 /*
     invitation.c -- Create and accept invitations
-    Copyright (C) 2013-2014 Guus Sliepen <guus@tinc-vpn.org>
+    Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>
 
     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
 #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 +432,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 +545,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);
 
@@ -775,7 +750,6 @@ ask_netname:
 
                free(newbase);
                netname = line;
-               make_names();
        }
 
        fprintf(stderr, "Configuration stored in: %s\n", confbase);
@@ -836,11 +810,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;