Skip to content

Commit caa6287

Browse files
committed
remove --verbose option
1 parent c8fce0a commit caa6287

File tree

8 files changed

+50
-55
lines changed

8 files changed

+50
-55
lines changed

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
vNEXT:
2+
New log system: instead of --verbose with arbitrary
3+
levels, there are now several message classes. Each
4+
message class can be set to go to stderr, syslog, or
5+
both. Classes are documented in example.cfg.
6+
7+
inetd merges stderr output to what is sent to the
8+
client, which is a security issue as it might give
9+
information to an attacker. When inetd is activated,
10+
stderr is forcibly closed.
11+
112
v1.22: 17AUG2021
213
sslh-select now supports UDP protocols.
314
Probes specified in the `protocols`

example.cfg

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,21 @@ user: "nobody";
1212
pidfile: "/var/run/sslh.pid";
1313
chroot: "/var/empty";
1414

15-
verbose: 0;
16-
1715
# Logging configuration
1816
# Value: 1: stdout; 2: syslog; 3: both
19-
verbose-config: 0; # config: print configuration at startup
17+
# Defaults are indicated here, and should be sensible. Generally, you want *-error
18+
# to be always enabled, to know if something is going wrong.
19+
verbose-config: 0; # print configuration at startup
20+
verbose-config-error: 3; # print configuration errors
21+
verbose-connections: 3; # trace established incoming address to forward address
22+
verbose-connections-error: 3; # connection errors
23+
verbose-connections-try: 0; # connection attempts towards targets
24+
verbose-fd: 0; # file descriptor activity, open/close/whatnot
25+
verbose-packets: 0; # hexdump packets on which probing is done
26+
verbose-probe-info: 0; # what's happening during the probe process
27+
verbose-probe-error: 3; # failures and problems during probing
28+
verbose-system-error: 3; # system call problem, i.e. malloc, fork, failing
29+
verbose-int-error: 3; # internal errors, the kind that should never happen
2030

2131

2232
# Specify which syslog facility to use (names for your

probe.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,8 @@ int probe_buffer(char* buf, int len, struct sslhcfg_protocols_item** proto)
350350
struct sslhcfg_protocols_item* p;
351351
int i, res, again = 0;
352352

353-
if (cfg.verbose > 1) {
354-
print_message(msg_packets, "hexdump of incoming packet:\n");
355-
hexdump(msg_packets, buf, len);
356-
}
353+
print_message(msg_packets, "hexdump of incoming packet:\n");
354+
hexdump(msg_packets, buf, len);
357355

