]> andersk Git - gssapi-openssh.git/blobdiff - openssh/servconf.c
session hook patch from Olle Mulmo:
[gssapi-openssh.git] / openssh / servconf.c
index 7aa0c73e9c45bb88260c9252c0843f182d0948a9..12b7b835d63d96cc84027599be5e5e61c931745c 100644 (file)
@@ -101,6 +101,11 @@ initialize_server_options(ServerOptions *options)
 #endif
 #ifdef AFS
        options->afs_token_passing = -1;
+#endif
+#ifdef  SESSION_HOOKS
+        options->session_hooks_allow = -1;
+        options->session_hooks_startup_cmd = NULL;
+        options->session_hooks_shutdown_cmd = NULL;
 #endif
        options->password_authentication = -1;
        options->kbd_interactive_authentication = -1;
@@ -230,6 +235,14 @@ fill_default_server_options(ServerOptions *options)
 #ifdef AFS
        if (options->afs_token_passing == -1)
                options->afs_token_passing = 0;
+#endif
+#ifdef SESSION_HOOKS
+        if (options->session_hooks_allow == -1)
+        {
+            options->session_hooks_allow = 0;
+            options->session_hooks_startup_cmd = NULL;
+            options->session_hooks_shutdown_cmd = NULL;
+        }
 #endif
        if (options->password_authentication == -1)
                options->password_authentication = 1;
@@ -306,6 +319,9 @@ typedef enum {
 #endif
 #ifdef AFS
        sAFSTokenPassing,
+#endif
+#ifdef SESSION_HOOKS
+        sAllowSessionHooks, sSessionHookStartupCmd, sSessionHookShutdownCmd,
 #endif
        sChallengeResponseAuthentication,
        sPasswordAuthentication, sKbdInteractiveAuthentication, sListenAddress,
@@ -366,6 +382,11 @@ static struct {
 #ifdef AFS
        { "afstokenpassing", sAFSTokenPassing },
 #endif
+#ifdef SESSION_HOOKS
+        { "allowsessionhooks", sAllowSessionHooks },
+        { "sessionhookstartupcmd", sSessionHookStartupCmd },
+        { "sessionhookshutdowncmd", sSessionHookShutdownCmd },
+#endif        
        { "passwordauthentication", sPasswordAuthentication },
        { "kbdinteractiveauthentication", sKbdInteractiveAuthentication },
        { "challengeresponseauthentication", sChallengeResponseAuthentication },
@@ -707,7 +728,22 @@ parse_flag:
                intptr = &options->afs_token_passing;
                goto parse_flag;
 #endif
-
+#ifdef SESSION_HOOKS
+        case sAllowSessionHooks:
+                intptr = &options->session_hooks_allow;
+                goto parse_flag;
+        case sSessionHookStartupCmd:
+        case sSessionHookShutdownCmd:
+                arg = strdelim(&cp);
+                if (!arg || *arg == '\0')
+                    fatal("%s line %d: empty session hook command",
+                          filename, linenum);
+                if (opcode==sSessionHookStartupCmd)
+                    options->session_hooks_startup_cmd = strdup(arg);
+                else
+                    options->session_hooks_shutdown_cmd = strdup(arg);
+                break;
+#endif                  
        case sPasswordAuthentication:
                intptr = &options->password_authentication;
                goto parse_flag;
This page took 0.041465 seconds and 4 git commands to generate.