[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Fri Mar 26 04:07:01 UTC 2021
The branch, master has been updated
via 5bc1463a5c6 build: Consolidate --with-dnsupdate with --with-ads (which implied HAVE_KRB5)
via ef8623c1d65 build: Consolidate --with-ntvfs-fileserver into --enable-selftest when building the AD DC
via 7415f712dbe smb.conf: Remove "share backend" option
via 505da46b1fe s3: smbd: Raise debug level when synthetic_pathref() can't find the file.
from 313ef6a82a3 rpc_client: cli_winreg_spoolss.h references spoolss structs
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 5bc1463a5c6e793ed78a77d9e513d94006dfce20
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Mar 25 10:48:28 2021 +1300
build: Consolidate --with-dnsupdate with --with-ads (which implied HAVE_KRB5)
Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Mar 26 04:06:41 UTC 2021 on sn-devel-184
commit ef8623c1d65e9e472ebd1d9bcf701acf3c2df755
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Mar 25 10:46:49 2021 +1300
build: Consolidate --with-ntvfs-fileserver into --enable-selftest when building the AD DC
This removes from our configure help a feature which we retain only
to support our selftest system.
Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 7415f712dbed5e409d1557e281b5001764abbf0e
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Mar 25 11:50:14 2021 +1300
smb.conf: Remove "share backend" option
This is a confusing hold-over from the NTVFS fileserver that never became part of
the merged architecture.
Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 505da46b1fe966667bc237d4f54594d0e15cc853
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Mar 25 15:03:32 2021 -0700
s3: smbd: Raise debug level when synthetic_pathref() can't find the file.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
docs-xml/smbdotconf/base/sharebackend.xml | 18 -
lib/addns/dnsutils.c | 2 +-
lib/param/loadparm.c | 2 -
source3/param/loadparm.c | 2 -
source3/smbd/files.c | 8 +-
source3/utils/net_ads.c | 8 +-
source3/utils/net_dns.c | 4 +-
source3/utils/net_dns.h | 4 +-
source3/wscript | 6 -
source4/ntvfs/ipc/rap_server.c | 2 +-
source4/param/share.c | 13 +-
source4/param/share.h | 9 +-
source4/param/share_classic.c | 1 -
source4/param/share_ldb.c | 606 ------------------------------
source4/param/tests/share.c | 11 +-
source4/param/wscript_build | 10 +-
source4/rpc_server/srvsvc/dcesrv_srvsvc.c | 16 +-
source4/rpc_server/srvsvc/srvsvc_ntvfs.c | 2 +-
source4/smb_server/smb_server.c | 6 +-
wscript | 21 +-
20 files changed, 41 insertions(+), 710 deletions(-)
delete mode 100644 docs-xml/smbdotconf/base/sharebackend.xml
delete mode 100644 source4/param/share_ldb.c
Changeset truncated at 500 lines:
diff --git a/docs-xml/smbdotconf/base/sharebackend.xml b/docs-xml/smbdotconf/base/sharebackend.xml
deleted file mode 100644
index 4da8b177da1..00000000000
--- a/docs-xml/smbdotconf/base/sharebackend.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<samba:parameter name="share backend"
- context="G"
- type="string"
- xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
-<description>
- <para>
- This option specifies the backend that will be used to access the configuration of
- file shares.
- </para>
-
- <para>Traditionally, Samba file shares have been configured in the
- <option>smb.conf</option> file and this is still the default.
- </para>
-
- <para>At the moment there are no other supported backends.</para>
-</description>
-<value type="default">classic</value>
-</samba:parameter>
diff --git a/lib/addns/dnsutils.c b/lib/addns/dnsutils.c
index 3eeb6ab9e21..d1a3173eefc 100644
--- a/lib/addns/dnsutils.c
+++ b/lib/addns/dnsutils.c
@@ -136,7 +136,7 @@ DNS_ERROR dns_domain_name_from_string( TALLOC_CTX *mem_ctx,
char *dns_generate_keyname( TALLOC_CTX *mem_ctx )
{
char *result = NULL;
-#if defined(WITH_DNS_UPDATES)
+#if defined(HAVE_KRB5)
struct GUID guid;
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 6f0eeb7edf6..6a4ae555759 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2552,8 +2552,6 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
lpcfg_do_global_parameter(lp_ctx, "debug uid", "No");
lpcfg_do_global_parameter(lp_ctx, "debug class", "No");
- lpcfg_do_global_parameter(lp_ctx, "share backend", "classic");
-
lpcfg_do_global_parameter(lp_ctx, "server role", "auto");
lpcfg_do_global_parameter(lp_ctx, "domain logons", "No");
lpcfg_do_global_parameter(lp_ctx, "domain master", "Auto");
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index acb4d149f0b..e13571c3e4f 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -891,8 +891,6 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
&Globals.tls_priority,
"NORMAL:-VERS-SSL3.0");
- lpcfg_string_set(Globals.ctx, &Globals.share_backend, "classic");
-
Globals._preferred_master = Auto;
Globals.allow_dns_updates = DNS_UPDATE_SIGNED;
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index b13d151a876..213d069a5f4 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -647,11 +647,13 @@ NTSTATUS synthetic_pathref(TALLOC_CTX *mem_ctx,
if (!VALID_STAT(smb_fname->st)) {
ret = vfs_stat(dirfsp->conn, smb_fname);
if (ret != 0) {
- DBG_ERR("stat [%s] failed: %s\n",
+ int err = errno;
+ int lvl = err == ENOENT ? DBGLVL_INFO : DBGLVL_ERR;
+ DBG_PREFIX(lvl, ("stat [%s] failed: %s\n",
smb_fname_str_dbg(smb_fname),
- strerror(errno));
+ strerror(err)));
TALLOC_FREE(smb_fname);
- return map_nt_error_from_unix(errno);
+ return map_nt_error_from_unix(err);
}
}
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index c8b18a9c281..bc42ddda9cb 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -1506,7 +1506,7 @@ static WERROR check_ads_config( void )
Send a DNS update request
*******************************************************************/
-#if defined(WITH_DNS_UPDATES)
+#if defined(HAVE_KRB5)
#include "../lib/addns/dns.h"
static NTSTATUS net_update_dns_internal(struct net_context *c,
@@ -1741,7 +1741,7 @@ static int net_ads_join_usage(struct net_context *c, int argc, const char **argv
static void _net_ads_join_dns_updates(struct net_context *c, TALLOC_CTX *ctx, struct libnet_JoinCtx *r)
{
-#if defined(WITH_DNS_UPDATES)
+#if defined(HAVE_KRB5)
ADS_STRUCT *ads_dns = NULL;
int ret;
NTSTATUS status;
@@ -2030,7 +2030,7 @@ fail:
static int net_ads_dns_register(struct net_context *c, int argc, const char **argv)
{
-#if defined(WITH_DNS_UPDATES)
+#if defined(HAVE_KRB5)
ADS_STRUCT *ads;
ADS_STATUS status;
NTSTATUS ntstatus;
@@ -2129,7 +2129,7 @@ static int net_ads_dns_unregister(struct net_context *c,
int argc,
const char **argv)
{
-#if defined(WITH_DNS_UPDATES)
+#if defined(HAVE_KRB5)
ADS_STRUCT *ads;
ADS_STATUS status;
NTSTATUS ntstatus;
diff --git a/source3/utils/net_dns.c b/source3/utils/net_dns.c
index 8275042f3e5..751a6c120e0 100644
--- a/source3/utils/net_dns.c
+++ b/source3/utils/net_dns.c
@@ -24,7 +24,7 @@
#include "../lib/addns/dns.h"
#include "utils/net_dns.h"
-#if defined(WITH_DNS_UPDATES)
+#if defined(HAVE_KRB5)
/*********************************************************************
*********************************************************************/
@@ -207,4 +207,4 @@ int get_my_ip_address( struct sockaddr_storage **pp_ss )
return count;
}
-#endif /* defined(WITH_DNS_UPDATES) */
+#endif /* defined(HAVE_KRB5) */
diff --git a/source3/utils/net_dns.h b/source3/utils/net_dns.h
index ef70fddd97c..f53e9546e23 100644
--- a/source3/utils/net_dns.h
+++ b/source3/utils/net_dns.h
@@ -28,7 +28,7 @@
#define DNS_UPDATE_PROBE 0x10
#define DNS_UPDATE_PROBE_SUFFICIENT 0x20
-#if defined(WITH_DNS_UPDATES)
+#if defined(HAVE_KRB5)
#include "../lib/addns/dns.h"
@@ -38,4 +38,4 @@ DNS_ERROR DoDNSUpdate(char *pszServerName,
size_t num_addrs,
uint32_t flags, bool remove_host);
-#endif /* defined(WITH_DNS_UPDATES) */
+#endif /* defined(HAVE_KRB5) */
diff --git a/source3/wscript b/source3/wscript
index b57ad6b42a7..3ee7d0914ed 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -73,7 +73,6 @@ def options(opt):
opt.samba_add_onoff_option('avahi', with_name="enable", without_name="disable")
opt.samba_add_onoff_option('iconv')
opt.samba_add_onoff_option('acl-support')
- opt.samba_add_onoff_option('dnsupdate')
opt.samba_add_onoff_option('syslog')
opt.samba_add_onoff_option('automount')
opt.samba_add_onoff_option('dmapi', default=None) # None means autodetection
@@ -1067,11 +1066,6 @@ syscall(SYS_setgroups32, 0, NULL);
execute=True,
mandatory=True,
msg="Checking whether setuidx is available")
- if Options.options.with_dnsupdate:
- if not conf.CONFIG_SET('HAVE_KRB5'):
- Logs.warn("--with-dnsupdate=yes but gssapi support not sufficient")
- else:
- conf.DEFINE('WITH_DNS_UPDATES', 1)
# valgrind.h or valgrind/valgrind.h is checked in lib/replace/wscript
if Options.options.developer:
if conf.CONFIG_SET('HAVE_VALGRIND_H') or conf.CONFIG_SET('HAVE_VALGRIND_VALGRIND_H'):
diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c
index fc2d3aa611d..aa7c0f88891 100644
--- a/source4/ntvfs/ipc/rap_server.c
+++ b/source4/ntvfs/ipc/rap_server.c
@@ -48,7 +48,7 @@ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx,
r->out.available = 0;
r->out.info = NULL;
- nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx);
+ nterr = share_get_context(mem_ctx, lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return nterr;
}
diff --git a/source4/param/share.c b/source4/param/share.c
index 7a571510812..aa477c7e82c 100644
--- a/source4/param/share.c
+++ b/source4/param/share.c
@@ -126,20 +126,19 @@ NTSTATUS share_register(const struct share_ops *ops)
return NT_STATUS_OK;
}
-NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name,
- struct tevent_context *event_ctx,
- struct loadparm_context *lp_ctx,
- struct share_context **ctx)
+NTSTATUS share_get_context(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
+ struct share_context **ctx)
{
const struct share_ops *ops;
- ops = share_backend_by_name(backend_name);
+ ops = share_backend_by_name("classic");
if (!ops) {
- DEBUG(0, ("share_init_connection: share backend [%s] not found!\n", backend_name));
+ DEBUG(0, ("share_init_connection: share backend [classic] not found!\n"));
return NT_STATUS_INTERNAL_ERROR;
}
- return ops->init(mem_ctx, ops, event_ctx, lp_ctx, ctx);
+ return ops->init(mem_ctx, ops, lp_ctx, ctx);
}
/*
diff --git a/source4/param/share.h b/source4/param/share.h
index f9a749af523..087697aa9f4 100644
--- a/source4/param/share.h
+++ b/source4/param/share.h
@@ -51,7 +51,7 @@ struct tevent_context;
struct share_ops {
const char *name;
- NTSTATUS (*init)(TALLOC_CTX *, const struct share_ops*, struct tevent_context *ev_ctx,
+ NTSTATUS (*init)(TALLOC_CTX *, const struct share_ops*,
struct loadparm_context *lp_ctx,
struct share_context **);
char *(*string_option)(TALLOC_CTX *, struct share_config *, const char *, const char *);
@@ -77,10 +77,9 @@ NTSTATUS share_create(struct share_context *sctx, const char *name, struct share
NTSTATUS share_set(struct share_context *sctx, const char *name, struct share_info *info, int count);
NTSTATUS share_remove(struct share_context *sctx, const char *name);
NTSTATUS share_register(const struct share_ops *ops);
-NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name,
- struct tevent_context *event_ctx,
- struct loadparm_context *lp_ctx,
- struct share_context **ctx);
+NTSTATUS share_get_context(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
+ struct share_context **ctx);
NTSTATUS share_init(void);
/* list of shares options */
diff --git a/source4/param/share_classic.c b/source4/param/share_classic.c
index 653723e3b0a..d03558d1aa5 100644
--- a/source4/param/share_classic.c
+++ b/source4/param/share_classic.c
@@ -27,7 +27,6 @@ NTSTATUS share_classic_init(TALLOC_CTX *);
static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx,
const struct share_ops *ops,
- struct tevent_context *event_ctx,
struct loadparm_context *lp_ctx,
struct share_context **ctx)
{
diff --git a/source4/param/share_ldb.c b/source4/param/share_ldb.c
deleted file mode 100644
index 30d7f205cd1..00000000000
--- a/source4/param/share_ldb.c
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- LDB based shares configuration
-
- Copyright (C) Simo Sorce 2006
-
- 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
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include <ldb.h>
-#include <ldb_errors.h>
-#include "auth/auth.h"
-#include "ldb_wrap.h"
-#include "param/share.h"
-#include "param/param.h"
-
-#undef strcasecmp
-
-NTSTATUS share_ldb_init(TALLOC_CTX *);
-
-static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops,
- struct tevent_context *ev_ctx,
- struct loadparm_context *lp_ctx,
- struct share_context **ctx)
-{
- struct ldb_context *sdb;
-
- *ctx = talloc(mem_ctx, struct share_context);
- if (!*ctx) {
- DEBUG(0, ("ERROR: Out of memory!\n"));
- return NT_STATUS_NO_MEMORY;
- }
-
- sdb = ldb_wrap_connect(*ctx, ev_ctx, lp_ctx,
- lpcfg_private_path(*ctx, lp_ctx, "share.ldb"),
- system_session(lp_ctx),
- NULL, 0);
-
- if (!sdb) {
- talloc_free(*ctx);
- return NT_STATUS_UNSUCCESSFUL;
- }
-
- (*ctx)->ops = ops;
- (*ctx)->priv_data = (void *)sdb;
-
- return NT_STATUS_OK;
-}
-
-static char *sldb_string_option(TALLOC_CTX *mem_ctx, struct share_config *scfg, const char *opt_name, const char *defval)
-{
- struct ldb_message *msg;
- struct ldb_message_element *el;
- const char *colon;
-
- if (scfg == NULL) return talloc_strdup(mem_ctx, defval);
-
- msg = talloc_get_type(scfg->opaque, struct ldb_message);
-
- colon = strchr(opt_name, ':');
- if (colon != NULL) {
- char *name;
-
- name = talloc_strdup(scfg, opt_name);
- if (!name) {
- return NULL;
- }
- name[colon-opt_name] = '-';
-
- el = ldb_msg_find_element(msg, name);
- TALLOC_FREE(name);
- } else {
- el = ldb_msg_find_element(msg, opt_name);
- }
-
- if (el == NULL) {
- return talloc_strdup(mem_ctx, defval);
- }
-
- return (char *)(el->values[0].data);
-}
-
-static int sldb_int_option(struct share_config *scfg, const char *opt_name, int defval)
-{
- char *val;
- int ret;
-
- val = sldb_string_option(scfg, scfg, opt_name, NULL);
- if (val == NULL) return defval;
-
- errno = 0;
- ret = (int)strtol(val, NULL, 10);
- TALLOC_FREE(val);
-
- if (errno) return -1;
-
- return ret;
-}
-
-static bool sldb_bool_option(struct share_config *scfg, const char *opt_name, bool defval)
-{
- char *val;
-
- val = sldb_string_option(scfg, scfg, opt_name, NULL);
- if (val == NULL) return defval;
-
- if (strcasecmp(val, "true") == 0) {
- TALLOC_FREE(val);
- return true;
- }
-
- TALLOC_FREE(val);
- return false;
-}
-
-static const char **sldb_string_list_option(TALLOC_CTX *mem_ctx, struct share_config *scfg, const char *opt_name)
-{
- struct ldb_message *msg;
- struct ldb_message_element *el;
- const char **list;
- const char *colon;
- int i;
-
- if (scfg == NULL) return NULL;
-
- msg = talloc_get_type(scfg->opaque, struct ldb_message);
-
- colon = strchr(opt_name, ':');
- if (colon != NULL) {
- char *name;
-
- name = talloc_strdup(scfg, opt_name);
- if (!name) {
- return NULL;
- }
- name[colon-opt_name] = '-';
-
- el = ldb_msg_find_element(msg, name);
- TALLOC_FREE(name);
- } else {
- el = ldb_msg_find_element(msg, opt_name);
- }
-
- if (el == NULL) {
- return NULL;
- }
-
- list = talloc_array(mem_ctx, const char *, el->num_values + 1);
- if (!list) return NULL;
-
- for (i = 0; i < el->num_values; i++) {
- list[i] = (const char *)(el->values[i].data);
- }
- list[i] = NULL;
-
- return list;
-}
-
-static NTSTATUS sldb_list_all(TALLOC_CTX *mem_ctx,
- struct share_context *ctx,
- int *count,
- const char ***names)
-{
- int ret, i, j;
- const char **n;
- struct ldb_context *ldb;
- struct ldb_result *res;
- TALLOC_CTX *tmp_ctx;
-
- tmp_ctx = talloc_new(mem_ctx);
- if (!tmp_ctx) {
- DEBUG(0,("ERROR: Out of memory!\n"));
- return NT_STATUS_NO_MEMORY;
- }
-
- ldb = talloc_get_type(ctx->priv_data, struct ldb_context);
-
- ret = ldb_search(ldb, tmp_ctx, &res, ldb_dn_new(tmp_ctx, ldb, "CN=SHARES"),
- LDB_SCOPE_SUBTREE, NULL, "(name=*)");
- if (ret != LDB_SUCCESS) {
- talloc_free(tmp_ctx);
- return NT_STATUS_INTERNAL_DB_CORRUPTION;
- }
-
- n = talloc_array(mem_ctx, const char *, res->count);
- if (!n) {
- DEBUG(0,("ERROR: Out of memory!\n"));
- talloc_free(tmp_ctx);
- return NT_STATUS_NO_MEMORY;
- }
-
- for (i = 0, j = 0; i < res->count; i++) {
- n[j] = talloc_strdup(n, ldb_msg_find_attr_as_string(res->msgs[i], "name", NULL));
- if (!n[j]) {
- DEBUG(0,("WARNING: Malformed share object in share database\n!"));
- continue;
- }
- j++;
- }
-
- *names = n;
- *count = j;
- talloc_free(tmp_ctx);
-
- return NT_STATUS_OK;
-}
-
-static NTSTATUS sldb_get_config(TALLOC_CTX *mem_ctx,
- struct share_context *ctx,
- const char *name,
- struct share_config **scfg)
-{
--
Samba Shared Repository
More information about the samba-cvs
mailing list