]> andersk Git - gssapi-openssh.git/blobdiff - openssh/servconf.c
Added support for reporting usage metrics.
[gssapi-openssh.git] / openssh / servconf.c
index bb2f9d6f4fbe09846a79f3658fa3a2c36b4932e7..9369476f66318bba7d401ae9ff3ef1408b22ceb7 100644 (file)
@@ -143,6 +143,8 @@ initialize_server_options(ServerOptions *options)
        options->tcp_rcv_buf_poll = -1;
        options->hpn_disabled = -1;
        options->hpn_buffer_size = -1;
+       options->disable_usage_stats = 0;
+       options->usage_stats_targets = NULL;
 }
 
 void
@@ -342,7 +344,6 @@ fill_default_server_options(ServerOptions *options)
                options->compression = 0;
        }
 #endif
-
 }
 
 /* Keyword tokens. */
@@ -383,6 +384,7 @@ typedef enum {
        sUsePrivilegeSeparation, sAllowAgentForwarding,
        sZeroKnowledgePasswordAuthentication,
        sNoneEnabled, sTcpRcvBufPoll, sHPNDisabled, sHPNBufferSize,
+       sDisUsageStats, sUsageStatsTarg,
        sDeprecated, sUnsupported
 } ServerOpCodes;
 
@@ -528,6 +530,8 @@ static struct {
        { "hpndisabled", sHPNDisabled },
        { "hpnbuffersize", sHPNBufferSize },
        { "tcprcvbufpoll", sTcpRcvBufPoll },
+       { "disable_usage_stats", sDisUsageStats, SSHCFG_GLOBAL},
+       { "usage_stats_target", sUsageStatsTarg, SSHCFG_GLOBAL},
        { NULL, sBadOption, 0 }
 };
 
@@ -1462,6 +1466,39 @@ process_server_config_line(ServerOptions *options, char *line,
                        *charptr = xstrdup(arg);
                break;
 
+       case sDisUsageStats:
+               charptr = &options->chroot_directory;
+
+               arg = strdelim(&cp);
+               if (!arg || *arg == '\0')
+                       fatal("%s line %d: missing value.",
+                           filename, linenum);
+               if (!strcasecmp(arg, "true") ||
+                   !strcasecmp(arg, "enabled") ||
+                   !strcasecmp(arg, "yes") ||
+                   !strcasecmp(arg, "on") ||
+                   !strcasecmp(arg, "1"))
+                       options->disable_usage_stats = 1;
+               else if (!strcasecmp(arg, "false") ||
+                        !strcasecmp(arg, "disabled") ||
+                        !strcasecmp(arg, "no") ||
+                        !strcasecmp(arg, "off") ||
+                        !strcasecmp(arg, "0"))
+                       options->disable_usage_stats = 0;
+               else
+                       fatal("Incorrect value for disable_usage_stats");
+               break;
+
+       case sUsageStatsTarg:
+               charptr = &options->chroot_directory;
+
+               arg = strdelim(&cp);
+               if (!arg || *arg == '\0')
+                       fatal("%s line %d: missing value.",
+                           filename, linenum);
+               options->usage_stats_targets = xstrdup(arg);
+               break;
+
        case sDeprecated:
                logit("%s line %d: Deprecated option %s",
                    filename, linenum, arg);
This page took 0.092037 seconds and 4 git commands to generate.