[SCM] Samba Shared Repository - branch master updated

2021-01-07 Thread Jeremy Allison
The branch, master has been updated
   via  2f21d1b0ac8 vfs_virusfilter: Allocate separate memory for config 
char*
  from  38c989fab78 s3:lib: Create the cache path of user gencache 
recursively

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 2f21d1b0ac8526508161de73290f67858b2fe668
Author: Arne Kreddig 
Date:   Fri Jan 1 22:54:22 2021 +0100

vfs_virusfilter: Allocate separate memory for config char*

Instead of using only the pointer to the configuration char* from the
global configuration, vfs_virusfilter now allocates its own memory and
copies the char* from the global configuration.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14606
Signed-off-by: Arne Kreddig 
Reviewed-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Thu Jan  7 19:25:38 UTC 2021 on sn-devel-184

---

Summary of changes:
 source3/modules/vfs_virusfilter.c | 66 +--
 1 file changed, 57 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_virusfilter.c 
b/source3/modules/vfs_virusfilter.c
index c952b9bddb2..290d9a23335 100644
--- a/source3/modules/vfs_virusfilter.c
+++ b/source3/modules/vfs_virusfilter.c
@@ -200,6 +200,14 @@ static int virusfilter_vfs_connect(
struct virusfilter_config *config = NULL;
const char *exclude_files = NULL;
const char *temp_quarantine_dir_mode = NULL;
+   const char *infected_file_command = NULL;
+   const char *scan_error_command = NULL;
+   const char *quarantine_dir = NULL;
+   const char *quarantine_prefix = NULL;
+   const char *quarantine_suffix = NULL;
+   const char *rename_prefix = NULL;
+   const char *rename_suffix = NULL;
+   const char *socket_path = NULL;
char *sret = NULL;
char *tmp = NULL;
enum virusfilter_scanner_enum backend;
@@ -257,11 +265,21 @@ static int virusfilter_vfs_connect(
snum, "virusfilter", "infected file action",
virusfilter_actions, VIRUSFILTER_ACTION_DO_NOTHING);
 
-   config->infected_file_command = lp_parm_const_string(
+   infected_file_command = lp_parm_const_string(
snum, "virusfilter", "infected file command", NULL);
+   config->infected_file_command = talloc_strdup(config, 
infected_file_command);
+   if (config->infected_file_command == NULL) {
+   DBG_ERR("virusfilter-vfs: out of memory!\n");
+   return -1;
+   }
 
-   config->scan_error_command = lp_parm_const_string(
+   scan_error_command = lp_parm_const_string(
snum, "virusfilter", "scan error command", NULL);
+   config->scan_error_command = talloc_strdup(config, scan_error_command);
+   if (config->scan_error_command == NULL) {
+   DBG_ERR("virusfilter-vfs: out of memory!\n");
+   return -1;
+   }
 
config->block_access_on_error = lp_parm_bool(
snum, "virusfilter", "block access on error", false);
@@ -269,9 +287,14 @@ static int virusfilter_vfs_connect(
tmp = talloc_asprintf(config, "%s/.quarantine",
handle->conn->connectpath);
 
-   config->quarantine_dir = lp_parm_const_string(
+   quarantine_dir = lp_parm_const_string(
snum, "virusfilter", "quarantine directory",
tmp ? tmp : "/tmp/.quarantine");
+   config->quarantine_dir = talloc_strdup(config, quarantine_dir);
+   if (config->quarantine_dir == NULL) {
+   DBG_ERR("virusfilter-vfs: out of memory!\n");
+   return -1;
+   }
 
if (tmp != config->quarantine_dir) {
TALLOC_FREE(tmp);
@@ -285,13 +308,23 @@ static int virusfilter_vfs_connect(
config->quarantine_dir_mode = mode;
}
 
-   config->quarantine_prefix = lp_parm_const_string(
+   quarantine_prefix = lp_parm_const_string(
snum, "virusfilter", "quarantine prefix",
VIRUSFILTER_DEFAULT_QUARANTINE_PREFIX);
+   config->quarantine_prefix = talloc_strdup(config, quarantine_prefix);
+   if (config->quarantine_prefix == NULL) {
+   DBG_ERR("virusfilter-vfs: out of memory!\n");
+   return -1;
+   }
 
-   config->quarantine_suffix = lp_parm_const_string(
+   quarantine_suffix = lp_parm_const_string(
snum, "virusfilter", "quarantine suffix",
VIRUSFILTER_DEFAULT_QUARANTINE_SUFFIX);
+   config->quarantine_suffix = talloc_strdup(config, quarantine_suffix);
+   if (config->quarantine_suffix == NULL) {
+   DBG_ERR("virusfilter-vfs: out of memory!\n");
+   return -1;
+   }
 
/*
 * Make sure prefixes an

[SCM] Samba Shared Repository - branch v4-13-test updated

2021-01-07 Thread Karolin Seeger
The branch, v4-13-test has been updated
   via  fc15ff8951f Do not create an empty DB when accessing a sam.ldb
  from  c5159bd6d76 bootstrap: Cope with case changes in CentOS 8 repo names

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-13-test


- Log -
commit fc15ff8951f791ba53f25b44c105093c1cdb9bac
Author: Andrew Bartlett 
Date:   Mon Nov 23 19:35:37 2020 +1300

Do not create an empty DB when accessing a sam.ldb

Samba already does this for samba-tool and doing this should make
our errors more sensible, particularly in BIND9 if not provisioned
with the correct --dns-backend=DLZ_BIND9

The old error was like:

 named[62954]: samba_dlz: Unable to get basedn for
 /var/lib/samba/private/dns/sam.ldb
  - NULL Base DN invalid for a base search.

The new error will be like (in this case from the torture test):
 Failed to connect to Failed to connect to
 ldb:///home/abartlet/samba/st/chgdcpass/bind-dns/dns/sam.ldb:
 Unable to open tdb 
'/home/abartlet/samba/st/chgdcpass/bind-dns/dns/sam.ldb':
 No such file or directory: Operations error

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14579

Reviewed-by: Andreas Schneider 
Signed-off-by: Andrew Bartlett 
(cherry picked from commit d49e96bc45ea5e2d3364242dad36fe9094b7cc42)

Autobuild-User(v4-13-test): Karolin Seeger 
Autobuild-Date(v4-13-test): Thu Jan  7 10:50:10 UTC 2021 on sn-devel-184

---

Summary of changes:
 source4/dsdb/samdb/samdb.c | 3 +++
 1 file changed, 3 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 10db0c50395..d5890dec03e 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -63,6 +63,9 @@ int samdb_connect_url(TALLOC_CTX *mem_ctx,
*ldb_ret = NULL;
*errstring = NULL;
 
+   /* We create sam.ldb in provision, and never anywhere else */
+   flags |= LDB_FLG_DONT_CREATE_DB;
+
if (remote_address == NULL) {
ldb = ldb_wrap_find(url, ev_ctx, lp_ctx,
session_info, NULL, flags);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch v4-12-test updated

2021-01-07 Thread Karolin Seeger
The branch, v4-12-test has been updated
   via  578c5805ac7 Do not create an empty DB when accessing a sam.ldb
  from  9b5dd480590 bootstrap: Cope with case changes in CentOS 8 repo names

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-12-test


- Log -
commit 578c5805ac7c44a1dcb4e5a121f65bad95d188d5
Author: Andrew Bartlett 
Date:   Mon Nov 23 19:35:37 2020 +1300

Do not create an empty DB when accessing a sam.ldb

Samba already does this for samba-tool and doing this should make
our errors more sensible, particularly in BIND9 if not provisioned
with the correct --dns-backend=DLZ_BIND9

The old error was like:

 named[62954]: samba_dlz: Unable to get basedn for
 /var/lib/samba/private/dns/sam.ldb
  - NULL Base DN invalid for a base search.

The new error will be like (in this case from the torture test):
 Failed to connect to Failed to connect to
 ldb:///home/abartlet/samba/st/chgdcpass/bind-dns/dns/sam.ldb:
 Unable to open tdb 
'/home/abartlet/samba/st/chgdcpass/bind-dns/dns/sam.ldb':
 No such file or directory: Operations error

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14579

Reviewed-by: Andreas Schneider 
Signed-off-by: Andrew Bartlett 
(cherry picked from commit d49e96bc45ea5e2d3364242dad36fe9094b7cc42)

Autobuild-User(v4-12-test): Karolin Seeger 
Autobuild-Date(v4-12-test): Thu Jan  7 09:50:29 UTC 2021 on sn-devel-184

---

Summary of changes:
 source4/dsdb/samdb/samdb.c | 3 +++
 1 file changed, 3 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 10db0c50395..d5890dec03e 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -63,6 +63,9 @@ int samdb_connect_url(TALLOC_CTX *mem_ctx,
*ldb_ret = NULL;
*errstring = NULL;
 
+   /* We create sam.ldb in provision, and never anywhere else */
+   flags |= LDB_FLG_DONT_CREATE_DB;
+
if (remote_address == NULL) {
ldb = ldb_wrap_find(url, ev_ctx, lp_ctx,
session_info, NULL, flags);


-- 
Samba Shared Repository