[SCM] Samba Shared Repository - branch v3-2-test updated -
release-3-2-0pre2-884-g15bef5a
Günther Deschner
gd at samba.org
Sun Apr 13 17:28:00 GMT 2008
The branch, v3-2-test has been updated
via 15bef5ae413adf278cccc0e547c4b8ccd180eca2 (commit)
via 3c107934acc907e3eedd116b42d1d07ee0574183 (commit)
from 5f9332cf1f60bb5a23a16776b95af3a83c5deb40 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 15bef5ae413adf278cccc0e547c4b8ccd180eca2
Author: Günther Deschner <gd at samba.org>
Date: Sun Apr 13 19:22:24 2008 +0200
libnetapi: add libnetapi_set_use_kerberos
Don't unconditionally set the kerberos flag for authentication.
Guenther
commit 3c107934acc907e3eedd116b42d1d07ee0574183
Author: Günther Deschner <gd at samba.org>
Date: Sun Apr 13 19:23:42 2008 +0200
libnetapi: Add NetQueryDisplayInformation header.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/lib/netapi/cm.c | 8 ++++++--
source/lib/netapi/examples/common.c | 4 ++++
source/lib/netapi/netapi.c | 9 +++++++++
source/lib/netapi/netapi.h | 14 ++++++++++++++
4 files changed, 33 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/lib/netapi/cm.c b/source/lib/netapi/cm.c
index 9608724..071ebfd 100644
--- a/source/lib/netapi/cm.c
+++ b/source/lib/netapi/cm.c
@@ -36,7 +36,10 @@ WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
}
cli_cm_set_signing_state(Undefined);
- cli_cm_set_use_kerberos();
+
+ if (ctx->use_kerberos) {
+ cli_cm_set_use_kerberos();
+ }
if (ctx->password) {
cli_cm_set_password(ctx->password);
@@ -46,7 +49,8 @@ WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
}
if (ctx->username && ctx->username[0] &&
- ctx->password && ctx->password[0]) {
+ ctx->password && ctx->password[0] &&
+ ctx->use_kerberos) {
cli_cm_set_fallback_after_kerberos();
}
diff --git a/source/lib/netapi/examples/common.c b/source/lib/netapi/examples/common.c
index 2c3e4d7..74e2861 100644
--- a/source/lib/netapi/examples/common.c
+++ b/source/lib/netapi/examples/common.c
@@ -48,6 +48,9 @@ void popt_common_callback(poptContext con,
case 'p':
libnetapi_set_password(ctx, arg);
break;
+ case 'k':
+ libnetapi_set_use_kerberos(ctx);
+ break;
}
}
@@ -56,6 +59,7 @@ struct poptOption popt_common_netapi_examples[] = {
{ "user", 'U', POPT_ARG_STRING, NULL, 'U', "Username used for connection", "USERNAME" },
{ "password", 'p', POPT_ARG_STRING, NULL, 'p', "Password used for connection", "PASSWORD" },
{ "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Debuglevel", "DEBUGLEVEL" },
+ { "kerberos", 'k', POPT_ARG_NONE, NULL, 'k', "Use Kerberos", NULL },
POPT_TABLEEND
};
diff --git a/source/lib/netapi/netapi.c b/source/lib/netapi/netapi.c
index f15e5bf..9e30963 100644
--- a/source/lib/netapi/netapi.c
+++ b/source/lib/netapi/netapi.c
@@ -211,6 +211,15 @@ NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx,
/****************************************************************
****************************************************************/
+NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx)
+{
+ ctx->use_kerberos = true;
+ return NET_API_STATUS_SUCCESS;
+}
+
+/****************************************************************
+****************************************************************/
+
const char *libnetapi_errstr(NET_API_STATUS status)
{
if (status & 0xc0000000) {
diff --git a/source/lib/netapi/netapi.h b/source/lib/netapi/netapi.h
index 7b03e41..0d21067 100644
--- a/source/lib/netapi/netapi.h
+++ b/source/lib/netapi/netapi.h
@@ -89,6 +89,7 @@ struct libnetapi_ctx {
char *workgroup;
char *password;
char *krb5_cc_env;
+ int use_kerberos;
};
/****************************************************************
@@ -133,6 +134,11 @@ NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx,
/****************************************************************
****************************************************************/
+NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx);
+
+/****************************************************************
+****************************************************************/
+
const char *libnetapi_errstr(NET_API_STATUS status);
/****************************************************************
@@ -261,4 +267,12 @@ NET_API_STATUS NetUserEnum(const char * server_name /* [in] */,
uint32_t *total_entries /* [out] [ref] */,
uint32_t *resume_handle /* [in,out] [ref] */);
+NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
+ uint32_t level /* [in] */,
+ uint32_t idx /* [in] */,
+ uint32_t entries_requested /* [in] */,
+ uint32_t prefmaxlen /* [in] */,
+ uint32_t *entries_read /* [out] [ref] */,
+ void **buffer /* [out] [noprint,ref] */);
+
#endif
--
Samba Shared Repository
More information about the samba-cvs
mailing list