170
171
/* Function to use when printing errors */
171
172
void perror_plus(const char *print_text){
172
174
fprintf(stderr, "Mandos plugin %s: ",
173
175
program_invocation_short_name);
174
177
perror(print_text);
180
__attribute__((format (gnu_printf, 2, 3)))
177
181
int fprintf_plus(FILE *stream, const char *format, ...){
179
183
va_start (ap, format);
181
TEMP_FAILURE_RETRY(fprintf(stream, "Mandos plugin %s: ", program_invocation_short_name));
185
TEMP_FAILURE_RETRY(fprintf(stream, "Mandos plugin %s: ",
186
program_invocation_short_name));
182
187
return TEMP_FAILURE_RETRY(vfprintf(stream, format, ap));
262
267
rc = gpgme_data_new_from_fd(&pgp_data, fd);
263
268
if(rc != GPG_ERR_NO_ERROR){
264
fprintf(stderr, "Mandos plugin mandos-client: "
265
"bad gpgme_data_new_from_fd: %s: %s\n",
266
gpgme_strsource(rc), gpgme_strerror(rc));
269
fprintf_plus(stderr, "bad gpgme_data_new_from_fd: %s: %s\n",
270
gpgme_strsource(rc), gpgme_strerror(rc));
270
274
rc = gpgme_op_import(mc.ctx, pgp_data);
271
275
if(rc != GPG_ERR_NO_ERROR){
272
fprintf(stderr, "Mandos plugin mandos-client: "
273
"bad gpgme_op_import: %s: %s\n",
274
gpgme_strsource(rc), gpgme_strerror(rc));
276
fprintf_plus(stderr, "bad gpgme_op_import: %s: %s\n",
277
gpgme_strsource(rc), gpgme_strerror(rc));
287
fprintf(stderr, "Mandos plugin mandos-client: "
288
"Initializing GPGME\n");
290
fprintf_plus(stderr, "Initializing GPGME\n");
292
294
gpgme_check_version(NULL);
293
295
rc = gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP);
294
296
if(rc != GPG_ERR_NO_ERROR){
295
fprintf(stderr, "Mandos plugin mandos-client: "
296
"bad gpgme_engine_check_version: %s: %s\n",
297
gpgme_strsource(rc), gpgme_strerror(rc));
297
fprintf_plus(stderr, "bad gpgme_engine_check_version: %s: %s\n",
298
gpgme_strsource(rc), gpgme_strerror(rc));
301
302
/* Set GPGME home directory for the OpenPGP engine only */
302
303
rc = gpgme_get_engine_info(&engine_info);
303
304
if(rc != GPG_ERR_NO_ERROR){
304
fprintf(stderr, "Mandos plugin mandos-client: "
305
"bad gpgme_get_engine_info: %s: %s\n",
306
gpgme_strsource(rc), gpgme_strerror(rc));
305
fprintf_plus(stderr, "bad gpgme_get_engine_info: %s: %s\n",
306
gpgme_strsource(rc), gpgme_strerror(rc));
309
309
while(engine_info != NULL){
315
315
engine_info = engine_info->next;
317
317
if(engine_info == NULL){
318
fprintf(stderr, "Mandos plugin mandos-client: "
319
"Could not set GPGME home dir to %s\n", tempdir);
318
fprintf_plus(stderr, "Could not set GPGME home dir to %s\n",
323
323
/* Create new GPGME "context" */
324
324
rc = gpgme_new(&(mc.ctx));
325
325
if(rc != GPG_ERR_NO_ERROR){
326
fprintf(stderr, "Mandos plugin mandos-client: "
327
"bad gpgme_new: %s: %s\n", gpgme_strsource(rc),
326
fprintf_plus(stderr, "Mandos plugin mandos-client: "
327
"bad gpgme_new: %s: %s\n", gpgme_strsource(rc),
350
350
ssize_t plaintext_length = 0;
353
fprintf(stderr, "Mandos plugin mandos-client: "
354
"Trying to decrypt OpenPGP data\n");
353
fprintf_plus(stderr, "Trying to decrypt OpenPGP data\n");
357
356
/* Create new GPGME data buffer from memory cryptotext */
358
357
rc = gpgme_data_new_from_mem(&dh_crypto, cryptotext, crypto_size,
360
359
if(rc != GPG_ERR_NO_ERROR){
361
fprintf(stderr, "Mandos plugin mandos-client: "
362
"bad gpgme_data_new_from_mem: %s: %s\n",
363
gpgme_strsource(rc), gpgme_strerror(rc));
360
fprintf_plus(stderr, "bad gpgme_data_new_from_mem: %s: %s\n",
361
gpgme_strsource(rc), gpgme_strerror(rc));
367
365
/* Create new empty GPGME data buffer for the plaintext */
368
366
rc = gpgme_data_new(&dh_plain);
369
367
if(rc != GPG_ERR_NO_ERROR){
370
fprintf(stderr, "Mandos plugin mandos-client: "
371
"bad gpgme_data_new: %s: %s\n",
372
gpgme_strsource(rc), gpgme_strerror(rc));
368
fprintf_plus(stderr, "Mandos plugin mandos-client: "
369
"bad gpgme_data_new: %s: %s\n",
370
gpgme_strsource(rc), gpgme_strerror(rc));
373
371
gpgme_data_release(dh_crypto);
379
377
rc = gpgme_op_decrypt(mc.ctx, dh_crypto, dh_plain);
380
378
if(rc != GPG_ERR_NO_ERROR){
381
fprintf(stderr, "Mandos plugin mandos-client: "
382
"bad gpgme_op_decrypt: %s: %s\n",
383
gpgme_strsource(rc), gpgme_strerror(rc));
379
fprintf_plus(stderr, "bad gpgme_op_decrypt: %s: %s\n",
380
gpgme_strsource(rc), gpgme_strerror(rc));
384
381
plaintext_length = -1;
386
383
gpgme_decrypt_result_t result;
387
384
result = gpgme_op_decrypt_result(mc.ctx);
388
385
if(result == NULL){
389
fprintf(stderr, "Mandos plugin mandos-client: "
390
"gpgme_op_decrypt_result failed\n");
386
fprintf_plus(stderr, "gpgme_op_decrypt_result failed\n");
392
fprintf(stderr, "Mandos plugin mandos-client: "
393
"Unsupported algorithm: %s\n",
394
result->unsupported_algorithm);
395
fprintf(stderr, "Mandos plugin mandos-client: "
396
"Wrong key usage: %u\n",
397
result->wrong_key_usage);
388
fprintf_plus(stderr, "Unsupported algorithm: %s\n",
389
result->unsupported_algorithm);
390
fprintf_plus(stderr, "Wrong key usage: %u\n",
391
result->wrong_key_usage);
398
392
if(result->file_name != NULL){
399
fprintf(stderr, "Mandos plugin mandos-client: "
400
"File name: %s\n", result->file_name);
393
fprintf_plus(stderr, "File name: %s\n", result->file_name);
402
395
gpgme_recipient_t recipient;
403
396
recipient = result->recipients;
404
397
while(recipient != NULL){
405
fprintf(stderr, "Mandos plugin mandos-client: "
406
"Public key algorithm: %s\n",
407
gpgme_pubkey_algo_name(recipient->pubkey_algo));
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",
412
recipient->status == GPG_ERR_NO_SECKEY
398
fprintf_plus(stderr, "Public key algorithm: %s\n",
399
gpgme_pubkey_algo_name
400
(recipient->pubkey_algo));
401
fprintf_plus(stderr, "Key ID: %s\n", recipient->keyid);
402
fprintf_plus(stderr, "Secret key available: %s\n",
403
recipient->status == GPG_ERR_NO_SECKEY
414
405
recipient = recipient->next;
516
504
/* OpenPGP credentials */
517
505
ret = gnutls_certificate_allocate_credentials(&mc.cred);
518
506
if(ret != GNUTLS_E_SUCCESS){
519
fprintf(stderr, "Mandos plugin mandos-client: "
520
"GnuTLS memory error: %s\n", safer_gnutls_strerror(ret));
507
fprintf_plus(stderr, "GnuTLS memory error: %s\n",
508
safer_gnutls_strerror(ret));
521
509
gnutls_global_deinit();
526
fprintf(stderr, "Mandos plugin mandos-client: "
527
"Attempting to use OpenPGP public key %s and"
528
" secret key %s as GnuTLS credentials\n", pubkeyfilename,
514
fprintf_plus(stderr, "Attempting to use OpenPGP public key %s and"
515
" secret key %s as GnuTLS credentials\n",
532
520
ret = gnutls_certificate_set_openpgp_key_file
533
521
(mc.cred, pubkeyfilename, seckeyfilename,
534
522
GNUTLS_OPENPGP_FMT_BASE64);
535
523
if(ret != GNUTLS_E_SUCCESS){
537
"Mandos plugin mandos-client: "
538
"Error[%d] while reading the OpenPGP key pair ('%s',"
539
" '%s')\n", ret, pubkeyfilename, seckeyfilename);
540
fprintf(stderr, "Mandos plugin mandos-client: "
541
"The GnuTLS error is: %s\n", safer_gnutls_strerror(ret));
525
"Error[%d] while reading the OpenPGP key pair ('%s',"
526
" '%s')\n", ret, pubkeyfilename, seckeyfilename);
527
fprintf_plus(stderr, "The GnuTLS error is: %s\n",
528
safer_gnutls_strerror(ret));
545
532
/* GnuTLS server initialization */
546
533
ret = gnutls_dh_params_init(&mc.dh_params);
547
534
if(ret != GNUTLS_E_SUCCESS){
548
fprintf(stderr, "Mandos plugin mandos-client: "
549
"Error in GnuTLS DH parameter initialization:"
550
" %s\n", safer_gnutls_strerror(ret));
535
fprintf_plus(stderr, "Error in GnuTLS DH parameter"
536
" initialization: %s\n",
537
safer_gnutls_strerror(ret));
553
540
ret = gnutls_dh_params_generate2(mc.dh_params, mc.dh_bits);
554
541
if(ret != GNUTLS_E_SUCCESS){
555
fprintf(stderr, "Mandos plugin mandos-client: "
556
"Error in GnuTLS prime generation: %s\n",
557
safer_gnutls_strerror(ret));
542
fprintf_plus(stderr, "Error in GnuTLS prime generation: %s\n",
543
safer_gnutls_strerror(ret));
752
732
if(if_indextoname((unsigned int)if_index, interface) == NULL){
753
733
perror_plus("if_indextoname");
755
fprintf(stderr, "Mandos plugin mandos-client: "
756
"Connection to: %s%%%s, port %" PRIu16 "\n",
757
ip, interface, port);
735
fprintf_plus(stderr, "Connection to: %s%%%s, port %" PRIu16
736
"\n", ip, interface, port);
760
fprintf(stderr, "Mandos plugin mandos-client: "
761
"Connection to: %s, port %" PRIu16 "\n", ip, port);
739
fprintf_plus(stderr, "Connection to: %s, port %" PRIu16 "\n",
763
742
char addrstr[(INET_ADDRSTRLEN > INET6_ADDRSTRLEN) ?
764
743
INET_ADDRSTRLEN : INET6_ADDRSTRLEN] = "";
1042
1018
case AVAHI_RESOLVER_FAILURE:
1043
fprintf(stderr, "Mandos plugin mandos-client: "
1044
"(Avahi Resolver) Failed to resolve service '%s'"
1045
" of type '%s' in domain '%s': %s\n", name, type, domain,
1046
avahi_strerror(avahi_server_errno(mc.server)));
1019
fprintf_plus(stderr, "(Avahi Resolver) Failed to resolve service "
1020
"'%s' of type '%s' in domain '%s': %s\n", name, type,
1022
avahi_strerror(avahi_server_errno(mc.server)));
1049
1025
case AVAHI_RESOLVER_FOUND:
1051
1027
char ip[AVAHI_ADDRESS_STR_MAX];
1052
1028
avahi_address_snprint(ip, sizeof(ip), address);
1054
fprintf(stderr, "Mandos plugin mandos-client: "
1055
"Mandos server \"%s\" found on %s (%s, %"
1056
PRIdMAX ") on port %" PRIu16 "\n", name, host_name,
1057
ip, (intmax_t)interface, port);
1030
fprintf_plus(stderr, "Mandos server \"%s\" found on %s (%s, %"
1031
PRIdMAX ") on port %" PRIu16 "\n", name,
1032
host_name, ip, (intmax_t)interface, port);
1059
1034
int ret = start_mandos_communication(ip, port, interface,
1060
1035
avahi_proto_to_af(proto));
1062
1037
avahi_simple_poll_quit(mc.simple_poll);
1064
ret = add_server(ip, port, interface,
1065
avahi_proto_to_af(proto));
1039
if(not add_server(ip, port, interface,
1040
avahi_proto_to_af(proto))){
1041
fprintf_plus(stderr, "Failed to add server \"%s\" to server"
1107
1084
if(avahi_s_service_resolver_new(mc.server, interface, protocol,
1108
1085
name, type, domain, protocol, 0,
1109
1086
resolve_callback, NULL) == NULL)
1110
fprintf(stderr, "Mandos plugin mandos-client: "
1111
"Avahi: Failed to resolve service '%s': %s\n",
1112
name, avahi_strerror(avahi_server_errno(mc.server)));
1087
fprintf_plus(stderr, "Avahi: Failed to resolve service '%s':"
1089
avahi_strerror(avahi_server_errno(mc.server)));
1115
1092
case AVAHI_BROWSER_REMOVE:
1164
1141
/* Reject the loopback device */
1165
1142
if(ifr->ifr_flags & IFF_LOOPBACK){
1167
fprintf(stderr, "Mandos plugin mandos-client: "
1168
"Rejecting loopback interface \"%s\"\n", ifname);
1144
fprintf_plus(stderr, "Rejecting loopback interface \"%s\"\n",
1172
1149
/* Accept point-to-point devices only if connect_to is specified */
1173
1150
if(connect_to != NULL and (ifr->ifr_flags & IFF_POINTOPOINT)){
1175
fprintf(stderr, "Mandos plugin mandos-client: "
1176
"Accepting point-to-point interface \"%s\"\n", ifname);
1152
fprintf_plus(stderr, "Accepting point-to-point interface"
1153
" \"%s\"\n", ifname);
1180
1157
/* Otherwise, reject non-broadcast-capable devices */
1181
1158
if(not (ifr->ifr_flags & IFF_BROADCAST)){
1183
fprintf(stderr, "Mandos plugin mandos-client: "
1184
"Rejecting non-broadcast interface \"%s\"\n", ifname);
1160
fprintf_plus(stderr, "Rejecting non-broadcast interface"
1161
" \"%s\"\n", ifname);
1188
1165
/* Reject non-ARP interfaces (including dummy interfaces) */
1189
1166
if(ifr->ifr_flags & IFF_NOARP){
1191
fprintf(stderr, "Mandos plugin mandos-client: "
1192
"Rejecting non-ARP interface \"%s\"\n", ifname);
1168
fprintf_plus(stderr, "Rejecting non-ARP interface \"%s\"\n",
1197
1174
/* Accept this device */
1199
fprintf(stderr, "Mandos plugin mandos-client: "
1200
"Interface \"%s\" is good\n", ifname);
1176
fprintf_plus(stderr, "Interface \"%s\" is good\n", ifname);
1327
1298
if(not (S_ISREG(st.st_mode))){
1328
1299
/* Not a regular file */
1330
fprintf(stderr, "Mandos plugin mandos-client: "
1331
"Ignoring hook \"%s\" - not a file\n",
1301
fprintf_plus(stderr, "Ignoring hook \"%s\" - not a file\n",
1336
1306
if(not (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))){
1337
1307
/* Not executable */
1339
fprintf(stderr, "Mandos plugin mandos-client: "
1340
"Ignoring hook \"%s\" - not executable\n",
1309
fprintf_plus(stderr, "Ignoring hook \"%s\" - not executable\n",
1315
fprintf_plus(stderr, "Hook \"%s\" is acceptable\n",
1393
bool run_network_hooks(const char *mode, const char *interface,
1395
struct dirent **direntries;
1396
struct dirent *direntry;
1398
int numhooks = scandir(hookdir, &direntries, runnable_hook,
1401
perror_plus("scandir");
1403
int devnull = open("/dev/null", O_RDONLY);
1404
for(int i = 0; i < numhooks; i++){
1405
direntry = direntries[i];
1406
char *fullname = NULL;
1407
ret = asprintf(&fullname, "%s/%s", hookdir, direntry->d_name);
1409
perror_plus("asprintf");
1413
fprintf_plus(stderr, "Running network hook \"%s\"\n",
1416
pid_t hook_pid = fork();
1419
/* Raise privileges */
1423
perror_plus("seteuid");
1425
/* Raise privileges even more */
1429
perror_plus("setuid");
1435
perror_plus("setgid");
1437
/* Reset supplementary groups */
1439
ret = setgroups(0, NULL);
1441
perror_plus("setgroups");
1443
dup2(devnull, STDIN_FILENO);
1445
dup2(STDERR_FILENO, STDOUT_FILENO);
1446
ret = setenv("MANDOSNETHOOKDIR", hookdir, 1);
1448
perror_plus("setenv");
1451
ret = setenv("DEVICE", interface, 1);
1453
perror_plus("setenv");
1456
ret = setenv("VERBOSITY", debug ? "1" : "0", 1);
1458
perror_plus("setenv");
1461
ret = setenv("MODE", mode, 1);
1463
perror_plus("setenv");
1467
ret = asprintf(&delaystring, "%f", delay);
1469
perror_plus("asprintf");
1472
ret = setenv("DELAY", delaystring, 1);
1475
perror_plus("setenv");
1479
if(connect_to != NULL){
1480
ret = setenv("CONNECT", connect_to, 1);
1482
perror_plus("setenv");
1486
if(execl(fullname, direntry->d_name, mode, NULL) == -1){
1487
perror_plus("execl");
1488
_exit(EXIT_FAILURE);
1492
if(TEMP_FAILURE_RETRY(waitpid(hook_pid, &status, 0)) == -1){
1493
perror_plus("waitpid");
1497
if(WIFEXITED(status)){
1498
if(WEXITSTATUS(status) != 0){
1499
fprintf_plus(stderr, "Warning: network hook \"%s\" exited"
1500
" with status %d\n", direntry->d_name,
1501
WEXITSTATUS(status));
1505
} else if(WIFSIGNALED(status)){
1506
fprintf_plus(stderr, "Warning: network hook \"%s\" died by"
1507
" signal %d\n", direntry->d_name,
1512
fprintf_plus(stderr, "Warning: network hook \"%s\""
1513
" crashed\n", direntry->d_name);
1520
fprintf_plus(stderr, "Network hook \"%s\" ran successfully\n",
1421
1529
int main(int argc, char *argv[]){
1422
1530
AvahiSServiceBrowser *sb = NULL;
1616
1723
/* Work around Debian bug #633582:
1617
1724
<http://bugs.debian.org/633582> */
1620
1726
/* Re-raise priviliges */
1622
1728
ret = seteuid(0);
1624
1730
perror_plus("seteuid");
1627
if(strcmp(seckey, PATHDIR "/" SECKEY) == 0){
1628
int seckey_fd = open(seckey, O_RDONLY);
1629
if(seckey_fd == -1){
1630
perror_plus("open");
1632
ret = (int)TEMP_FAILURE_RETRY(fstat(seckey_fd, &st));
1634
perror_plus("fstat");
1636
if(S_ISREG(st.st_mode) and st.st_uid == 0 and st.st_gid == 0){
1637
ret = fchown(seckey_fd, uid, gid);
1639
perror_plus("fchown");
1643
TEMP_FAILURE_RETRY(close(seckey_fd));
1647
if(strcmp(pubkey, PATHDIR "/" PUBKEY) == 0){
1648
int pubkey_fd = open(pubkey, O_RDONLY);
1649
if(pubkey_fd == -1){
1650
perror_plus("open");
1652
ret = (int)TEMP_FAILURE_RETRY(fstat(pubkey_fd, &st));
1654
perror_plus("fstat");
1656
if(S_ISREG(st.st_mode) and st.st_uid == 0 and st.st_gid == 0){
1657
ret = fchown(pubkey_fd, uid, gid);
1659
perror_plus("fchown");
1663
TEMP_FAILURE_RETRY(close(pubkey_fd));
1667
/* Lower privileges */
1671
perror_plus("seteuid");
1675
/* Find network hooks and run them */
1677
struct dirent **direntries;
1678
struct dirent *direntry;
1679
int numhooks = scandir(hookdir, &direntries, runnable_hook,
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",
1734
if(strcmp(seckey, PATHDIR "/" SECKEY) == 0){
1735
int seckey_fd = open(seckey, O_RDONLY);
1736
if(seckey_fd == -1){
1737
perror_plus("open");
1739
ret = (int)TEMP_FAILURE_RETRY(fstat(seckey_fd, &st));
1741
perror_plus("fstat");
1743
if(S_ISREG(st.st_mode)
1744
and st.st_uid == 0 and st.st_gid == 0){
1745
ret = fchown(seckey_fd, uid, gid);
1747
perror_plus("fchown");
1751
TEMP_FAILURE_RETRY(close(seckey_fd));
1755
if(strcmp(pubkey, PATHDIR "/" PUBKEY) == 0){
1756
int pubkey_fd = open(pubkey, O_RDONLY);
1757
if(pubkey_fd == -1){
1758
perror_plus("open");
1760
ret = (int)TEMP_FAILURE_RETRY(fstat(pubkey_fd, &st));
1762
perror_plus("fstat");
1764
if(S_ISREG(st.st_mode)
1765
and st.st_uid == 0 and st.st_gid == 0){
1766
ret = fchown(pubkey_fd, uid, gid);
1768
perror_plus("fchown");
1772
TEMP_FAILURE_RETRY(close(pubkey_fd));
1776
/* Lower privileges */
1780
perror_plus("seteuid");
1785
/* Run network hooks */
1786
if(not run_network_hooks("start", interface, delay)){
1775
1791
avahi_set_log_function(empty_log);
2195
2194
/* Run the main loop */
2198
fprintf(stderr, "Mandos plugin mandos-client: "
2199
"Starting Avahi loop search\n");
2197
fprintf_plus(stderr, "Starting Avahi loop search\n");
2202
2200
ret = avahi_loop_with_timeout(mc.simple_poll,
2203
2201
(int)(retry_interval * 1000));
2205
fprintf(stderr, "Mandos plugin mandos-client: "
2206
"avahi_loop_with_timeout exited %s\n",
2207
(ret == 0) ? "successfully" : "with error");
2203
fprintf_plus(stderr, "avahi_loop_with_timeout exited %s\n",
2204
(ret == 0) ? "successfully" : "with error");
2213
fprintf(stderr, "Mandos plugin mandos-client: "
2214
"%s exiting\n", argv[0]);
2210
fprintf_plus(stderr, "%s exiting\n", argv[0]);
2217
2213
/* Cleanup things */