projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a compiler warning on Windows.
[tinc]
/
src
/
tincd.c
diff --git
a/src/tincd.c
b/src/tincd.c
index
eb03165
..
72bd8f3
100644
(file)
--- a/
src/tincd.c
+++ b/
src/tincd.c
@@
-43,8
+43,6
@@
#include <time.h>
#endif
#include <time.h>
#endif
-#include <getopt.h>
-
#include "conf.h"
#include "control.h"
#include "crypto.h"
#include "conf.h"
#include "control.h"
#include "crypto.h"
@@
-263,11
+261,14
@@
static bool parse_options(int argc, char **argv) {
netname = NULL;
}
netname = NULL;
}
- if(netname &&
(strpbrk(netname, "\\/") || *netname == '.'
)) {
+ if(netname &&
!check_netname(netname, false
)) {
fprintf(stderr, "Invalid character in netname!\n");
return false;
}
fprintf(stderr, "Invalid character in netname!\n");
return false;
}
+ if(netname && !check_netname(netname, true))
+ fprintf(stderr, "Warning: unsafe character in netname!\n");
+
return true;
}
return true;
}
@@
-340,6
+341,7
@@
int main(int argc, char **argv) {
return 1;
make_names(true);
return 1;
make_names(true);
+ chdir(confbase);
if(show_version) {
printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE,
if(show_version) {
printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE,