projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Have "tinc fsck" recognize Ed25519PublicKey statements.
[tinc]
/
src
/
tincctl.c
diff --git
a/src/tincctl.c
b/src/tincctl.c
index
9687ba4
..
f41e030
100644
(file)
--- a/
src/tincctl.c
+++ b/
src/tincctl.c
@@
-1,6
+1,6
@@
/*
tincctl.c -- Controlling a running tincd
/*
tincctl.c -- Controlling a running tincd
- Copyright (C) 2007-201
5
Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2007-201
6
Guus Sliepen <guus@tinc-vpn.org>
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
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
@@
-89,7
+89,7
@@
static struct option const long_options[] = {
static void version(void) {
printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE,
BUILD_VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR);
static void version(void) {
printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE,
BUILD_VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR);
- printf("Copyright (C) 1998-201
5
Ivo Timmermans, Guus Sliepen and others.\n"
+ printf("Copyright (C) 1998-201
6
Ivo Timmermans, Guus Sliepen and others.\n"
"See the AUTHORS file for a complete list.\n\n"
"tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
"and you are welcome to redistribute it under certain conditions;\n"
"See the AUTHORS file for a complete list.\n\n"
"tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
"and you are welcome to redistribute it under certain conditions;\n"
@@
-1433,7
+1433,7
@@
char *get_my_name(bool verbose) {
return NULL;
}
return NULL;
}
-
static
ecdsa_t *get_pubkey(FILE *f) {
+ecdsa_t *get_pubkey(FILE *f) {
char buf[4096];
char *value;
while(fgets(buf, sizeof buf, f)) {
char buf[4096];
char *value;
while(fgets(buf, sizeof buf, f)) {
@@
-2284,26
+2284,29
@@
static int cmd_exchange_all(int argc, char *argv[]) {
}
static int switch_network(char *name) {
}
static int switch_network(char *name) {
+ if(strcmp(name, ".")) {
+ if(!check_netname(name, false)) {
+ fprintf(stderr, "Invalid character in netname!\n");
+ return 1;
+ }
+
+ if(!check_netname(name, true))
+ fprintf(stderr, "Warning: unsafe character in netname!\n");
+ }
+
if(fd >= 0) {
close(fd);
fd = -1;
}
if(fd >= 0) {
close(fd);
fd = -1;
}
- free(confbase);
- confbase = NULL;
- free(pidfilename);
- pidfilename = NULL;
- free(logfilename);
- logfilename = NULL;
- free(unixsocketname);
- unixsocketname = NULL;
+ free_names();
+ netname = strcmp(name, ".") ? xstrdup(name) : NULL;
+ make_names(false);
+
free(tinc_conf);
free(hosts_dir);
free(prompt);
free(tinc_conf);
free(hosts_dir);
free(prompt);
- free(netname);
- netname = strcmp(name, ".") ? xstrdup(name) : NULL;
-
xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase);
xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase);
xasprintf(&prompt, "%s> ", identname);
xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase);
xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase);
xasprintf(&prompt, "%s> ", identname);