}
if(req.type == REQ_STOP) {
- logger(LOG_NOTICE, _("Got '%s' command"), "stop");
+ logger(LOG_NOTICE, "Got '%s' command", "stop");
event_loopexit(NULL);
goto respond;
}
if(req.type == REQ_DUMP_NODES) {
- logger(LOG_NOTICE, _("Got '%s' command"), "dump nodes");
+ logger(LOG_NOTICE, "Got '%s' command", "dump nodes");
res.res_errno = dump_nodes(res_data);
goto respond;
}
if(req.type == REQ_DUMP_EDGES) {
- logger(LOG_NOTICE, _("Got '%s' command"), "dump edges");
+ logger(LOG_NOTICE, "Got '%s' command", "dump edges");
res.res_errno = dump_edges(res_data);
goto respond;
}
if(req.type == REQ_DUMP_SUBNETS) {
- logger(LOG_NOTICE, _("Got '%s' command"), "dump subnets");
+ logger(LOG_NOTICE, "Got '%s' command", "dump subnets");
res.res_errno = dump_subnets(res_data);
goto respond;
}
if(req.type == REQ_DUMP_CONNECTIONS) {
- logger(LOG_NOTICE, _("Got '%s' command"), "dump connections");
+ logger(LOG_NOTICE, "Got '%s' command", "dump connections");
res.res_errno = dump_connections(res_data);
goto respond;
}
if(req.type == REQ_DUMP_GRAPH) {
- logger(LOG_NOTICE, _("Got '%s' command"), "dump graph");
+ logger(LOG_NOTICE, "Got '%s' command", "dump graph");
res.res_errno = dump_graph(res_data);
goto respond;
}
if(req.type == REQ_PURGE) {
- logger(LOG_NOTICE, _("Got '%s' command"), "purge");
+ logger(LOG_NOTICE, "Got '%s' command", "purge");
purge();
goto respond;
}
if(req.type == REQ_SET_DEBUG) {
debug_t new_debug_level;
- logger(LOG_NOTICE, _("Got '%s' command"), "debug");
+ logger(LOG_NOTICE, "Got '%s' command", "debug");
if(req.length != sizeof req + sizeof debug_level)
res.res_errno = EINVAL;
else {
memcpy(&new_debug_level, req_data, sizeof new_debug_level);
- logger(LOG_NOTICE, _("Changing debug level from %d to %d"),
+ logger(LOG_NOTICE, "Changing debug level from %d to %d",
debug_level, new_debug_level);
if(evbuffer_add_printf(res_data,
- _("Changing debug level from %d to %d\n"),
+ "Changing debug level from %d to %d\n",
debug_level, new_debug_level) == -1)
res.res_errno = errno;
debug_level = new_debug_level;
}
if(req.type == REQ_RETRY) {
- logger(LOG_NOTICE, _("Got '%s' command"), "retry");
+ logger(LOG_NOTICE, "Got '%s' command", "retry");
retry();
goto respond;
}
if(req.type == REQ_RELOAD) {
- logger(LOG_NOTICE, _("Got '%s' command"), "reload");
+ logger(LOG_NOTICE, "Got '%s' command", "reload");
res.res_errno = reload_configuration();
goto respond;
}
- logger(LOG_DEBUG, _("Malformed control command received"));
+ logger(LOG_DEBUG, "Malformed control command received");
res.res_errno = EINVAL;
respond:
return;
failure:
- logger(LOG_INFO, _("Closing control socket on error"));
+ logger(LOG_INFO, "Closing control socket on error");
evbuffer_free(res_data);
close(event->ev_read.ev_fd);
splay_delete(control_socket_tree, event);
static void handle_control_error(struct bufferevent *event, short what, void *data) {
if(what & EVBUFFER_EOF)
- logger(LOG_DEBUG, _("Control socket connection closed by peer"));
+ logger(LOG_DEBUG, "Control socket connection closed by peer");
else
- logger(LOG_DEBUG, _("Error while reading from control socket: %s"), strerror(errno));
+ logger(LOG_DEBUG, "Error while reading from control socket: %s", strerror(errno));
close(event->ev_read.ev_fd);
splay_delete(control_socket_tree, event);
newfd = accept(fd, NULL, NULL);
if(newfd < 0) {
- logger(LOG_ERR, _("Accepting a new connection failed: %s"), strerror(errno));
+ logger(LOG_ERR, "Accepting a new connection failed: %s", strerror(errno));
event_del(&control_event);
return;
}
ev = bufferevent_new(newfd, handle_control_data, NULL, handle_control_error, NULL);
if(!ev) {
- logger(LOG_ERR, _("Could not create bufferevent for new control connection: %s"), strerror(errno));
+ logger(LOG_ERR, "Could not create bufferevent for new control connection: %s", strerror(errno));
close(newfd);
return;
}
greeting.pid = getpid();
if(bufferevent_write(ev, &greeting, sizeof greeting) == -1) {
logger(LOG_ERR,
- _("Cannot send greeting for new control connection: %s"),
+ "Cannot send greeting for new control connection: %s",
strerror(errno));
bufferevent_free(ev);
close(newfd);
bufferevent_enable(ev, EV_READ);
splay_insert(control_socket_tree, ev);
- logger(LOG_DEBUG, _("Control socket connection accepted"));
+ logger(LOG_DEBUG, "Control socket connection accepted");
}
static int control_compare(const struct event *a, const struct event *b) {
char *lastslash;
if(strlen(controlsocketname) >= sizeof addr.sun_path) {
- logger(LOG_ERR, _("Control socket filename too long!"));
+ logger(LOG_ERR, "Control socket filename too long!");
goto bail;
}
control_socket = socket(PF_UNIX, SOCK_STREAM, 0);
if(control_socket < 0) {
- logger(LOG_ERR, _("Creating UNIX socket failed: %s"), strerror(errno));
+ logger(LOG_ERR, "Creating UNIX socket failed: %s", strerror(errno));
goto bail;
}
if(lastslash != NULL) {
*lastslash = 0; /* temporarily change controlsocketname to be dir */
if(mkdir(controlsocketname, 0700) < 0 && errno != EEXIST) {
- logger(LOG_ERR, _("Unable to create control socket directory %s: %s"), controlsocketname, strerror(errno));
+ logger(LOG_ERR, "Unable to create control socket directory %s: %s", controlsocketname, strerror(errno));
*lastslash = '/';
goto bail;
}
result = stat(".", &statbuf);
if(result < 0) {
- logger(LOG_ERR, _("Examining control socket directory failed: %s"), strerror(errno));
+ logger(LOG_ERR, "Examining control socket directory failed: %s", strerror(errno));
goto bail;
}
if(statbuf.st_uid != 0 || (statbuf.st_mode & S_IXOTH) != 0 || (statbuf.st_gid != 0 && (statbuf.st_mode & S_IXGRP)) != 0) {
- logger(LOG_ERR, _("Control socket directory ownership/permissions insecure."));
+ logger(LOG_ERR, "Control socket directory ownership/permissions insecure.");
goto bail;
}
if(result < 0 && errno == EADDRINUSE) {
result = connect(control_socket, (struct sockaddr *)&addr, sizeof addr);
if(result < 0) {
- logger(LOG_WARNING, _("Removing old control socket."));
+ logger(LOG_WARNING, "Removing old control socket.");
unlink(controlsocketname);
result = bind(control_socket, (struct sockaddr *)&addr, sizeof addr);
} else {
if(netname)
- logger(LOG_ERR, _("Another tincd is already running for net `%s'."), netname);
+ logger(LOG_ERR, "Another tincd is already running for net `%s'.", netname);
else
- logger(LOG_ERR, _("Another tincd is already running."));
+ logger(LOG_ERR, "Another tincd is already running.");
goto bail;
}
}
if(result < 0) {
- logger(LOG_ERR, _("Can't bind to %s: %s"), controlsocketname, strerror(errno));
+ logger(LOG_ERR, "Can't bind to %s: %s", controlsocketname, strerror(errno));
goto bail;
}
if(listen(control_socket, 3) < 0) {
- logger(LOG_ERR, _("Can't listen on %s: %s"), controlsocketname, strerror(errno));
+ logger(LOG_ERR, "Can't listen on %s: %s", controlsocketname, strerror(errno));
goto bail;
}
gcry_error_t err;
if(!ciphertonid(algo, mode, &cipher->nid)) {
- logger(LOG_DEBUG, _("Cipher %d mode %d has no corresponding nid!"), algo, mode);
+ logger(LOG_DEBUG, "Cipher %d mode %d has no corresponding nid!", algo, mode);
return false;
}
if((err = gcry_cipher_open(&cipher->handle, algo, mode, 0))) {
- logger(LOG_DEBUG, _("Unable to intialise cipher %d mode %d: %s"), algo, mode, gcry_strerror(err));
+ logger(LOG_DEBUG, "Unable to intialise cipher %d mode %d: %s", algo, mode, gcry_strerror(err));
return false;
}
int algo, mode;
if(!nametocipher(name, &algo, &mode)) {
- logger(LOG_DEBUG, _("Unknown cipher name '%s'!"), name);
+ logger(LOG_DEBUG, "Unknown cipher name '%s'!", name);
return false;
}
int algo, mode;
if(!nidtocipher(nid, &algo, &mode)) {
- logger(LOG_DEBUG, _("Unknown cipher ID %d!"), nid);
+ logger(LOG_DEBUG, "Unknown cipher ID %d!", nid);
return false;
}
// To be fixed
if((err = gcry_cipher_encrypt(cipher->handle, outdata, inlen, indata, inlen))) {
- logger(LOG_ERR, _("Error while encrypting: %s"), gcry_strerror(err));
+ logger(LOG_ERR, "Error while encrypting: %s", gcry_strerror(err));
return false;
}
// To be fixed
if((err = gcry_cipher_decrypt(cipher->handle, outdata, inlen, indata, inlen))) {
- logger(LOG_ERR, _("Error while decrypting: %s"), gcry_strerror(err));
+ logger(LOG_ERR, "Error while decrypting: %s", gcry_strerror(err));
return false;
}
static bool digest_open(digest_t *digest, int algo) {
if(!digesttonid(algo, &digest->nid)) {
- logger(LOG_DEBUG, _("Digest %d has no corresponding nid!"), algo);
+ logger(LOG_DEBUG, "Digest %d has no corresponding nid!", algo);
return false;
}
int algo;
if(!nametodigest(name, &algo)) {
- logger(LOG_DEBUG, _("Unknown digest name '%s'!"), name);
+ logger(LOG_DEBUG, "Unknown digest name '%s'!", name);
return false;
}
int algo;
if(!nidtodigest(nid, &algo)) {
- logger(LOG_DEBUG, _("Unknown digest ID %d!"), nid);
+ logger(LOG_DEBUG, "Unknown digest ID %d!", nid);
return false;
}
?: gcry_mpi_scan(&rsa->e, GCRYMPI_FMT_HEX, n, 0, NULL);
if(err) {
- logger(LOG_ERR, _("Error while reading RSA public key: %s"), gcry_strerror(errno));
+ logger(LOG_ERR, "Error while reading RSA public key: %s", gcry_strerror(errno));
return false;
}
?: gcry_mpi_scan(&rsa->d, GCRYMPI_FMT_HEX, n, 0, NULL);
if(err) {
- logger(LOG_ERR, _("Error while reading RSA public key: %s"), gcry_strerror(errno));
+ logger(LOG_ERR, "Error while reading RSA public key: %s", gcry_strerror(errno));
return false;
}
size_t derlen;
if(!pem_decode(fp, "RSA PUBLIC KEY", derbuf, sizeof derbuf, &derlen)) {
- logger(LOG_ERR, _("Unable to read RSA public key: %s"), strerror(errno));
+ logger(LOG_ERR, "Unable to read RSA public key: %s", strerror(errno));
return NULL;
}
|| !ber_read_mpi(&derp, &derlen, &rsa->n)
|| !ber_read_mpi(&derp, &derlen, &rsa->e)
|| derlen) {
- logger(LOG_ERR, _("Error while decoding RSA public key"));
+ logger(LOG_ERR, "Error while decoding RSA public key");
return NULL;
}
size_t derlen;
if(!pem_decode(fp, "RSA PRIVATE KEY", derbuf, sizeof derbuf, &derlen)) {
- logger(LOG_ERR, _("Unable to read RSA private key: %s"), strerror(errno));
+ logger(LOG_ERR, "Unable to read RSA private key: %s", strerror(errno));
return NULL;
}
|| !ber_read_mpi(&derp, &derlen, NULL)
|| !ber_read_mpi(&derp, &derlen, NULL) // u
|| derlen) {
- logger(LOG_ERR, _("Error while decoding RSA private key"));
+ logger(LOG_ERR, "Error while decoding RSA private key");
return NULL;
}
if(!ber_write_mpi(&derp1, &derlen1, &rsa->n)
|| !ber_write_mpi(&derp1, &derlen1, &rsa->e)
|| !ber_write_sequence(&derp2, &derlen2, derbuf1, derlen1)) {
- logger(LOG_ERR, _("Error while encoding RSA public key"));
+ logger(LOG_ERR, "Error while encoding RSA public key");
return false;
}
if(!pem_encode(fp, "RSA PUBLIC KEY", derbuf2, derlen2)) {
- logger(LOG_ERR, _("Unable to write RSA public key: %s"), strerror(errno));
+ logger(LOG_ERR, "Unable to write RSA public key: %s", strerror(errno));
return false;
}
|| ber_write_mpi(&derp1, &derlen1, &exp1)
|| ber_write_mpi(&derp1, &derlen1, &exp2)
|| ber_write_mpi(&derp1, &derlen1, &coeff))
- logger(LOG_ERR, _("Error while encoding RSA private key"));
+ logger(LOG_ERR, "Error while encoding RSA private key");
return false;
}
if(!pem_encode(fp, "RSA PRIVATE KEY", derbuf2, derlen2)) {
- logger(LOG_ERR, _("Unable to write RSA private key: %s"), strerror(errno));
+ logger(LOG_ERR, "Unable to write RSA private key: %s", strerror(errno));
return false;
}
}
bool rsa_generate(rsa_t *rsa, size_t bits, unsigned long exponent) {
- fprintf(stderr, _("Generating RSA keys with libgcrypt not implemented yet\n"));
+ fprintf(stderr, "Generating RSA keys with libgcrypt not implemented yet\n");
return false;
}
if(cipher->cipher)
return cipher_open(cipher);
- logger(LOG_DEBUG, _("Unknown cipher name '%s'!"), name);
+ logger(LOG_DEBUG, "Unknown cipher name '%s'!", name);
return false;
}
if(cipher->cipher)
return cipher_open(cipher);
- logger(LOG_DEBUG, _("Unknown cipher nid %d!"), nid);
+ logger(LOG_DEBUG, "Unknown cipher nid %d!", nid);
return false;
}
if(result)
return true;
- logger(LOG_ERR, _("Error while setting key: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
if(result)
return true;
- logger(LOG_ERR, _("Error while setting key: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
if(result)
return true;
- logger(LOG_ERR, _("Error while regenerating key: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Error while regenerating key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
}
}
- logger(LOG_ERR, _("Error while encrypting: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Error while encrypting: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
}
}
- logger(LOG_ERR, _("Error while encrypting: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Error while encrypting: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
digest->digest = EVP_get_digestbyname(name);
if(!digest->digest) {
- logger(LOG_DEBUG, _("Unknown digest name '%s'!"), name);
+ logger(LOG_DEBUG, "Unknown digest name '%s'!", name);
return false;
}
digest->digest = EVP_get_digestbynid(nid);
if(!digest->digest) {
- logger(LOG_DEBUG, _("Unknown digest nid %d!"), nid);
+ logger(LOG_DEBUG, "Unknown digest nid %d!", nid);
return false;
}
if(!EVP_DigestInit(&ctx, digest->digest)
|| !EVP_DigestUpdate(&ctx, indata, inlen)
|| !EVP_DigestFinal(&ctx, tmpdata, NULL)) {
- logger(LOG_DEBUG, _("Error creating digest: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_DEBUG, "Error creating digest: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
if(*rsa)
return true;
- logger(LOG_ERR, _("Unable to read RSA public key: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Unable to read RSA public key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
if(*rsa)
return true;
- logger(LOG_ERR, _("Unable to read RSA private key: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Unable to read RSA private key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
if(RSA_public_encrypt(len, in, out, *rsa, RSA_NO_PADDING) == len)
return true;
- logger(LOG_ERR, _("Unable to perform RSA encryption: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Unable to perform RSA encryption: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
if(RSA_private_decrypt(len, in, out, *rsa, RSA_NO_PADDING) == len)
return true;
- logger(LOG_ERR, _("Unable to perform RSA decryption: %s"), ERR_error_string(ERR_get_error(), NULL));
+ logger(LOG_ERR, "Unable to perform RSA decryption: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
/* Check if the length of the hash is all right */
if(strlen(hishash) != digest_length(&c->outdigest) * 2) {
- logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name, c->hostname, _("wrong challenge reply length"));
+ logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name, c->hostname, "wrong challenge reply length");
return false;
}
/* Verify the hash */
if(!digest_verify(&c->outdigest, c->hischallenge, rsa_size(&c->rsa), hishash)) {
- logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name, c->hostname, _("wrong challenge reply"));
+ logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name, c->hostname, "wrong challenge reply");
return false;
}
event_add(&age_subnets_event, &(struct timeval){10, 0});
}
-static void learn_mac(mac_t *address)
-{
+static void learn_mac(mac_t *address) {
subnet_t *subnet;
splay_node_t *node;
connection_t *c;
/*
tincctl.c -- Controlling a running tincd
- Copyright (C) 2007 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2007-2009 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
static void usage(bool status) {
if(status)
- fprintf(stderr, _("Try `%s --help\' for more information.\n"),
+ fprintf(stderr, "Try `%s --help\' for more information.\n",
program_name);
else {
- printf(_("Usage: %s [options] command\n\n"), program_name);
- printf(_("Valid options are:\n"
+ printf("Usage: %s [options] command\n\n", program_name);
+ printf("Valid options are:\n"
" -c, --config=DIR Read configuration options from DIR.\n"
" -n, --net=NETNAME Connect to net NETNAME.\n"
" --controlsocket=FILENAME Open control socket at FILENAME.\n"
" debug N Set debug level\n"
" retry Retry all outgoing connections\n"
" reload Partial reload of configuration\n"
- "\n"));
- printf(_("Report bugs to tinc@tinc-vpn.org.\n"));
+ "\n");
+ printf("Report bugs to tinc@tinc-vpn.org.\n");
}
}
/* Check stdin and stdout */
if(isatty(0) && isatty(1)) {
/* Ask for a file and/or directory name. */
- fprintf(stdout, _("Please enter a file to save %s to [%s]: "),
+ fprintf(stdout, "Please enter a file to save %s to [%s]: ",
what, filename);
fflush(stdout);
if(fgets(buf, sizeof buf, stdin) < 0) {
- fprintf(stderr, _("Error while reading stdin: %s\n"),
+ fprintf(stderr, "Error while reading stdin: %s\n",
strerror(errno));
return NULL;
}
r = fopen(filename, mode);
if(!r) {
- fprintf(stderr, _("Error opening file `%s': %s\n"), filename, strerror(errno));
+ fprintf(stderr, "Error opening file `%s': %s\n", filename, strerror(errno));
return NULL;
}
char *name = NULL;
char *filename;
- fprintf(stderr, _("Generating %d bits keys:\n"), bits);
+ fprintf(stderr, "Generating %d bits keys:\n", bits);
if(!rsa_generate(&key, bits, 0x10001)) {
- fprintf(stderr, _("Error during key generation!\n"));
+ fprintf(stderr, "Error during key generation!\n");
return false;
} else
- fprintf(stderr, _("Done.\n"));
+ fprintf(stderr, "Done.\n");
xasprintf(&filename, "%s/rsa_key.priv", confbase);
- f = ask_and_open(filename, _("private RSA key"), "a");
+ f = ask_and_open(filename, "private RSA key", "a");
if(!f)
return false;
#endif
if(ftell(f))
- fprintf(stderr, _("Appending key to existing contents.\nMake sure only one key is stored in the file.\n"));
+ fprintf(stderr, "Appending key to existing contents.\nMake sure only one key is stored in the file.\n");
rsa_write_pem_private_key(&key, f);
else
xasprintf(&filename, "%s/rsa_key.pub", confbase);
- f = ask_and_open(filename, _("public RSA key"), "a");
+ f = ask_and_open(filename, "public RSA key", "a");
if(!f)
return false;
if(ftell(f))
- fprintf(stderr, _("Appending key to existing contents.\nMake sure only one key is stored in the file.\n"));
+ fprintf(stderr, "Appending key to existing contents.\nMake sure only one key is stored in the file.\n");
rsa_write_pem_public_key(&key, f);
if(!confbase)
xasprintf(&confbase, CONFDIR "/tinc/%s", netname);
else
- fprintf(stderr, _("Both netname and configuration directory given, using the latter...\n"));
+ fprintf(stderr, "Both netname and configuration directory given, using the latter...\n");
} else {
if(!confbase)
xasprintf(&confbase, CONFDIR "/tinc");
/*
Send a request (with printfs)
*/
-static int send_ctl_request_cooked(int fd, enum request_type type,
- void const *outdata, size_t outdatalen)
-{
+static int send_ctl_request_cooked(int fd, enum request_type type, void const *outdata, size_t outdatalen) {
int res_errno = -1;
char *buf = NULL;
size_t buflen = 0;
if(send_ctl_request(fd, type, outdata, outdatalen, &res_errno,
(void**) &buf, &buflen)) {
- fprintf(stderr, _("Error sending request: %s\n"), strerror(errno));
+ fprintf(stderr, "Error sending request: %s\n", strerror(errno));
return -1;
}
}
if(res_errno != 0) {
- fprintf(stderr, _("Server reported error: %s\n"), strerror(res_errno));
+ fprintf(stderr, "Server reported error: %s\n", strerror(res_errno));
return -1;
}
program_name = argv[0];
- setlocale(LC_ALL, "");
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
-
if(!parse_options(argc, argv))
return 1;
make_names();
if(show_version) {
- printf(_("%s version %s (built %s %s, protocol %d)\n"), PACKAGE,
+ printf("%s version %s (built %s %s, protocol %d)\n", PACKAGE,
VERSION, __DATE__, __TIME__, PROT_CURRENT);
- printf(_("Copyright (C) 1998-2007 Ivo Timmermans, Guus Sliepen and others.\n"
+ printf("Copyright (C) 1998-2009 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 file COPYING for details.\n"));
+ "see the file COPYING for details.\n");
return 0;
}
}
if(optind >= argc) {
- fprintf(stderr, _("Not enough arguments.\n"));
+ fprintf(stderr, "Not enough arguments.\n");
usage(true);
return 1;
}
if(!strcasecmp(argv[optind], "start")) {
argv[optind] = NULL;
execve(SBINDIR "/tincd", argv, envp);
- fprintf(stderr, _("Could not start tincd: %s"), strerror(errno));
+ fprintf(stderr, "Could not start tincd: %s", strerror(errno));
return 1;
}
result = stat(".", &statbuf);
if(result < 0) {
- fprintf(stderr, _("Unable to check control socket directory permissions: %s\n"), strerror(errno));
+ fprintf(stderr, "Unable to check control socket directory permissions: %s\n", strerror(errno));
return 1;
}
if(statbuf.st_uid != 0 || (statbuf.st_mode & S_IXOTH) != 0 || (statbuf.st_gid != 0 && (statbuf.st_mode & S_IXGRP)) != 0) {
- fprintf(stderr, _("Insecure permissions on control socket directory\n"));
+ fprintf(stderr, "Insecure permissions on control socket directory\n");
return 1;
}
if(strlen(controlsocketname) >= sizeof addr.sun_path) {
- fprintf(stderr, _("Control socket filename too long!\n"));
+ fprintf(stderr, "Control socket filename too long!\n");
return 1;
}
fd = socket(PF_UNIX, SOCK_STREAM, 0);
if(fd < 0) {
- fprintf(stderr, _("Cannot create UNIX socket: %s\n"), strerror(errno));
+ fprintf(stderr, "Cannot create UNIX socket: %s\n", strerror(errno));
return 1;
}
strncpy(addr.sun_path, controlsocketname, sizeof addr.sun_path - 1);
if(connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) {
- fprintf(stderr, _("Cannot connect to %s: %s\n"), controlsocketname, strerror(errno));
+ fprintf(stderr, "Cannot connect to %s: %s\n", controlsocketname, strerror(errno));
return 1;
}
if(fullread(fd, &greeting, sizeof greeting) == -1) {
- fprintf(stderr, _("Cannot read greeting from control socket: %s\n"),
+ fprintf(stderr, "Cannot read greeting from control socket: %s\n",
strerror(errno));
return 1;
}
if(greeting.version != TINC_CTL_VERSION_CURRENT) {
- fprintf(stderr, _("Version mismatch: server %d, client %d\n"),
+ fprintf(stderr, "Version mismatch: server %d, client %d\n",
greeting.version, TINC_CTL_VERSION_CURRENT);
return 1;
}
if(!strcasecmp(argv[optind], "dump")) {
if(argc < optind + 2) {
- fprintf(stderr, _("Not enough arguments.\n"));
+ fprintf(stderr, "Not enough arguments.\n");
usage(true);
return 1;
}
return send_ctl_request_cooked(fd, REQ_DUMP_GRAPH, NULL, 0) != -1;
}
- fprintf(stderr, _("Unknown dump type '%s'.\n"), argv[optind+1]);
+ fprintf(stderr, "Unknown dump type '%s'.\n", argv[optind+1]);
usage(true);
return 1;
}
return send_ctl_request_cooked(fd, REQ_RELOAD, NULL, 0) != -1;
}
- fprintf(stderr, _("Unknown command `%s'.\n"), argv[optind]);
+ fprintf(stderr, "Unknown command `%s'.\n", argv[optind]);
usage(true);
close(fd);