Changeset 751 for trunk/server/source3/libnet/libnet_join.c
- Timestamp:
- Nov 29, 2012, 1:59:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/libnet/libnet_join.c
r745 r751 36 36 #include "rpc_client/init_lsa.h" 37 37 #include "rpc_client/cli_pipe.h" 38 #include "krb5_env.h"39 38 #include "../libcli/security/security.h" 40 39 #include "passdb.h" … … 1765 1764 static int libnet_destroy_JoinCtx(struct libnet_JoinCtx *r) 1766 1765 { 1767 const char *krb5_cc_env = NULL;1768 1769 1766 if (r->in.ads) { 1770 1767 ads_destroy(&r->in.ads); 1771 1768 } 1772 1769 1773 krb5_cc_env = getenv(KRB5_ENV_CCNAME);1774 if (krb5_cc_env && StrCaseCmp(krb5_cc_env, "MEMORY:libnetjoin")) {1775 unsetenv(KRB5_ENV_CCNAME);1776 }1777 1778 1770 return 0; 1779 1771 } … … 1784 1776 static int libnet_destroy_UnjoinCtx(struct libnet_UnjoinCtx *r) 1785 1777 { 1786 const char *krb5_cc_env = NULL;1787 1788 1778 if (r->in.ads) { 1789 1779 ads_destroy(&r->in.ads); 1790 1780 } 1791 1781 1792 krb5_cc_env = getenv(KRB5_ENV_CCNAME);1793 if (krb5_cc_env && StrCaseCmp(krb5_cc_env, "MEMORY:libnetjoin")) {1794 unsetenv(KRB5_ENV_CCNAME);1795 }1796 1797 1782 return 0; 1798 1783 } … … 1805 1790 { 1806 1791 struct libnet_JoinCtx *ctx; 1807 const char *krb5_cc_env = NULL;1808 1792 1809 1793 ctx = talloc_zero(mem_ctx, struct libnet_JoinCtx); … … 1817 1801 W_ERROR_HAVE_NO_MEMORY(ctx->in.machine_name); 1818 1802 1819 krb5_cc_env = getenv(KRB5_ENV_CCNAME);1820 if (!krb5_cc_env || (strlen(krb5_cc_env) == 0)) {1821 krb5_cc_env = talloc_strdup(mem_ctx, "MEMORY:libnetjoin");1822 W_ERROR_HAVE_NO_MEMORY(krb5_cc_env);1823 setenv(KRB5_ENV_CCNAME, krb5_cc_env, 1);1824 }1825 1826 1803 ctx->in.secure_channel_type = SEC_CHAN_WKSTA; 1827 1804 … … 1838 1815 { 1839 1816 struct libnet_UnjoinCtx *ctx; 1840 const char *krb5_cc_env = NULL;1841 1817 1842 1818 ctx = talloc_zero(mem_ctx, struct libnet_UnjoinCtx); … … 1849 1825 ctx->in.machine_name = talloc_strdup(mem_ctx, global_myname()); 1850 1826 W_ERROR_HAVE_NO_MEMORY(ctx->in.machine_name); 1851 1852 krb5_cc_env = getenv(KRB5_ENV_CCNAME);1853 if (!krb5_cc_env || (strlen(krb5_cc_env) == 0)) {1854 krb5_cc_env = talloc_strdup(mem_ctx, "MEMORY:libnetjoin");1855 W_ERROR_HAVE_NO_MEMORY(krb5_cc_env);1856 setenv(KRB5_ENV_CCNAME, krb5_cc_env, 1);1857 }1858 1827 1859 1828 *r = ctx;
Note:
See TracChangeset
for help on using the changeset viewer.