Merge branch 'stable-2.6'

* stable-2.6:
  Migration v57 setInt parameter trivial fix
  Disable closing idle Ssh connections again
This commit is contained in:
Shawn Pearce
2013-04-08 09:46:24 -07:00
3 changed files with 27 additions and 1 deletions

View File

@@ -2368,6 +2368,20 @@ unit suffixes to express their setting:
+
By default, 2 minutes.
[[sshd.idleTimeout]]sshd.idleTimeout::
+
Time in seconds after which the server automatically terminates idle
connections (or 0 to disable closing of idle connections). Values
should use common unit suffixes to express their setting:
+
* s, sec, second, seconds
* m, min, minute, minutes
* h, hr, hour, hours
* d, day, days
+
By default, 0.
[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
+
Maximum number of concurrent SSH sessions that a user account

View File

@@ -125,7 +125,7 @@ public class Schema_57 extends SchemaVersion {
}
AccountGroup batch = db.accountGroups().get(sc.batchUsersGroupId);
stmt.setInt(0, sc.batchUsersGroupId.get());
stmt.setInt(1, sc.batchUsersGroupId.get());
if (batch != null
&& db.accountGroupMembers().byGroup(sc.batchUsersGroupId).toList().isEmpty()
&& stmt.executeQuery().first() != false) {

View File

@@ -159,6 +159,18 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
String.valueOf(MILLISECONDS.convert(ConfigUtil.getTimeUnit(cfg, "sshd",
null, "loginGraceTime", 120, SECONDS), SECONDS)));
long idleTimeoutSeconds = ConfigUtil.getTimeUnit(cfg, "sshd", null,
"idleTimeout", 0, SECONDS);
if (idleTimeoutSeconds == 0) {
// Since Apache SSHD does not allow to turn off closing idle connections,
// we fake it by using the highest timeout allowed by Apache SSHD, which
// amounts to ~24 days.
idleTimeoutSeconds = MILLISECONDS.toSeconds(Integer.MAX_VALUE);
}
getProperties().put(
IDLE_TIMEOUT,
String.valueOf(SECONDS.toMillis(idleTimeoutSeconds)));
final int maxConnectionsPerUser =
cfg.getInt("sshd", "maxConnectionsPerUser", 64);
if (0 < maxConnectionsPerUser) {