s3-net: allow to call "net ads kerberos pac <impersonation principal> -P".
authorGünther Deschner <gd@samba.org>
Mon, 13 Oct 2008 15:28:39 +0000 (17:28 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 6 Nov 2009 11:44:45 +0000 (12:44 +0100)
Guenther

source3/utils/net_ads.c

index ebc175b8c791d0766b02be7adb61045c14677a93..beef62a8f117c2e87a7afdd60d4478ef73da4bf0 100644 (file)
@@ -2342,6 +2342,7 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
        TALLOC_CTX *mem_ctx = NULL;
        NTSTATUS status;
        int ret = -1;
        TALLOC_CTX *mem_ctx = NULL;
        NTSTATUS status;
        int ret = -1;
+       const char *impersonate_princ_s = NULL;
 
        if (c->display_usage) {
                d_printf(_("Usage:\n"
 
        if (c->display_usage) {
                d_printf(_("Usage:\n"
@@ -2355,6 +2356,10 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
                goto out;
        }
 
                goto out;
        }
 
+       if (argc > 0) {
+               impersonate_princ_s = argv[0];
+       }
+
        c->opt_password = net_prompt_pass(c, c->opt_user_name);
 
        status = kerberos_return_pac(mem_ctx,
        c->opt_password = net_prompt_pass(c, c->opt_user_name);
 
        status = kerberos_return_pac(mem_ctx,
@@ -2363,10 +2368,11 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
                                     0,
                                     NULL,
                                     NULL,
                                     0,
                                     NULL,
                                     NULL,
-                                    NULL,
+                                    "/tmp/schrott",
                                     true,
                                     true,
                                     2592000, /* one month */
                                     true,
                                     true,
                                     2592000, /* one month */
+                                    impersonate_princ_s,
                                     &pac);
        if (!NT_STATUS_IS_OK(status)) {
                d_printf(_("failed to query kerberos PAC: %s\n"),
                                     &pac);
        if (!NT_STATUS_IS_OK(status)) {
                d_printf(_("failed to query kerberos PAC: %s\n"),