358356
*proto = NULL;
359357
for (i = 0; i < cfg.protocols_len; i++) {

sslh-conf.c

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README)
2-
* on Sun Sep 26 16:54:06 2021.
2+
* on Mon Sep 27 13:21:48 2021.
33
44
# conf2struct: generate libconf parsers that read to structs
55
# Copyright (C) 2018-2021 Yves Rutschle
@@ -454,7 +454,6 @@ struct arg_file* sslhcfg_conffile;
454454
struct arg_int* sslhcfg_verbose_probe_error;
455455
struct arg_int* sslhcfg_verbose_system_error;
456456
struct arg_int* sslhcfg_verbose_int_error;
457-
struct arg_int* sslhcfg_verbose;
458457
struct arg_lit* sslhcfg_version;
459458
struct arg_lit* sslhcfg_foreground;
460459
struct arg_lit* sslhcfg_inetd;
@@ -794,7 +793,7 @@ static struct config_desc table_sslhcfg_listen[] = {
794793
},
795794
{ 0 }
796795
};
797-
796+
798797
static struct config_desc table_sslhcfg[] = {
799798

800799

@@ -974,22 +973,6 @@ static struct config_desc table_sslhcfg[] = {
974973
/* default_val*/ .default_val.def_int = 3
975974
},
976975

977-
{
978-
/* name */ "verbose",
979-
/* type */ CFG_INT,
980-
/* sub_group*/ NULL,
981-
/* arg_cl */ & sslhcfg_verbose,
982-
/* base_addr */ NULL,
983-
/* offset */ offsetof(struct sslhcfg_item, verbose),
984-
/* offset_len */ 0,
985-
/* offset_present */ 0,
986-
/* size */ sizeof(int),
987-
/* array_type */ -1,
988-
/* mandatory */ 1,
989-
/* optional */ 0,
990-
/* default_val*/ .default_val.def_int = 0
991-
},
992-
993976
{
994977
/* name */ "version",
995978
/* type */ CFG_BOOL,
@@ -1310,7 +1293,7 @@ static struct compound_cl_arg compound_cl_args[] = {
13101293
{ /* arg: listen */
13111294
.regex = "(.+):(\\w+)",
13121295
.arg_cl = & sslhcfg_listen,
1313-
.base_entry = & table_sslhcfg [24],
1296+
.base_entry = & table_sslhcfg [23],
13141297
.targets = sslhcfg_listen_targets,
13151298

13161299

@@ -1322,7 +1305,7 @@ static struct compound_cl_arg compound_cl_args[] = {
13221305
{ /* arg: ssh */
13231306
.regex = "(.+):(\\w+)",
13241307
.arg_cl = & sslhcfg_ssh,
1325-
.base_entry = & table_sslhcfg [25],
1308+
.base_entry = & table_sslhcfg [24],
13261309
.targets = sslhcfg_ssh_targets,
13271310

13281311

@@ -1334,7 +1317,7 @@ static struct compound_cl_arg compound_cl_args[] = {
13341317
{ /* arg: tls */
13351318
.regex = "(.+):(\\w+)",
13361319
.arg_cl = & sslhcfg_tls,
1337-
.base_entry = & table_sslhcfg [25],
1320+
.base_entry = & table_sslhcfg [24],
13381321
.targets = sslhcfg_tls_targets,
13391322

13401323

@@ -1346,7 +1329,7 @@ static struct compound_cl_arg compound_cl_args[] = {
13461329
{ /* arg: openvpn */
13471330
.regex = "(.+):(\\w+)",
13481331
.arg_cl = & sslhcfg_openvpn,
1349-
.base_entry = & table_sslhcfg [25],
1332+
.base_entry = & table_sslhcfg [24],
13501333
.targets = sslhcfg_openvpn_targets,
13511334

13521335

@@ -1358,7 +1341,7 @@ static struct compound_cl_arg compound_cl_args[] = {
13581341
{ /* arg: tinc */
13591342
.regex = "(.+):(\\w+)",
13601343
.arg_cl = & sslhcfg_tinc,
1361-
.base_entry = & table_sslhcfg [25],
1344+
.base_entry = & table_sslhcfg [24],
13621345
.targets = sslhcfg_tinc_targets,
13631346

13641347

@@ -1370,7 +1353,7 @@ static struct compound_cl_arg compound_cl_args[] = {
13701353
{ /* arg: xmpp */
13711354
.regex = "(.+):(\\w+)",
13721355
.arg_cl = & sslhcfg_xmpp,
1373-
.base_entry = & table_sslhcfg [25],
1356+
.base_entry = & table_sslhcfg [24],
13741357
.targets = sslhcfg_xmpp_targets,
13751358

13761359

@@ -1382,7 +1365,7 @@ static struct compound_cl_arg compound_cl_args[] = {
13821365
{ /* arg: http */
13831366
.regex = "(.+):(\\w+)",
13841367
.arg_cl = & sslhcfg_http,
1385-
.base_entry = & table_sslhcfg [25],
1368+
.base_entry = & table_sslhcfg [24],
13861369
.targets = sslhcfg_http_targets,
13871370

13881371

@@ -1394,7 +1377,7 @@ static struct compound_cl_arg compound_cl_args[] = {
13941377
{ /* arg: adb */
13951378
.regex = "(.+):(\\w+)",
13961379
.arg_cl = & sslhcfg_adb,
1397-
.base_entry = & table_sslhcfg [25],
1380+
.base_entry = & table_sslhcfg [24],
13981381
.targets = sslhcfg_adb_targets,
13991382

14001383

@@ -1406,7 +1389,7 @@ static struct compound_cl_arg compound_cl_args[] = {
14061389
{ /* arg: socks5 */
14071390
.regex = "(.+):(\\w+)",
14081391
.arg_cl = & sslhcfg_socks5,
1409-
.base_entry = & table_sslhcfg [25],
1392+
.base_entry = & table_sslhcfg [24],
14101393
.targets = sslhcfg_socks5_targets,
14111394

14121395

@@ -1418,7 +1401,7 @@ static struct compound_cl_arg compound_cl_args[] = {
14181401
{ /* arg: syslog */
14191402
.regex = "(.+):(\\w+)",
14201403
.arg_cl = & sslhcfg_syslog,
1421-
.base_entry = & table_sslhcfg [25],
1404+
.base_entry = & table_sslhcfg [24],
14221405
.targets = sslhcfg_syslog_targets,
14231406

14241407

@@ -1430,7 +1413,7 @@ static struct compound_cl_arg compound_cl_args[] = {
14301413
{ /* arg: anyprot */
14311414
.regex = "(.+):(\\w+)",
14321415
.arg_cl = & sslhcfg_anyprot,
1433-
.base_entry = & table_sslhcfg [25],
1416+
.base_entry = & table_sslhcfg [24],
14341417
.targets = sslhcfg_anyprot_targets,
14351418

14361419

@@ -2106,7 +2089,6 @@ int sslhcfg_cl_parse(int argc, char* argv[], struct sslhcfg_item* cfg)
21062089
sslhcfg_verbose_probe_error = arg_intn(NULL, "verbose-probe-error", "<n>", 0, 1, ""),
21072090
sslhcfg_verbose_system_error = arg_intn(NULL, "verbose-system-error", "<n>", 0, 1, ""),
21082091
sslhcfg_verbose_int_error = arg_intn(NULL, "verbose-int-error", "<n>", 0, 1, ""),
2109-
sslhcfg_verbose = arg_intn("v", "verbose", "<n>", 0, 1, ""),
21102092
sslhcfg_version = arg_litn("V", "version", 0, 1, "Print version information and exit"),
21112093
sslhcfg_foreground = arg_litn("f", "foreground", 0, 1, "Run in foreground instead of as a daemon"),
21122094
sslhcfg_inetd = arg_litn("i", "inetd", 0, 1, "Run in inetd mode: use stdin/stdout instead of network listen"),
@@ -2308,9 +2290,6 @@ void sslhcfg_fprint(
23082290
fprintf(out, "verbose_int_error: %d", sslhcfg->verbose_int_error);
23092291
fprintf(out, "\n");
23102292
indent(out, depth);
2311-
fprintf(out, "verbose: %d", sslhcfg->verbose);
2312-
fprintf(out, "\n");
2313-
indent(out, depth);
23142293
fprintf(out, "version: %d", sslhcfg->version);
23152294
fprintf(out, "\n");
23162295
indent(out, depth);

sslh-conf.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README)
2-
* on Sun Sep 26 16:54:06 2021.
2+
* on Mon Sep 27 13:21:48 2021.
33
44
# conf2struct: generate libconf parsers that read to structs
55
# Copyright (C) 2018-2021 Yves Rutschle
@@ -85,7 +85,6 @@ struct sslhcfg_item {
8585
int verbose_probe_error;
8686
int verbose_system_error;
8787
int verbose_int_error;
88-
int verbose;
8988
int version;
9089
int foreground;
9190
int inetd;

sslh-main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ int main(int argc, char *argv[], char* envp[])
196196

197197
if (cfg.inetd)
198198
{
199-
cfg.verbose = 0;
200199
close(fileno(stderr)); /* Make sure no error will go to client */
201200
start_shoveler(0);
202201
exit(0);

sslhconf.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ config: {
3939
{ name: "verbose-system-error"; type: "int"; default: 3; },
4040
{ name: "verbose-int-error"; type: "int"; default: 3; },
4141

42-
{ name: "verbose"; type: "int"; short: "v" }, # to delete
4342
{ name: "version"; type: "bool"; default: false;
4443
short: "V";
4544
description: "Print version information and exit"; },

test.cfg

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Configuration file for testing (use both by sslh under
22
# test and the test script `t`)
33

4-
verbose: 4;
54
foreground: true;
65
inetd: false;
76
numeric: true;
@@ -15,16 +14,17 @@ syslog_facility: "auth";
1514
# Value: 1: stdout; 2: syslog; 3: both
1615
# Defaults should be sensible. Generally, you want *-error
1716
# to be always enabled, to know if something is going wrong.
18-
#verbose-config: 3; # config: print configuration at startup
19-
#verbose-config-error: 3; #config-error: print configuration errors
20-
#verbose-connections: 3; #config-connections: track connections
21-
#verbose-fd: 3; # file descriptor activity, open/close/whatnot
17+
verbose-config: 3; # print configuration at startup
18+
verbose-config-error: 3; # print configuration errors
19+
verbose-connections: 3; # trace established incoming address to forward address
20+
verbose-connections-error: 3; # connection errors
21+
verbose-connections-try: 3; # connection attempts towards targets
22+
verbose-fd: 3; # file descriptor activity, open/close/whatnot
2223
verbose-packets: 3; # hexdump packets on which probing is done
23-
#verbose-system-error: 3; # system call problem, i.e. malloc, fork, failing
24-
#verbose-int-error: 3; # internal errors, the kind that should never happen
25-
#verbose-connections-try: 3; # connection attempts towards targets
26-
#verbose-connections: 3; # trace established incoming address to forward address
27-
# verbose-connections-error: 3; # connection errors
24+
verbose-probe-info: 3; # what's happening during the probe process
25+
verbose-probe-error: 3; # failures and problems during probing
26+
verbose-system-error: 3; # system call problem, i.e. malloc, fork, failing
27+
verbose-int-error: 3; # internal errors, the kind that should never happen
2828

2929
# List of interfaces on which we should listen
3030
# Options:

0 commit comments

Comments
 (0)