[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Tue May 10 15:13:02 MDT 2011
The branch, master has been updated
via 05e8881 s3:librpc: remove unneded gssapi includes from source3/librpc/crypto/gse.c
via 75f289d libcli/auth: fix "no talloc stackframe around" message from the samba4.blackbox.kinit test
via 0791da4 lib/replace: fix an #if HAVE_GSSAPI_GSSAPI_EXT_H to be an #ifdef
via 419e03a libsmbconf: Define a doxygen group for libsmbconf.
via 60109a0 libsmbconf: Document smbconf_transaction_cancel().
via 9bbf4bd libsmbconf: Document smbconf_transaction_commit().
via 6babdaf libsmbconf: Document smbconf_transaction_start().
via d9407a5 libsmbconf: Document smbconf_delete_global_includes().
via 3ace171 libsmbconf: Document smbconf_delete_includes().
via a606d52 libsmbconf: Document smbconf_set_global_includes().
via 0ab8a8e libsmbconf: Document smbconf_set_includes().
via a7ac2a8 libsmbconf: Document smbconf_get_global_includes().
via 74dc8c3 libsmbconf: Document smbconf_get_includes().
via b7ba46d libsmbconf: Document smbconf_delete_global_parameter().
via d70acdc libsmbconf: Document smbconf_delete_parameter().
via 1cb649f libsmbconf: Document smbconf_get_global_parameter().
via 8417e34 libsmbconf: Document smbconf_get_parameter().
via 70c5143 libsmbconf: Document smbconf_set_global_parameter().
via 62f3560 libsmbconf: Document smbconf_set_parameter().
via 7e04bd1 libsmbconf: Document smbconf_delete_share().
via 4748057 libsmbconf: Document smbconf_get_share().
via 529e064 libsmbconf: Document smbconf_create_share().
via 44fa842 libsmbconf: Document smbconf_share_exists().
via 2112860 libsmbconf: Document smbconf_get_share_names().
via 87c4096 libsmbconf: Document smbconf_get_config().
via 938690c libsmbconf: Document smbconf_drop().
via 1b0809b libsmbconf: Document smbconf_changed().
via 5cd229c libsmbconf: Document smbconf_shutdown().
via 25e798e libsmbconf: Document smbconf_is_writeable().
via 7a57ccd libsmbconf: Document smbconf_backend_requires_messaging().
via c31fd2b s3-waf: Create a public libsmconf.
via 6d9f330 s3-waf: Create a registry private library.
via 4d391d2 libsmbconf: Convert smbconf_get_config() to sbcErr.
via e1f0b91 libsmbconf: Convert smbconf_transaction_*() to sbcErr.
via 72d15f0 libsmbconf: Convert smbconf_delete_includes() to sbcErr.
via d911baf libsmbconf: Convert smbconf_set_includes() to sbcErr.
via 9f97114 libsmbconf: Convert smbconf_get_includes() to sbcErr.
via e19c4f2 libsmbconf: Convert smbconf_delete_parameter() to sbcErr.
via ff5838d libsmbconf: Convert smbconf_get_parameter() to sbcErr.
via ddc28a6 libsmbconf: Convert smbconf_set_parameter() to sbcErr.
via fbd7626 libsmbconf: Convert smbconf_delete_share() to sbcErr.
via 7f355e0 libsmbconf: Convert smbconf_get_share() to sbcErr.
via 7af2876 libsmbconf: Convert smbconf_create_share() to smbErr.
via 823cd47 libsmbconf: Convert smbconf_get_share_names() to sbcErr.
via 720ba8e libsmbconf: Convert smbconf_drop() to sbcErr.
via 9082c7c libsmbconf: Convert smbconf_open() to sbcErr.
via 29eea4b libsmbconf: Convert smbconf_init() to sbcErr.
via b34e176 libsmbconf: Added a sbcErrorString() function.
via 2a1a6a9 libsmbconf: Introduce a sbcErrType.
from fbb19e0 Fix alpha version - we're now working on alpha16.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 05e8881fef02e309a6dfbaee544f11c3d5088278
Author: Michael Adam <obnox at samba.org>
Date: Tue May 10 22:02:49 2011 +0200
s3:librpc: remove unneded gssapi includes from source3/librpc/crypto/gse.c
These come in via the smb_krb5.h include (and lib/replace/system/kerberos.h)
in the end.
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
Autobuild-User: Michael Adam <obnox at samba.org>
Autobuild-Date: Tue May 10 23:12:31 CEST 2011 on sn-devel-104
commit 75f289d30eea3005a7256ef9f5cab0e1e11b570b
Author: Michael Adam <obnox at samba.org>
Date: Tue May 10 21:59:38 2011 +0200
libcli/auth: fix "no talloc stackframe around" message from the samba4.blackbox.kinit test
create_kerberos_key_from_string_direct() used talloc_tos() directly.
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
commit 0791da4fdd75bca6cb4fae670fac4fc5527ab079
Author: Michael Adam <obnox at samba.org>
Date: Tue May 10 20:54:06 2011 +0200
lib/replace: fix an #if HAVE_GSSAPI_GSSAPI_EXT_H to be an #ifdef
commit 419e03ab18696984303abfb44f05e58c14ba25ae
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:59:57 2011 +0200
libsmbconf: Define a doxygen group for libsmbconf.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 60109a0e6d30ea3bd33de03ac3c958ded7aeee89
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:54:11 2011 +0200
libsmbconf: Document smbconf_transaction_cancel().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 9bbf4bd0f32bd950d94460f751052480d09e711a
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:53:25 2011 +0200
libsmbconf: Document smbconf_transaction_commit().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 6babdaf6b742760fc1db9c0c9fcf92e92a9aafdc
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:52:30 2011 +0200
libsmbconf: Document smbconf_transaction_start().
Signed-off-by: Michael Adam <obnox at samba.org>
commit d9407a5a558ce8eb229070cec980a3ef7a02584f
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:50:05 2011 +0200
libsmbconf: Document smbconf_delete_global_includes().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 3ace1716a0e166642ca511efe5e4ff27214aee62
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:49:24 2011 +0200
libsmbconf: Document smbconf_delete_includes().
Signed-off-by: Michael Adam <obnox at samba.org>
commit a606d5219eab7a063758dea80359ce3cbc7a60f0
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:48:15 2011 +0200
libsmbconf: Document smbconf_set_global_includes().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 0ab8a8e5bace6a796ea1a8b5b8f30275f1ea27eb
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:47:41 2011 +0200
libsmbconf: Document smbconf_set_includes().
Signed-off-by: Michael Adam <obnox at samba.org>
commit a7ac2a87c600e5da4d828667998f5d856800e262
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:45:14 2011 +0200
libsmbconf: Document smbconf_get_global_includes().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 74dc8c351c33a3b73251985ffa3b19ec024bcfc9
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:44:22 2011 +0200
libsmbconf: Document smbconf_get_includes().
Signed-off-by: Michael Adam <obnox at samba.org>
commit b7ba46d1c0e1fdd5b68dd0478d38a633938aae84
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:38:31 2011 +0200
libsmbconf: Document smbconf_delete_global_parameter().
Signed-off-by: Michael Adam <obnox at samba.org>
commit d70acdc554d6bbab367d7e0ebb0a255f528b94ed
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:37:59 2011 +0200
libsmbconf: Document smbconf_delete_parameter().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 1cb649f57f2a53b2e0067c1a9dd26dca8fdaf850
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:36:36 2011 +0200
libsmbconf: Document smbconf_get_global_parameter().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 8417e3485ed35538133ce01d1870456941270db1
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:35:11 2011 +0200
libsmbconf: Document smbconf_get_parameter().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 70c5143ea49f9abe3a71947664ff488932eb8f58
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:32:06 2011 +0200
libsmbconf: Document smbconf_set_global_parameter().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 62f3560e988a04db5b8baf40aba47735204ab05e
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:31:17 2011 +0200
libsmbconf: Document smbconf_set_parameter().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 7e04bd1f857d9a14b38795dbeba8e23f1326c229
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:28:00 2011 +0200
libsmbconf: Document smbconf_delete_share().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 474805794e5758dc1dd77a8c7a667531c31eb011
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:27:03 2011 +0200
libsmbconf: Document smbconf_get_share().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 529e0645860cf43f8a507c87fa7c581c29fa5987
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:25:07 2011 +0200
libsmbconf: Document smbconf_create_share().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 44fa842ae92ffd9a694b47339b8d19041c874117
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:23:56 2011 +0200
libsmbconf: Document smbconf_share_exists().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 211286042d4679b85ad1977af3ae8dd0245b4b43
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:22:25 2011 +0200
libsmbconf: Document smbconf_get_share_names().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 87c40960922cafe0e5fe6f027d878eefebe82c03
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:19:36 2011 +0200
libsmbconf: Document smbconf_get_config().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 938690c77135b5a909d48654d10955bc037a0b38
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:13:49 2011 +0200
libsmbconf: Document smbconf_drop().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 1b0809bd7340b9b596dc3f5be159d79726fe98c6
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:12:27 2011 +0200
libsmbconf: Document smbconf_changed().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 5cd229ca5e7c2c227c565b53ad3e23ebde51d3b1
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:05:09 2011 +0200
libsmbconf: Document smbconf_shutdown().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 25e798e641b2e7acb7ba3794e838fe807e6c0d22
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:04:15 2011 +0200
libsmbconf: Document smbconf_is_writeable().
Signed-off-by: Michael Adam <obnox at samba.org>
commit 7a57ccd2c5d64680bf6386d8fa0c1443819a6f42
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 14 11:02:49 2011 +0200
libsmbconf: Document smbconf_backend_requires_messaging().
Signed-off-by: Michael Adam <obnox at samba.org>
commit c31fd2b22aa42feb8557353a8d1bd2697f4a8eee
Author: Andreas Schneider <asn at samba.org>
Date: Tue Apr 12 11:02:07 2011 +0200
s3-waf: Create a public libsmconf.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 6d9f33064152b62de801fbc719d99dae73fb7b91
Author: Andreas Schneider <asn at samba.org>
Date: Tue Apr 12 10:59:20 2011 +0200
s3-waf: Create a registry private library.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 4d391d29f87cfe88e1d3aa96f193c486beb5a1f1
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 17:43:10 2011 +0200
libsmbconf: Convert smbconf_get_config() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit e1f0b91c5fd6b11e258464994868be8020c89e89
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 17:24:13 2011 +0200
libsmbconf: Convert smbconf_transaction_*() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 72d15f0c03cd67d32feb51f41238401b38344907
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 16:01:22 2011 +0200
libsmbconf: Convert smbconf_delete_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit d911bafea695dc36d7952bd265dfe15a3e04ac7b
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 15:14:52 2011 +0200
libsmbconf: Convert smbconf_set_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 9f9711490ae743493722c997e316a31600ef02d6
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 14:52:52 2011 +0200
libsmbconf: Convert smbconf_get_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit e19c4f278b5467327df7a90256802382c7999414
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 14:20:32 2011 +0200
libsmbconf: Convert smbconf_delete_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit ff5838d97aad5b283073726052456b06ecf410b2
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 13:50:53 2011 +0200
libsmbconf: Convert smbconf_get_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit ddc28a683fcf036a279a0d3d7b23504364316fa6
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 13:23:26 2011 +0200
libsmbconf: Convert smbconf_set_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit fbd7626656d8d76f371e431005fbfa1228ba2029
Author: Andreas Schneider <asn at samba.org>
Date: Mon Apr 11 11:39:03 2011 +0200
libsmbconf: Convert smbconf_delete_share() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 7f355e05f9ca41f9ba2bc7c9f14046a283ebd1d1
Author: Andreas Schneider <asn at samba.org>
Date: Fri Apr 8 17:20:35 2011 +0200
libsmbconf: Convert smbconf_get_share() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 7af2876e4526d348a1e601f2d14776e08d4668cb
Author: Andreas Schneider <asn at samba.org>
Date: Fri Apr 8 15:48:01 2011 +0200
libsmbconf: Convert smbconf_create_share() to smbErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 823cd472b42c276a48bd368655f28dfa9ae7d430
Author: Andreas Schneider <asn at samba.org>
Date: Fri Apr 8 14:19:15 2011 +0200
libsmbconf: Convert smbconf_get_share_names() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 720ba8e7e7463669bb4fc9d5a91387bafc9aec0f
Author: Andreas Schneider <asn at samba.org>
Date: Fri Apr 8 10:40:02 2011 +0200
libsmbconf: Convert smbconf_drop() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 9082c7cee8805281d18bd9f2f0afed4260ee95a8
Author: Andreas Schneider <asn at samba.org>
Date: Fri Apr 8 10:28:17 2011 +0200
libsmbconf: Convert smbconf_open() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 29eea4b09ad2e99504f42a3c29195fb4757792dd
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 7 17:19:03 2011 +0200
libsmbconf: Convert smbconf_init() to sbcErr.
Signed-off-by: Michael Adam <obnox at samba.org>
commit b34e1768b762ae46e4fe761d9691ed09d285c9a9
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 7 15:27:52 2011 +0200
libsmbconf: Added a sbcErrorString() function.
Signed-off-by: Michael Adam <obnox at samba.org>
commit 2a1a6a9e637cec58d976a2b353fee6b026599f37
Author: Andreas Schneider <asn at samba.org>
Date: Thu Apr 7 15:27:26 2011 +0200
libsmbconf: Introduce a sbcErrType.
Signed-off-by: Michael Adam <obnox at samba.org>
-----------------------------------------------------------------------
Summary of changes:
lib/replace/system/kerberos.h | 2 +-
lib/smbconf/smbconf.c | 186 ++++++++++------
lib/smbconf/smbconf.h | 438 +++++++++++++++++++++++++++++++++---
lib/smbconf/smbconf_private.h | 36 ++--
lib/smbconf/smbconf_txt.c | 205 +++++++++---------
lib/smbconf/smbconf_txt.h | 2 +-
lib/smbconf/smbconf_util.c | 26 +-
libcli/auth/krb5_wrap.c | 6 +-
source3/lib/netapi/serverinfo.c | 18 ++-
source3/lib/smbconf/smbconf_init.c | 20 +-
source3/lib/smbconf/smbconf_init.h | 2 +-
source3/lib/smbconf/smbconf_reg.c | 397 +++++++++++++++++++-------------
source3/lib/smbconf/smbconf_reg.h | 2 +-
source3/lib/smbconf/testsuite.c | 70 +++---
source3/libnet/libnet_join.c | 73 +++++--
source3/librpc/crypto/gse.c | 6 -
source3/param/loadparm.c | 20 +-
source3/utils/net_conf.c | 285 ++++++++++++------------
source3/wscript_build | 28 ++-
19 files changed, 1184 insertions(+), 638 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/replace/system/kerberos.h b/lib/replace/system/kerberos.h
index ec3eff1..7762d4b 100644
--- a/lib/replace/system/kerberos.h
+++ b/lib/replace/system/kerberos.h
@@ -37,7 +37,7 @@
#include <com_err.h>
#endif
-#if HAVE_GSSAPI_GSSAPI_EXT_H
+#ifdef HAVE_GSSAPI_GSSAPI_EXT_H
#include <gssapi/gssapi_ext.h>
#elif HAVE_GSSAPI_GSSAPI_H
#include <gssapi/gssapi.h>
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c
index 80fe9aa..e0441ed 100644
--- a/lib/smbconf/smbconf.c
+++ b/lib/smbconf/smbconf.c
@@ -27,12 +27,13 @@
*
**********************************************************************/
-static WERROR smbconf_global_check(struct smbconf_ctx *ctx)
+static sbcErr smbconf_global_check(struct smbconf_ctx *ctx)
{
if (!smbconf_share_exists(ctx, GLOBAL_NAME)) {
return smbconf_create_share(ctx, GLOBAL_NAME);
}
- return WERR_OK;
+
+ return SBC_ERR_OK;
}
@@ -42,6 +43,41 @@ static WERROR smbconf_global_check(struct smbconf_ctx *ctx)
*
**********************************************************************/
+const char *sbcErrorString(sbcErr error)
+{
+ switch (error) {
+ case SBC_ERR_OK:
+ return "SBC_ERR_OK";
+ case SBC_ERR_NOT_IMPLEMENTED:
+ return "SBC_ERR_NOT_IMPLEMENTED";
+ case SBC_ERR_NOT_SUPPORTED:
+ return "SBC_ERR_NOT_SUPPORTED";
+ case SBC_ERR_UNKNOWN_FAILURE:
+ return "SBC_ERR_UNKNOWN_FAILURE";
+ case SBC_ERR_NOMEM:
+ return "SBC_ERR_NOMEM";
+ case SBC_ERR_INVALID_PARAM:
+ return "SBC_ERR_INVALID_PARAM";
+ case SBC_ERR_BADFILE:
+ return "SBC_ERR_BADFILE";
+ case SBC_ERR_NO_SUCH_SERVICE:
+ return "SBC_ERR_NO_SUCH_SERVICE";
+ case SBC_ERR_IO_FAILURE:
+ return "SBC_ERR_IO_FAILURE";
+ case SBC_ERR_CAN_NOT_COMPLETE:
+ return "SBC_ERR_CAN_NOT_COMPLETE";
+ case SBC_ERR_NO_MORE_ITEMS:
+ return "SBC_ERR_NO_MORE_ITEMS";
+ case SBC_ERR_FILE_EXISTS:
+ return "SBC_ERR_FILE_EXISTS";
+ case SBC_ERR_ACCESS_DENIED:
+ return "SBC_ERR_ACCESS_DENIED";
+ }
+
+ return "unknown sbcErr value";
+}
+
+
/**
* Tell whether the backend requires messaging to be set up
* for the backend to work correctly.
@@ -91,7 +127,7 @@ bool smbconf_changed(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
/**
* Drop the whole configuration (restarting empty).
*/
-WERROR smbconf_drop(struct smbconf_ctx *ctx)
+sbcErr smbconf_drop(struct smbconf_ctx *ctx)
{
return ctx->ops->drop(ctx);
}
@@ -105,12 +141,12 @@ WERROR smbconf_drop(struct smbconf_ctx *ctx)
* param_names : list of lists of parameter names for each share
* param_values : list of lists of parameter values for each share
*/
-WERROR smbconf_get_config(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_config(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
uint32_t *num_shares,
struct smbconf_service ***services)
{
- WERROR werr = WERR_OK;
+ sbcErr err;
TALLOC_CTX *tmp_ctx = NULL;
uint32_t tmp_num_shares;
char **tmp_share_names;
@@ -118,36 +154,35 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx,
uint32_t count;
if ((num_shares == NULL) || (services == NULL)) {
- werr = WERR_INVALID_PARAM;
+ err = SBC_ERR_INVALID_PARAM;
goto done;
}
tmp_ctx = talloc_stackframe();
- werr = smbconf_get_share_names(ctx, tmp_ctx, &tmp_num_shares,
- &tmp_share_names);
- if (!W_ERROR_IS_OK(werr)) {
+ err = smbconf_get_share_names(ctx, tmp_ctx, &tmp_num_shares,
+ &tmp_share_names);
+ if (!SBC_ERROR_IS_OK(err)) {
goto done;
}
tmp_services = talloc_array(tmp_ctx, struct smbconf_service *,
tmp_num_shares);
-
if (tmp_services == NULL) {
- werr = WERR_NOMEM;
+ err = SBC_ERR_NOMEM;
goto done;
}
for (count = 0; count < tmp_num_shares; count++) {
- werr = smbconf_get_share(ctx, tmp_services,
- tmp_share_names[count],
- &tmp_services[count]);
- if (!W_ERROR_IS_OK(werr)) {
+ err = smbconf_get_share(ctx, tmp_services,
+ tmp_share_names[count],
+ &tmp_services[count]);
+ if (!SBC_ERROR_IS_OK(err)) {
goto done;
}
}
- werr = WERR_OK;
+ err = SBC_ERR_OK;
*num_shares = tmp_num_shares;
if (tmp_num_shares > 0) {
@@ -158,13 +193,13 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx,
done:
talloc_free(tmp_ctx);
- return werr;
+ return err;
}
/**
* get the list of share names defined in the configuration.
*/
-WERROR smbconf_get_share_names(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_share_names(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
uint32_t *num_shares,
char ***share_names)
@@ -185,11 +220,11 @@ bool smbconf_share_exists(struct smbconf_ctx *ctx,
/**
* Add a service if it does not already exist.
*/
-WERROR smbconf_create_share(struct smbconf_ctx *ctx,
+sbcErr smbconf_create_share(struct smbconf_ctx *ctx,
const char *servicename)
{
if ((servicename != NULL) && smbconf_share_exists(ctx, servicename)) {
- return WERR_FILE_EXISTS;
+ return SBC_ERR_FILE_EXISTS;
}
return ctx->ops->create_share(ctx, servicename);
@@ -198,7 +233,7 @@ WERROR smbconf_create_share(struct smbconf_ctx *ctx,
/**
* get a definition of a share (service) from configuration.
*/
-WERROR smbconf_get_share(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_share(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *servicename,
struct smbconf_service **service)
@@ -209,10 +244,10 @@ WERROR smbconf_get_share(struct smbconf_ctx *ctx,
/**
* delete a service from configuration
*/
-WERROR smbconf_delete_share(struct smbconf_ctx *ctx, const char *servicename)
+sbcErr smbconf_delete_share(struct smbconf_ctx *ctx, const char *servicename)
{
if (!smbconf_share_exists(ctx, servicename)) {
- return WERR_NO_SUCH_SERVICE;
+ return SBC_ERR_NO_SUCH_SERVICE;
}
return ctx->ops->delete_share(ctx, servicename);
@@ -221,7 +256,7 @@ WERROR smbconf_delete_share(struct smbconf_ctx *ctx, const char *servicename)
/**
* set a configuration parameter to the value provided.
*/
-WERROR smbconf_set_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_set_parameter(struct smbconf_ctx *ctx,
const char *service,
const char *param,
const char *valstr)
@@ -235,30 +270,31 @@ WERROR smbconf_set_parameter(struct smbconf_ctx *ctx,
*
* This also creates [global] when it does not exist.
*/
-WERROR smbconf_set_global_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_set_global_parameter(struct smbconf_ctx *ctx,
const char *param, const char *val)
{
- WERROR werr;
+ sbcErr err;
- werr = smbconf_global_check(ctx);
- if (W_ERROR_IS_OK(werr)) {
- werr = smbconf_set_parameter(ctx, GLOBAL_NAME, param, val);
+ err = smbconf_global_check(ctx);
+ if (!SBC_ERROR_IS_OK(err)) {
+ return err;
}
+ err = smbconf_set_parameter(ctx, GLOBAL_NAME, param, val);
- return werr;
+ return err;
}
/**
* get the value of a configuration parameter as a string
*/
-WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_parameter(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *service,
const char *param,
char **valstr)
{
if (valstr == NULL) {
- return WERR_INVALID_PARAM;
+ return SBC_ERR_INVALID_PARAM;
}
return ctx->ops->get_parameter(ctx, mem_ctx, service, param, valstr);
@@ -269,26 +305,28 @@ WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
*
* Create [global] if it does not exist.
*/
-WERROR smbconf_get_global_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_global_parameter(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *param,
char **valstr)
{
- WERROR werr;
+ sbcErr err;
- werr = smbconf_global_check(ctx);
- if (W_ERROR_IS_OK(werr)) {
- werr = smbconf_get_parameter(ctx, mem_ctx, GLOBAL_NAME, param,
- valstr);
+ err = smbconf_global_check(ctx);
+ if (!SBC_ERROR_IS_OK(err)) {
+ return err;
}
- return werr;
+ err = smbconf_get_parameter(ctx, mem_ctx, GLOBAL_NAME, param,
+ valstr);
+
+ return err;
}
/**
* delete a parameter from configuration
*/
-WERROR smbconf_delete_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_delete_parameter(struct smbconf_ctx *ctx,
const char *service, const char *param)
{
return ctx->ops->delete_parameter(ctx, service, param);
@@ -299,20 +337,21 @@ WERROR smbconf_delete_parameter(struct smbconf_ctx *ctx,
*
* Create [global] if it does not exist.
*/
-WERROR smbconf_delete_global_parameter(struct smbconf_ctx *ctx,
+sbcErr smbconf_delete_global_parameter(struct smbconf_ctx *ctx,
const char *param)
{
- WERROR werr;
+ sbcErr err;
- werr = smbconf_global_check(ctx);
- if (W_ERROR_IS_OK(werr)) {
- werr = smbconf_delete_parameter(ctx, GLOBAL_NAME, param);
+ err = smbconf_global_check(ctx);
+ if (!SBC_ERROR_IS_OK(err)) {
+ return err;
}
+ err = smbconf_delete_parameter(ctx, GLOBAL_NAME, param);
- return werr;
+ return err;
}
-WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_includes(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
const char *service,
uint32_t *num_includes, char ***includes)
@@ -321,72 +360,75 @@ WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
includes);
}
-WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx,
+sbcErr smbconf_get_global_includes(struct smbconf_ctx *ctx,
TALLOC_CTX *mem_ctx,
uint32_t *num_includes, char ***includes)
{
- WERROR werr;
+ sbcErr err;
- werr = smbconf_global_check(ctx);
- if (W_ERROR_IS_OK(werr)) {
- werr = smbconf_get_includes(ctx, mem_ctx, GLOBAL_NAME,
- num_includes, includes);
+ err = smbconf_global_check(ctx);
+ if (!SBC_ERROR_IS_OK(err)) {
+ return err;
}
+ err = smbconf_get_includes(ctx, mem_ctx, GLOBAL_NAME,
+ num_includes, includes);
- return werr;
+ return err;
}
-WERROR smbconf_set_includes(struct smbconf_ctx *ctx,
+sbcErr smbconf_set_includes(struct smbconf_ctx *ctx,
const char *service,
uint32_t num_includes, const char **includes)
{
return ctx->ops->set_includes(ctx, service, num_includes, includes);
}
-WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
+sbcErr smbconf_set_global_includes(struct smbconf_ctx *ctx,
uint32_t num_includes,
const char **includes)
{
- WERROR werr;
+ sbcErr err;
- werr = smbconf_global_check(ctx);
- if (W_ERROR_IS_OK(werr)) {
- werr = smbconf_set_includes(ctx, GLOBAL_NAME,
- num_includes, includes);
+ err = smbconf_global_check(ctx);
+ if (!SBC_ERROR_IS_OK(err)) {
+ return err;
}
+ err = smbconf_set_includes(ctx, GLOBAL_NAME,
+ num_includes, includes);
- return werr;
+ return err;
}
-WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service)
+sbcErr smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service)
{
return ctx->ops->delete_includes(ctx, service);
}
-WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx)
+sbcErr smbconf_delete_global_includes(struct smbconf_ctx *ctx)
{
- WERROR werr;
+ sbcErr err;
- werr = smbconf_global_check(ctx);
- if (W_ERROR_IS_OK(werr)) {
- werr = smbconf_delete_includes(ctx, GLOBAL_NAME);
+ err = smbconf_global_check(ctx);
+ if (!SBC_ERROR_IS_OK(err)) {
+ return err;
}
+ err = smbconf_delete_includes(ctx, GLOBAL_NAME);
- return werr;
+ return err;
}
-WERROR smbconf_transaction_start(struct smbconf_ctx *ctx)
+sbcErr smbconf_transaction_start(struct smbconf_ctx *ctx)
{
return ctx->ops->transaction_start(ctx);
}
-WERROR smbconf_transaction_commit(struct smbconf_ctx *ctx)
+sbcErr smbconf_transaction_commit(struct smbconf_ctx *ctx)
{
return ctx->ops->transaction_commit(ctx);
}
-WERROR smbconf_transaction_cancel(struct smbconf_ctx *ctx)
+sbcErr smbconf_transaction_cancel(struct smbconf_ctx *ctx)
{
return ctx->ops->transaction_cancel(ctx);
}
diff --git a/lib/smbconf/smbconf.h b/lib/smbconf/smbconf.h
index 517302a..7f62b06 100644
--- a/lib/smbconf/smbconf.h
+++ b/lib/smbconf/smbconf.h
@@ -20,6 +20,39 @@
#ifndef __LIBSMBCONF_H__
#define __LIBSMBCONF_H__
+/**
+ * @defgroup libsmbconf The smbconf API
+ *
+ * libsmbconf is a library to read or, based on the backend, modify the Samba
+ * configuration.
+ *
+ * @{
+ */
+
+/**
+ * @brief Status codes returned from smbconf functions
+ */
+enum _sbcErrType {
+ SBC_ERR_OK = 0, /**< Successful completion **/
+ SBC_ERR_NOT_IMPLEMENTED, /**< Function not implemented **/
+ SBC_ERR_NOT_SUPPORTED, /**< Function not supported **/
+ SBC_ERR_UNKNOWN_FAILURE, /**< General failure **/
+ SBC_ERR_NOMEM, /**< Memory allocation error **/
+ SBC_ERR_INVALID_PARAM, /**< An Invalid parameter was supplied **/
+ SBC_ERR_BADFILE, /**< A bad file was supplied **/
+ SBC_ERR_NO_SUCH_SERVICE, /**< There is no such service provided **/
+ SBC_ERR_IO_FAILURE, /**< There was an IO error **/
+ SBC_ERR_CAN_NOT_COMPLETE,/**< Can not complete action **/
+ SBC_ERR_NO_MORE_ITEMS, /**< No more items left **/
+ SBC_ERR_FILE_EXISTS, /**< File already exists **/
+ SBC_ERR_ACCESS_DENIED, /**< Access has been denied **/
+};
+
+typedef enum _sbcErrType sbcErr;
+
+#define SBC_ERROR_IS_OK(x) ((x) == SBC_ERR_OK)
+#define SBC_ERROR_EQUAL(x,y) ((x) == (y))
+
struct smbconf_ctx;
/* the change sequence number */
@@ -27,75 +60,428 @@ struct smbconf_csn {
uint64_t csn;
};
+/** Information about a service */
struct smbconf_service {
- char *name;
- uint32_t num_params;
- char **param_names;
- char **param_values;
+ char *name; /**< The name of the share */
+ uint32_t num_params; /**< List of length num_shares of parameter counts for each share */
+ char **param_names; /**< List of lists of parameter names for each share */
+ char **param_values; /**< List of lists of parameter values for each share */
};
/*
- * the smbconf API functions
+ * The smbconf API functions
+ */
+
+/**
+ * @brief Translate an error value into a string
+ *
+ * @param error
+ *
+ * @return a pointer to a static string
+ **/
+const char *sbcErrorString(sbcErr error);
+
+/**
+ * @brief Check if the backend requires messaging to be set up.
+ *
+ * Tell whether the backend requires messaging to be set up
+ * for the backend to work correctly.
+ *
+ * @param[in] ctx The smbconf context to check.
+ *
+ * @return True if needed, false if not.
*/
bool smbconf_backend_requires_messaging(struct smbconf_ctx *ctx);
+
--
Samba Shared Repository
More information about the samba-cvs
mailing list