3 # save miscellaneous options
5 require './sshd-lib.pl';
7 &error_setup($text{'misc_err'});
8 &lock_file($config{'sshd_config'});
9 $conf = &get_sshd_config();
11 &save_directive("X11Forwarding", $conf, $in{'x11'} ? 'yes' : 'no');
13 if ($version{'type'} ne 'ssh' || $version{'number'} < 2) {
14 if ($in{'xoff_def'}) {
15 &save_directive("X11DisplayOffset", $conf);
18 $in{'xoff'} =~ /^\d+$/ || &error($text{'misc_exoff'});
19 &save_directive("X11DisplayOffset", $conf, $in{'xoff'});
22 if ($version{'type'} eq 'ssh' || $version{'number'} >= 2) {
23 if ($in{'xauth_def'}) {
24 &save_directive("XAuthLocation", $conf);
27 -x $in{'xauth'} || &error($text{'misc_exauth'});
28 &save_directive("XAuthLocation", $conf, $in{'xauth'});
33 if ($version{'type'} eq 'ssh' && $version{'number'} < 2) {
34 if ($in{'umask_def'}) {
35 &save_directive("Umask", $conf);
38 $in{'umask'} =~ /^0[0-7][0-7][0-7]$/ ||
39 &error($text{'misc_eumask'});
40 &save_directive("Umask", $conf, $in{'umask'});
44 &save_directive("SyslogFacility", $conf,
45 $in{'syslog_def'} ? undef : uc($in{'syslog'}));
47 if ($version{'type'} eq 'openssh') {
48 &save_directive("LogLevel", $conf,
49 $in{'loglevel_def'} ? undef : $in{'loglevel'});
52 if ($version{'type'} ne 'ssh' || $version{'number'} < 2) {
53 if ($in{'bits_def'}) {
54 &save_directive("ServerKeyBits", $conf);
57 $in{'bits'} =~ /^\d+$/ || &error($text{'misc_ebits'});
58 &save_directive("ServerKeyBits", $conf, $in{'bits'});
62 if ($version{'type'} eq 'ssh') {
63 &save_directive("QuietMode", $conf, $in{'quite'} ? 'yes' : 'no');
66 if ($version{'type'} ne 'ssh' || $version{'number'} < 2) {
67 if ($in{'regen_def'}) {
68 &save_directive("KeyRegenerationInterval", $conf);
71 $in{'regen'} =~ /^\d+$/ || &error($text{'misc_eregen'});
72 &save_directive("KeyRegenerationInterval", $conf, $in{'regen'});
76 if ($version{'type'} eq 'ssh' && $version{'number'} < 2) {
77 &save_directive("FascistLogging", $conf, $in{'fascist'} ? 'yes' : 'no');
80 if ($version{'type'} eq 'openssh' && $version{'number'} >= 2) {
82 &save_directive("PidFile", $conf);
85 $in{'pid'} =~ /^\S+$/ || &error($text{'misc_epid'});
86 &save_directive("PidFile", $conf, $in{'pid'});
90 if ($version{'type'} eq 'openssh' && $version{'number'} >= 3.2) {
91 &save_directive("UsePrivilegeSeparation", $conf,
92 $in{'separ'} ? 'yes' : 'no');
96 &unlock_file($config{'sshd_config'});