53
53
sockaddr_in6, PF_INET6,
54
54
SOCK_STREAM, uid_t, gid_t, open(),
56
#include <sys/stat.h> /* open() */
56
#include <sys/stat.h> /* open(), S_ISREG */
57
57
#include <sys/socket.h> /* socket(), struct sockaddr_in6,
58
58
inet_pton(), connect() */
59
59
#include <fcntl.h> /* open() */
260
262
rc = gpgme_data_new_from_fd(&pgp_data, fd);
261
263
if(rc != GPG_ERR_NO_ERROR){
262
fprintf(stderr, "bad gpgme_data_new_from_fd: %s: %s\n",
264
fprintf(stderr, "Mandos plugin mandos-client: "
265
"bad gpgme_data_new_from_fd: %s: %s\n",
263
266
gpgme_strsource(rc), gpgme_strerror(rc));
267
270
rc = gpgme_op_import(mc.ctx, pgp_data);
268
271
if(rc != GPG_ERR_NO_ERROR){
269
fprintf(stderr, "bad gpgme_op_import: %s: %s\n",
272
fprintf(stderr, "Mandos plugin mandos-client: "
273
"bad gpgme_op_import: %s: %s\n",
270
274
gpgme_strsource(rc), gpgme_strerror(rc));
283
fprintf(stderr, "Initializing GPGME\n");
287
fprintf(stderr, "Mandos plugin mandos-client: "
288
"Initializing GPGME\n");
287
292
gpgme_check_version(NULL);
288
293
rc = gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP);
289
294
if(rc != GPG_ERR_NO_ERROR){
290
fprintf(stderr, "bad gpgme_engine_check_version: %s: %s\n",
295
fprintf(stderr, "Mandos plugin mandos-client: "
296
"bad gpgme_engine_check_version: %s: %s\n",
291
297
gpgme_strsource(rc), gpgme_strerror(rc));
295
301
/* Set GPGME home directory for the OpenPGP engine only */
296
302
rc = gpgme_get_engine_info(&engine_info);
297
303
if(rc != GPG_ERR_NO_ERROR){
298
fprintf(stderr, "bad gpgme_get_engine_info: %s: %s\n",
304
fprintf(stderr, "Mandos plugin mandos-client: "
305
"bad gpgme_get_engine_info: %s: %s\n",
299
306
gpgme_strsource(rc), gpgme_strerror(rc));
308
315
engine_info = engine_info->next;
310
317
if(engine_info == NULL){
311
fprintf(stderr, "Could not set GPGME home dir to %s\n", tempdir);
318
fprintf(stderr, "Mandos plugin mandos-client: "
319
"Could not set GPGME home dir to %s\n", tempdir);
315
323
/* Create new GPGME "context" */
316
324
rc = gpgme_new(&(mc.ctx));
317
325
if(rc != GPG_ERR_NO_ERROR){
318
fprintf(stderr, "bad gpgme_new: %s: %s\n",
319
gpgme_strsource(rc), gpgme_strerror(rc));
326
fprintf(stderr, "Mandos plugin mandos-client: "
327
"bad gpgme_new: %s: %s\n", gpgme_strsource(rc),
341
350
ssize_t plaintext_length = 0;
344
fprintf(stderr, "Trying to decrypt OpenPGP data\n");
353
fprintf(stderr, "Mandos plugin mandos-client: "
354
"Trying to decrypt OpenPGP data\n");
347
357
/* Create new GPGME data buffer from memory cryptotext */
348
358
rc = gpgme_data_new_from_mem(&dh_crypto, cryptotext, crypto_size,
350
360
if(rc != GPG_ERR_NO_ERROR){
351
fprintf(stderr, "bad gpgme_data_new_from_mem: %s: %s\n",
361
fprintf(stderr, "Mandos plugin mandos-client: "
362
"bad gpgme_data_new_from_mem: %s: %s\n",
352
363
gpgme_strsource(rc), gpgme_strerror(rc));
356
367
/* Create new empty GPGME data buffer for the plaintext */
357
368
rc = gpgme_data_new(&dh_plain);
358
369
if(rc != GPG_ERR_NO_ERROR){
359
fprintf(stderr, "bad gpgme_data_new: %s: %s\n",
370
fprintf(stderr, "Mandos plugin mandos-client: "
371
"bad gpgme_data_new: %s: %s\n",
360
372
gpgme_strsource(rc), gpgme_strerror(rc));
361
373
gpgme_data_release(dh_crypto);
367
379
rc = gpgme_op_decrypt(mc.ctx, dh_crypto, dh_plain);
368
380
if(rc != GPG_ERR_NO_ERROR){
369
fprintf(stderr, "bad gpgme_op_decrypt: %s: %s\n",
381
fprintf(stderr, "Mandos plugin mandos-client: "
382
"bad gpgme_op_decrypt: %s: %s\n",
370
383
gpgme_strsource(rc), gpgme_strerror(rc));
371
384
plaintext_length = -1;
373
386
gpgme_decrypt_result_t result;
374
387
result = gpgme_op_decrypt_result(mc.ctx);
375
388
if(result == NULL){
376
fprintf(stderr, "gpgme_op_decrypt_result failed\n");
389
fprintf(stderr, "Mandos plugin mandos-client: "
390
"gpgme_op_decrypt_result failed\n");
378
fprintf(stderr, "Unsupported algorithm: %s\n",
392
fprintf(stderr, "Mandos plugin mandos-client: "
393
"Unsupported algorithm: %s\n",
379
394
result->unsupported_algorithm);
380
fprintf(stderr, "Wrong key usage: %u\n",
395
fprintf(stderr, "Mandos plugin mandos-client: "
396
"Wrong key usage: %u\n",
381
397
result->wrong_key_usage);
382
398
if(result->file_name != NULL){
383
fprintf(stderr, "File name: %s\n", result->file_name);
399
fprintf(stderr, "Mandos plugin mandos-client: "
400
"File name: %s\n", result->file_name);
385
402
gpgme_recipient_t recipient;
386
403
recipient = result->recipients;
387
404
while(recipient != NULL){
388
fprintf(stderr, "Public key algorithm: %s\n",
405
fprintf(stderr, "Mandos plugin mandos-client: "
406
"Public key algorithm: %s\n",
389
407
gpgme_pubkey_algo_name(recipient->pubkey_algo));
390
fprintf(stderr, "Key ID: %s\n", recipient->keyid);
391
fprintf(stderr, "Secret key available: %s\n",
408
fprintf(stderr, "Mandos plugin mandos-client: "
409
"Key ID: %s\n", recipient->keyid);
410
fprintf(stderr, "Mandos plugin mandos-client: "
411
"Secret key available: %s\n",
392
412
recipient->status == GPG_ERR_NO_SECKEY
394
414
recipient = recipient->next;
412
433
*plaintext = NULL;
414
435
plaintext_capacity = incbuffer(plaintext,
415
(size_t)plaintext_length,
436
(size_t)plaintext_length,
417
438
if(plaintext_capacity == 0){
418
perror_plus("incbuffer");
419
plaintext_length = -1;
439
perror_plus("incbuffer");
440
plaintext_length = -1;
423
444
ret = gpgme_data_read(dh_plain, *plaintext + plaintext_length,
475
fprintf(stderr, "Initializing GnuTLS\n");
497
fprintf(stderr, "Mandos plugin mandos-client: "
498
"Initializing GnuTLS\n");
478
501
ret = gnutls_global_init();
479
502
if(ret != GNUTLS_E_SUCCESS){
480
fprintf(stderr, "GnuTLS global_init: %s\n",
481
safer_gnutls_strerror(ret));
503
fprintf(stderr, "Mandos plugin mandos-client: "
504
"GnuTLS global_init: %s\n", safer_gnutls_strerror(ret));
493
516
/* OpenPGP credentials */
494
517
ret = gnutls_certificate_allocate_credentials(&mc.cred);
495
518
if(ret != GNUTLS_E_SUCCESS){
496
fprintf(stderr, "GnuTLS memory error: %s\n",
497
safer_gnutls_strerror(ret));
519
fprintf(stderr, "Mandos plugin mandos-client: "
520
"GnuTLS memory error: %s\n", safer_gnutls_strerror(ret));
498
521
gnutls_global_deinit();
503
fprintf(stderr, "Attempting to use OpenPGP public key %s and"
526
fprintf(stderr, "Mandos plugin mandos-client: "
527
"Attempting to use OpenPGP public key %s and"
504
528
" secret key %s as GnuTLS credentials\n", pubkeyfilename,
510
534
GNUTLS_OPENPGP_FMT_BASE64);
511
535
if(ret != GNUTLS_E_SUCCESS){
537
"Mandos plugin mandos-client: "
513
538
"Error[%d] while reading the OpenPGP key pair ('%s',"
514
539
" '%s')\n", ret, pubkeyfilename, seckeyfilename);
515
fprintf(stderr, "The GnuTLS error is: %s\n",
516
safer_gnutls_strerror(ret));
540
fprintf(stderr, "Mandos plugin mandos-client: "
541
"The GnuTLS error is: %s\n", safer_gnutls_strerror(ret));
520
545
/* GnuTLS server initialization */
521
546
ret = gnutls_dh_params_init(&mc.dh_params);
522
547
if(ret != GNUTLS_E_SUCCESS){
523
fprintf(stderr, "Error in GnuTLS DH parameter initialization:"
548
fprintf(stderr, "Mandos plugin mandos-client: "
549
"Error in GnuTLS DH parameter initialization:"
524
550
" %s\n", safer_gnutls_strerror(ret));
527
553
ret = gnutls_dh_params_generate2(mc.dh_params, mc.dh_bits);
528
554
if(ret != GNUTLS_E_SUCCESS){
529
fprintf(stderr, "Error in GnuTLS prime generation: %s\n",
555
fprintf(stderr, "Mandos plugin mandos-client: "
556
"Error in GnuTLS prime generation: %s\n",
530
557
safer_gnutls_strerror(ret));
568
596
} while(ret == GNUTLS_E_INTERRUPTED or ret == GNUTLS_E_AGAIN);
569
597
if(ret != GNUTLS_E_SUCCESS){
570
fprintf(stderr, "Syntax error at: %s\n", err);
571
fprintf(stderr, "GnuTLS error: %s\n",
572
safer_gnutls_strerror(ret));
598
fprintf(stderr, "Mandos plugin mandos-client: "
599
"Syntax error at: %s\n", err);
600
fprintf(stderr, "Mandos plugin mandos-client: "
601
"GnuTLS error: %s\n", safer_gnutls_strerror(ret));
573
602
gnutls_deinit(*session);
718
752
if(if_indextoname((unsigned int)if_index, interface) == NULL){
719
753
perror_plus("if_indextoname");
721
fprintf(stderr, "Connection to: %s%%%s, port %" PRIu16 "\n",
755
fprintf(stderr, "Mandos plugin mandos-client: "
756
"Connection to: %s%%%s, port %" PRIu16 "\n",
722
757
ip, interface, port);
725
fprintf(stderr, "Connection to: %s, port %" PRIu16 "\n", ip,
760
fprintf(stderr, "Mandos plugin mandos-client: "
761
"Connection to: %s, port %" PRIu16 "\n", ip, port);
728
763
char addrstr[(INET_ADDRSTRLEN > INET6_ADDRSTRLEN) ?
729
764
INET_ADDRSTRLEN : INET6_ADDRSTRLEN] = "";
881
919
} while(ret == GNUTLS_E_AGAIN or ret == GNUTLS_E_INTERRUPTED);
883
fprintf(stderr, "*** GnuTLS Re-handshake failed ***\n");
921
fprintf(stderr, "Mandos plugin mandos-client: "
922
"*** GnuTLS Re-handshake failed ***\n");
884
923
gnutls_perror(ret);
890
fprintf(stderr, "Unknown error while reading data from"
929
fprintf(stderr, "Mandos plugin mandos-client: "
930
"Unknown error while reading data from"
891
931
" encrypted session with Mandos server\n");
892
932
gnutls_bye(session, GNUTLS_SHUT_RDWR);
1001
1042
case AVAHI_RESOLVER_FAILURE:
1002
fprintf(stderr, "(Avahi Resolver) Failed to resolve service '%s'"
1043
fprintf(stderr, "Mandos plugin mandos-client: "
1044
"(Avahi Resolver) Failed to resolve service '%s'"
1003
1045
" of type '%s' in domain '%s': %s\n", name, type, domain,
1004
1046
avahi_strerror(avahi_server_errno(mc.server)));
1009
1051
char ip[AVAHI_ADDRESS_STR_MAX];
1010
1052
avahi_address_snprint(ip, sizeof(ip), address);
1012
fprintf(stderr, "Mandos server \"%s\" found on %s (%s, %"
1054
fprintf(stderr, "Mandos plugin mandos-client: "
1055
"Mandos server \"%s\" found on %s (%s, %"
1013
1056
PRIdMAX ") on port %" PRIu16 "\n", name, host_name,
1014
1057
ip, (intmax_t)interface, port);
1063
1107
if(avahi_s_service_resolver_new(mc.server, interface, protocol,
1064
1108
name, type, domain, protocol, 0,
1065
1109
resolve_callback, NULL) == NULL)
1066
fprintf(stderr, "Avahi: Failed to resolve service '%s': %s\n",
1110
fprintf(stderr, "Mandos plugin mandos-client: "
1111
"Avahi: Failed to resolve service '%s': %s\n",
1067
1112
name, avahi_strerror(avahi_server_errno(mc.server)));
1118
1164
/* Reject the loopback device */
1119
1165
if(ifr->ifr_flags & IFF_LOOPBACK){
1121
fprintf(stderr, "Rejecting loopback interface \"%s\"\n",
1167
fprintf(stderr, "Mandos plugin mandos-client: "
1168
"Rejecting loopback interface \"%s\"\n", ifname);
1126
1172
/* Accept point-to-point devices only if connect_to is specified */
1127
1173
if(connect_to != NULL and (ifr->ifr_flags & IFF_POINTOPOINT)){
1129
fprintf(stderr, "Accepting point-to-point interface \"%s\"\n",
1175
fprintf(stderr, "Mandos plugin mandos-client: "
1176
"Accepting point-to-point interface \"%s\"\n", ifname);
1134
1180
/* Otherwise, reject non-broadcast-capable devices */
1135
1181
if(not (ifr->ifr_flags & IFF_BROADCAST)){
1137
fprintf(stderr, "Rejecting non-broadcast interface \"%s\"\n",
1183
fprintf(stderr, "Mandos plugin mandos-client: "
1184
"Rejecting non-broadcast interface \"%s\"\n", ifname);
1142
1188
/* Reject non-ARP interfaces (including dummy interfaces) */
1143
1189
if(ifr->ifr_flags & IFF_NOARP){
1145
fprintf(stderr, "Rejecting non-ARP interface \"%s\"\n", ifname);
1191
fprintf(stderr, "Mandos plugin mandos-client: "
1192
"Rejecting non-ARP interface \"%s\"\n", ifname);
1150
1197
/* Accept this device */
1152
fprintf(stderr, "Interface \"%s\" is good\n", ifname);
1199
fprintf(stderr, "Mandos plugin mandos-client: "
1200
"Interface \"%s\" is good\n", ifname);
1182
1234
* (This function is passed to scandir(3) as a filter function.)
1184
1236
int up_interface(const struct dirent *if_entry){
1186
char *flagname = NULL;
1187
1237
if(if_entry->d_name[0] == '.'){
1190
int ret = asprintf(&flagname, "%s/%s/flags", sys_class_net,
1193
perror_plus("asprintf");
1196
int flags_fd = (int)TEMP_FAILURE_RETRY(open(flagname, O_RDONLY));
1198
perror_plus("open");
1203
typedef short ifreq_flags; /* ifreq.ifr_flags in netdevice(7) */
1204
/* read line from flags_fd */
1205
ssize_t to_read = 2+(sizeof(ifreq_flags)*2)+1; /* "0x1003\n" */
1206
char *flagstring = malloc((size_t)to_read+1); /* +1 for final \0 */
1207
flagstring[(size_t)to_read] = '\0';
1208
if(flagstring == NULL){
1209
perror_plus("malloc");
1214
ssret = (ssize_t)TEMP_FAILURE_RETRY(read(flags_fd, flagstring,
1217
perror_plus("read");
1231
tmpmax = strtoimax(flagstring, &tmp, 0);
1232
if(errno != 0 or tmp == flagstring or (*tmp != '\0'
1233
and not (isspace(*tmp)))
1234
or tmpmax != (ifreq_flags)tmpmax){
1236
fprintf(stderr, "Invalid flags \"%s\" for interface \"%s\"\n",
1237
flagstring, if_entry->d_name);
1243
ifreq_flags flags = (ifreq_flags)tmpmax;
1244
/* Reject the loopback device */
1245
if(flags & IFF_LOOPBACK){
1247
fprintf(stderr, "Rejecting loopback interface \"%s\"\n",
1242
if(not get_flags(if_entry->d_name, &ifr)){
1244
fprintf(stderr, "Mandos plugin mandos-client: "
1245
"Failed to get flags for interface \"%s\"\n",
1248
1246
if_entry->d_name);
1253
1251
/* Reject down interfaces */
1254
if(not (flags & IFF_UP)){
1258
/* Accept point-to-point devices only if connect_to is specified */
1259
if(connect_to != NULL and (flags & IFF_POINTOPOINT)){
1261
fprintf(stderr, "Accepting point-to-point interface \"%s\"\n",
1266
/* Otherwise, reject non-broadcast-capable devices */
1267
if(not (flags & IFF_BROADCAST)){
1269
fprintf(stderr, "Rejecting non-broadcast interface \"%s\"\n",
1274
/* Reject non-ARP interfaces (including dummy interfaces) */
1275
if(flags & IFF_NOARP){
1277
fprintf(stderr, "Rejecting non-ARP interface \"%s\"\n",
1282
/* Accept this device */
1284
fprintf(stderr, "Interface \"%s\" is acceptable\n",
1252
if(not (ifr.ifr_flags & IFF_UP)){
1254
fprintf(stderr, "Mandos plugin mandos-client: "
1255
"Rejecting down interface \"%s\"\n",
1261
/* Reject non-running interfaces */
1262
if(not (ifr.ifr_flags & IFF_RUNNING)){
1264
fprintf(stderr, "Mandos plugin mandos-client: "
1265
"Rejecting non-running interface \"%s\"\n",
1271
if(not good_flags(if_entry->d_name, &ifr)){
1311
/* Save pointer to last character */
1312
char *end = strchr(direntry->d_name, '\0')-1;
1319
if(((direntry->d_name)[0] == '#')
1321
/* Temporary #name# */
1325
/* XXX more rules here */
1327
ret = stat(direntry->d_name, &st);
1299
sret = strspn(direntry->d_name, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1300
"abcdefghijklmnopqrstuvwxyz"
1303
if((direntry->d_name)[sret] != '\0'){
1304
/* Contains non-allowed characters */
1306
fprintf(stderr, "Mandos plugin mandos-client: "
1307
"Ignoring hook \"%s\" with bad name\n",
1313
char *fullname = NULL;
1314
ret = asprintf(&fullname, "%s/%s", hookdir, direntry->d_name);
1316
perror_plus("asprintf");
1320
ret = stat(fullname, &st);
1330
perror_plus("Could not stat plugin");
1323
perror_plus("Could not stat hook");
1334
if(not (st.st_mode & S_ISREG)){
1327
if(not (S_ISREG(st.st_mode))){
1335
1328
/* Not a regular file */
1330
fprintf(stderr, "Mandos plugin mandos-client: "
1331
"Ignoring hook \"%s\" - not a file\n",
1338
1336
if(not (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))){
1339
1337
/* Not executable */
1339
fprintf(stderr, "Mandos plugin mandos-client: "
1340
"Ignoring hook \"%s\" - not executable\n",
1352
1355
if(mc.current_server == NULL){
1357
fprintf(stderr, "Mandos plugin mandos-client: "
1355
1358
"Wait until first server is found. No timeout!\n");
1357
1360
ret = avahi_simple_poll_iterate(s, -1);
1360
fprintf(stderr, "Check current_server if we should run it,"
1363
fprintf(stderr, "Mandos plugin mandos-client: "
1364
"Check current_server if we should run it,"
1363
1367
/* the current time */
1664
1677
struct dirent **direntries;
1665
1678
struct dirent *direntry;
1666
int numhooks = scandir(HOOKDIR, &direntries, runnable_hook,
1679
int numhooks = scandir(hookdir, &direntries, runnable_hook,
1668
int devnull = open("/dev/null", O_RDONLY);
1669
for(int i = 0; i < numhooks; i++){
1670
direntry = direntries[0];
1671
char *fullname = NULL;
1672
ret = asprintf(&fullname, "%s/%s", tempdir,
1675
perror_plus("asprintf");
1678
pid_t hook_pid = fork();
1681
dup2(devnull, STDIN_FILENO);
1683
dup2(STDERR_FILENO, STDOUT_FILENO);
1684
setenv("DEVICE", interface, 1);
1685
setenv("VERBOSE", debug ? "1" : "0", 1);
1686
setenv("MODE", "start", 1);
1687
/* setenv( XXX more here */
1688
ret = execl(fullname, direntry->d_name, "start");
1689
perror_plus("execl");
1682
perror_plus("scandir");
1684
int devnull = open("/dev/null", O_RDONLY);
1685
for(int i = 0; i < numhooks; i++){
1686
direntry = direntries[0];
1687
char *fullname = NULL;
1688
ret = asprintf(&fullname, "%s/%s", hookdir, direntry->d_name);
1690
perror_plus("asprintf");
1693
pid_t hook_pid = fork();
1696
dup2(devnull, STDIN_FILENO);
1698
dup2(STDERR_FILENO, STDOUT_FILENO);
1699
ret = setenv("MANDOSNETHOOKDIR", hookdir, 1);
1701
perror_plus("setenv");
1704
ret = setenv("DEVICE", interface, 1);
1706
perror_plus("setenv");
1709
ret = setenv("VERBOSE", debug ? "1" : "0", 1);
1711
perror_plus("setenv");
1714
ret = setenv("MODE", "start", 1);
1716
perror_plus("setenv");
1720
ret = asprintf(&delaystring, "%f", delay);
1722
perror_plus("asprintf");
1725
ret = setenv("DELAY", delaystring, 1);
1728
perror_plus("setenv");
1732
ret = execl(fullname, direntry->d_name, "start", NULL);
1733
perror_plus("execl");
1736
if(TEMP_FAILURE_RETRY(waitpid(hook_pid, &status, 0)) == -1){
1737
perror_plus("waitpid");
1741
if(WIFEXITED(status)){
1742
if(WEXITSTATUS(status) != 0){
1743
fprintf(stderr, "Mandos plugin mandos-client: "
1744
"Warning: network hook \"%s\" exited"
1745
" with status %d\n", direntry->d_name,
1746
WEXITSTATUS(status));
1750
} else if(WIFSIGNALED(status)){
1751
fprintf(stderr, "Mandos plugin mandos-client: "
1752
"Warning: network hook \"%s\" died by"
1753
" signal %d\n", direntry->d_name,
1758
fprintf(stderr, "Mandos plugin mandos-client: "
1759
"Warning: network hook \"%s\" crashed\n",
1703
1778
if(interface[0] == '\0'){
1704
1779
struct dirent **direntries;
1705
ret = scandir(sys_class_net, &direntries, good_interface,
1780
/* First look for interfaces that are up */
1781
ret = scandir(sys_class_net, &direntries, up_interface,
1784
/* No up interfaces, look for any good interfaces */
1786
ret = scandir(sys_class_net, &direntries, good_interface,
1708
/* Pick the first good interface */
1790
/* Pick the first interface returned */
1709
1791
interface = strdup(direntries[0]->d_name);
1711
fprintf(stderr, "Using interface \"%s\"\n", interface);
1793
fprintf(stderr, "Mandos plugin mandos-client: "
1794
"Using interface \"%s\"\n", interface);
1713
1796
if(interface == NULL){
1714
1797
perror_plus("malloc");
2090
2181
AVAHI_PROTO_UNSPEC, "_mandos._tcp",
2091
2182
NULL, 0, browse_callback, NULL);
2092
2183
if(sb == NULL){
2093
fprintf(stderr, "Failed to create service browser: %s\n",
2184
fprintf(stderr, "Mandos plugin mandos-client: "
2185
"Failed to create service browser: %s\n",
2094
2186
avahi_strerror(avahi_server_errno(mc.server)));
2095
2187
exitcode = EX_UNAVAILABLE;
2103
2195
/* Run the main loop */
2106
fprintf(stderr, "Starting Avahi loop search\n");
2198
fprintf(stderr, "Mandos plugin mandos-client: "
2199
"Starting Avahi loop search\n");
2109
2202
ret = avahi_loop_with_timeout(mc.simple_poll,
2110
2203
(int)(retry_interval * 1000));
2112
fprintf(stderr, "avahi_loop_with_timeout exited %s\n",
2205
fprintf(stderr, "Mandos plugin mandos-client: "
2206
"avahi_loop_with_timeout exited %s\n",
2113
2207
(ret == 0) ? "successfully" : "with error");
2119
fprintf(stderr, "%s exiting\n", argv[0]);
2213
fprintf(stderr, "Mandos plugin mandos-client: "
2214
"%s exiting\n", argv[0]);
2122
2217
/* Cleanup things */