version 1.319, 2008/09/11 14:22:37 |
version 1.320, 2008/10/08 23:34:03 |
|
|
int |
int |
main(int ac, char **av) |
main(int ac, char **av) |
{ |
{ |
int i, opt, exit_status; |
int i, opt, exit_status, use_syslog; |
char *p, *cp, *line, buf[256]; |
char *p, *cp, *line, buf[256]; |
struct stat st; |
struct stat st; |
struct passwd *pw; |
struct passwd *pw; |
|
|
|
|
/* Parse command-line arguments. */ |
/* Parse command-line arguments. */ |
host = NULL; |
host = NULL; |
|
use_syslog = 0; |
|
|
again: |
again: |
while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" |
while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" |
"ACD:F:I:KL:MNO:PR:S:TVw:XY")) != -1) { |
"ACD:F:I:KL:MNO:PR:S:TVw:XYy")) != -1) { |
switch (opt) { |
switch (opt) { |
case '1': |
case '1': |
options.protocol = SSH_PROTO_1; |
options.protocol = SSH_PROTO_1; |
|
|
case 'X': |
case 'X': |
options.forward_x11 = 1; |
options.forward_x11 = 1; |
break; |
break; |
|
case 'y': |
|
use_syslog = 1; |
|
break; |
case 'Y': |
case 'Y': |
options.forward_x11 = 1; |
options.forward_x11 = 1; |
options.forward_x11_trusted = 1; |
options.forward_x11_trusted = 1; |
|
|
*/ |
*/ |
log_init(av[0], |
log_init(av[0], |
options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, |
options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, |
SYSLOG_FACILITY_USER, 1); |
SYSLOG_FACILITY_USER, !use_syslog); |
|
|
/* |
/* |
* Read per-user configuration file. Ignore the system wide config |
* Read per-user configuration file. Ignore the system wide config |
|
|
channel_set_af(options.address_family); |
channel_set_af(options.address_family); |
|
|
/* reinit */ |
/* reinit */ |
log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1); |
log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, !use_syslog); |
|
|
if (options.user == NULL) |
if (options.user == NULL) |
options.user = xstrdup(pw->pw_name); |
options.user = xstrdup(pw->pw_name); |