wbinfo: Use one codebase for Samba3 and Samba4.
[metze/samba/wip.git] / nsswitch / wbinfo.c
index 5fe0090567aa0da34f7b2e544649ec69e2f5d6d4..813846f138833b51d87317743936d4beebb27264 100644 (file)
@@ -4,7 +4,7 @@
    Winbind status program.
 
    Copyright (C) Tim Potter      2000-2003
-   Copyright (C) Andrew Bartlett 2002
+   Copyright (C) Andrew Bartlett 2002-2007
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include "lib/cmdline/popt_common.h"
 #endif
 
-
+#ifdef DBGC_CLASS
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
+#endif
 
 static struct wbcInterfaceDetails *init_interface_details(void)
 {
@@ -1214,6 +1215,7 @@ static bool wbinfo_auth_krb5(char *username, const char *cctype, uint32_t flags)
        char *p = NULL;
        char *password = NULL;
        char *name = NULL;
+       char *local_cctype = NULL;
        uid_t uid;
        struct wbcLogonUserParams params;
        struct wbcLogonUserInfo *info;
@@ -1233,6 +1235,8 @@ static bool wbinfo_auth_krb5(char *username, const char *cctype, uint32_t flags)
                password = wbinfo_prompt_pass(frame, NULL, username);
        }
 
+       local_cctype = talloc_strdup(frame, cctype);
+
        name = s;
 
        uid = geteuid();
@@ -1266,7 +1270,7 @@ static bool wbinfo_auth_krb5(char *username, const char *cctype, uint32_t flags)
                                     &params.blobs,
                                     "krb5_cc_type",
                                     0,
-                                    (uint8_t *)cctype,
+                                    (uint8_t *)local_cctype,
                                     strlen(cctype)+1);
        if (!WBC_ERROR_IS_OK(wbc_status)) {
                goto done;