[SCM] Samba Shared Repository - branch master updated

Karolin Seeger kseeger at samba.org
Mon Apr 8 11:44:02 UTC 2019


The branch, master has been updated
       via  b1582a4d09f CVE-2019-3880 s3: rpc: winreg: Remove implementations of SaveKey/RestoreKey.
       via  c79f719a840 CVE-2019-3880 s3: rpc: winreg: Remove implementations of SaveKey/RestoreKey.
       via  17b3d2ebffd CVE-2019-3870 pysmbd: Ensure a zero umask is set for smbd.mkdir()
       via  1899e16e6f5 CVE-2019-3870 pysmbd: Move umask manipuations as close as possible to users
       via  d7580706e9a CVE-2019-3870 pysmbd: Include tests to show the outside umask has no impact
       via  0c8ad9c9dbe CVE-2019-3870 tests: Add test to check file-permissions are correct after provision
       via  6048103751a CVE-2019-3870 tests: Extend smbd tests to check for umask being overwritten
      from  21d501bfa8f selftest: Correct name of flapping smb2.notify test

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


- Log -----------------------------------------------------------------
commit b1582a4d09f4f6537f9067b4ff1d991acb624930
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Mar 27 12:51:27 2019 -0700

    CVE-2019-3880 s3: rpc: winreg: Remove implementations of SaveKey/RestoreKey.
    
    Remove the now unused code implementations of
    registry file io.
    
    As reported by Michael Hanselmann.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13851
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(master): Mon Apr  8 11:43:31 UTC 2019 on sn-devel-144

commit c79f719a840dfa5e9682462ea58c8f48ca0012e5
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Mar 21 14:51:30 2019 -0700

    CVE-2019-3880 s3: rpc: winreg: Remove implementations of SaveKey/RestoreKey.
    
    The were not using VFS backend calls and could only work
    locally, and were unsafe against symlink races and other
    security issues.
    
    If the incoming handle is valid, return WERR_BAD_PATHNAME.
    
    [MS-RRP] states "The format of the file name is implementation-specific"
    so ensure we don't allow this.
    
    As reported by Michael Hanselmann.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13851
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 17b3d2ebffd2775a3f7f5cdbe4330855f2e1b356
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Mar 21 17:24:14 2019 +1300

    CVE-2019-3870 pysmbd: Ensure a zero umask is set for smbd.mkdir()
    
    mkdir() is the other call that requires a umask of 0 in Samba.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1899e16e6f552d0ab504d19f74aa5c42ab84504a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Mar 14 18:20:06 2019 +1300

    CVE-2019-3870 pysmbd: Move umask manipuations as close as possible to users
    
    Umask manipulation was added to pysmbd with e146fe5ef96c1522175a8e81db15d1e8879e5652 in 2012
    and init_files_struct was split out in 747c3f1fb379bb68cc7479501b85741493c05812 in 2018 for
    Samba 4.9. (It was added to assist the smbd.create_file() routine used in the backup and
    restore tools, which needed to write files with full metadata).
    
    This in turn avoids leaving init_files_struct() without resetting the umask to
    the original, saved, value.
    
    Per umask(2) this is required before open() and mkdir() system calls (along
    side other file-like things such as those for Unix domain socks and FIFOs etc).
    
    Therefore for safety and clarify the additional 'belt and braces' umask
    manipuations elsewhere are removed.
    
    mkdir() will be protected by a umask() bracket, for correctness, in the next patch.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d7580706e9ac75187ba5d926fd0e37a468a6da86
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Mar 21 17:21:58 2019 +1300

    CVE-2019-3870 pysmbd: Include tests to show the outside umask has no impact
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 0c8ad9c9dbeac1ad0ca3553a19d7bbf652bb650d
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Fri Mar 15 13:52:50 2019 +1300

    CVE-2019-3870 tests: Add test to check file-permissions are correct after provision
    
    This provisions a new DC and checks there are no world-writable
    files in the new DC's private directory.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6048103751afa33f1951539ce36224a03b276604
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Fri Mar 15 15:20:21 2019 +1300

    CVE-2019-3870 tests: Extend smbd tests to check for umask being overwritten
    
    The smbd changes the umask - if the code fails to restore the umask to
    what it was, then this is very bad. Add an extra check to every
    smbd-related test that the umask at the end of the test is the same as
    what it was at the beginning (i.e. if the smbd code changed the umask
    then it correctly restored the value afterwards).
    
    As the selftest sets the umask for all tests to zero, it makes it hard
    to detect this problem, so the test setUp() needs to set it to something
    else first.
    
    This extra checking is added to the setUp()/tearDown() so that it
    applies to all test-cases. However, any failure that occur with this
    approach will not be able to be known-failed.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 python/samba/tests/ntacls_backup.py        |  18 +-
 python/samba/tests/posixacl.py             |   4 +-
 python/samba/tests/smbd_base.py            |  48 +++++
 source3/registry/reg_api_regf.c            | 302 -----------------------------
 source3/registry/reg_api_regf.h            |  35 ----
 source3/rpc_server/winreg/srv_winreg_nt.c  |  93 +--------
 source3/rpc_server/wscript_build           |   2 +-
 source3/smbd/pysmbd.c                      |  45 ++---
 source3/wscript_build                      |   4 -
 source4/selftest/tests.py                  |   1 +
 source4/setup/tests/provision_fileperms.sh |  71 +++++++
 11 files changed, 163 insertions(+), 460 deletions(-)
 create mode 100644 python/samba/tests/smbd_base.py
 delete mode 100644 source3/registry/reg_api_regf.c
 delete mode 100644 source3/registry/reg_api_regf.h
 create mode 100755 source4/setup/tests/provision_fileperms.sh


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/ntacls_backup.py b/python/samba/tests/ntacls_backup.py
index 03ee821e595..d92299187f3 100644
--- a/python/samba/tests/ntacls_backup.py
+++ b/python/samba/tests/ntacls_backup.py
@@ -26,10 +26,11 @@ from samba import ntacls
 
 from samba.auth import system_session
 from samba.dcerpc import security
-from samba.tests import TestCaseInTempDir, env_loadparm
+from samba.tests import env_loadparm
+from samba.tests.smbd_base import SmbdBaseTests
 
 
-class NtaclsBackupRestoreTests(TestCaseInTempDir):
+class NtaclsBackupRestoreTests(SmbdBaseTests):
     """
     Tests for NTACLs backup and restore.
     """
@@ -110,6 +111,12 @@ class NtaclsBackupRestoreTests(TestCaseInTempDir):
 
         dirpath = os.path.join(self.service_root, 'a-dir')
         smbd.mkdir(dirpath, self.service)
+        mode = os.stat(dirpath).st_mode
+
+        # This works in conjunction with the TEST_UMASK in smbd_base
+        # to ensure that permissions are not related to the umask
+        # but instead the smb.conf settings
+        self.assertEquals(mode & 0o777, 0o755)
         self.assertTrue(os.path.isdir(dirpath))
 
     def test_smbd_create_file(self):
@@ -121,6 +128,13 @@ class NtaclsBackupRestoreTests(TestCaseInTempDir):
         smbd.create_file(filepath, self.service)
         self.assertTrue(os.path.isfile(filepath))
 
+        mode = os.stat(filepath).st_mode
+
+        # This works in conjunction with the TEST_UMASK in smbd_base
+        # to ensure that permissions are not related to the umask
+        # but instead the smb.conf settings
+        self.assertEquals(mode & 0o777, 0o644)
+
         # As well as checking that unlink works, this removes the
         # fake xattrs from the dev/inode based DB
         smbd.unlink(filepath, self.service)
diff --git a/python/samba/tests/posixacl.py b/python/samba/tests/posixacl.py
index 65ca2c846f5..7e1fb3ec55e 100644
--- a/python/samba/tests/posixacl.py
+++ b/python/samba/tests/posixacl.py
@@ -20,7 +20,7 @@
 
 from samba.ntacls import setntacl, getntacl, checkset_backend
 from samba.dcerpc import security, smb_acl, idmap
-from samba.tests import TestCaseInTempDir
+from samba.tests.smbd_base import SmbdBaseTests
 from samba import provision
 import os
 from samba.samba3 import smbd, passdb
@@ -32,7 +32,7 @@ DOM_SID = "S-1-5-21-2212615479-2695158682-2101375467"
 ACL = "O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)"
 
 
-class PosixAclMappingTests(TestCaseInTempDir):
+class PosixAclMappingTests(SmbdBaseTests):
 
     def setUp(self):
         super(PosixAclMappingTests, self).setUp()
diff --git a/python/samba/tests/smbd_base.py b/python/samba/tests/smbd_base.py
new file mode 100644
index 00000000000..b49bcc0828f
--- /dev/null
+++ b/python/samba/tests/smbd_base.py
@@ -0,0 +1,48 @@
+# Unix SMB/CIFS implementation. Common code for smbd python bindings tests
+# Copyright (C) Catalyst.Net Ltd 2019
+#
+# 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/>.
+#
+from samba.tests import TestCaseInTempDir
+import os
+
+TEST_UMASK = 0o042
+
+class SmbdBaseTests(TestCaseInTempDir):
+
+    def get_umask(self):
+        # we can only get the umask by setting it to something
+        curr_umask = os.umask(0)
+        # restore the old setting
+        os.umask(curr_umask)
+        return curr_umask
+
+    def setUp(self):
+        super(SmbdBaseTests, self).setUp()
+        self.orig_umask = self.get_umask()
+
+        # set an arbitrary umask - the underlying smbd code should override
+        # this, but it allows us to check if umask is left unset
+        os.umask(TEST_UMASK)
+
+    def tearDown(self):
+        # the current umask should be what we set it to earlier - if it's not,
+        # it indicates the code has changed it and not restored it
+        self.assertEqual(self.get_umask(), TEST_UMASK,
+                         "umask unexpectedly overridden by test")
+
+        # restore the original umask value (before we interferred with it)
+        os.umask(self.orig_umask)
+
+        super(SmbdBaseTests, self).tearDown()
diff --git a/source3/registry/reg_api_regf.c b/source3/registry/reg_api_regf.c
deleted file mode 100644
index b83404c55e3..00000000000
--- a/source3/registry/reg_api_regf.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- *  Unix SMB/CIFS implementation.
- *  Virtual Windows Registry Layer
- *  Copyright (C) Volker Lendecke 2006
- *  Copyright (C) Michael Adam 2007-2008
- *
- *  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 "system/filesys.h"
-#include "registry.h"
-#include "reg_api_regf.h"
-#include "reg_cachehook.h"
-#include "regfio.h"
-#include "reg_util_internal.h"
-#include "reg_dispatcher.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_REGISTRY
-
-/*******************************************************************
- Note: topkeypat is the *full* path that this *key will be
- loaded into (including the name of the key)
- ********************************************************************/
-
-static WERROR reg_load_tree(REGF_FILE *regfile, const char *topkeypath,
-			    REGF_NK_REC *key)
-{
-	REGF_NK_REC *subkey;
-	struct registry_key_handle registry_key;
-	struct regval_ctr *values;
-	struct regsubkey_ctr *subkeys;
-	int i;
-	char *path = NULL;
-	WERROR result = WERR_OK;
-
-	/* initialize the struct registry_key_handle structure */
-
-	registry_key.ops = reghook_cache_find(topkeypath);
-	if (!registry_key.ops) {
-		DEBUG(0, ("reg_load_tree: Failed to assign registry_ops "
-			  "to [%s]\n", topkeypath));
-		return WERR_FILE_NOT_FOUND;
-	}
-
-	registry_key.name = talloc_strdup(regfile->mem_ctx, topkeypath);
-	if (!registry_key.name) {
-		DEBUG(0, ("reg_load_tree: Talloc failed for reg_key.name!\n"));
-		return WERR_NOT_ENOUGH_MEMORY;
-	}
-
-	/* now start parsing the values and subkeys */
-
-	result = regsubkey_ctr_init(regfile->mem_ctx, &subkeys);
-	W_ERROR_NOT_OK_RETURN(result);
-
-	result = regval_ctr_init(subkeys, &values);
-	W_ERROR_NOT_OK_RETURN(result);
-
-	/* copy values into the struct regval_ctr */
-
-	for (i=0; i<key->num_values; i++) {
-		regval_ctr_addvalue(values, key->values[i].valuename,
-				    key->values[i].type,
-				    key->values[i].data,
-				    (key->values[i].data_size & ~VK_DATA_IN_OFFSET));
-	}
-
-	/* copy subkeys into the struct regsubkey_ctr */
-
-	key->subkey_index = 0;
-	while ((subkey = regfio_fetch_subkey( regfile, key ))) {
-		result = regsubkey_ctr_addkey(subkeys, subkey->keyname);
-		if (!W_ERROR_IS_OK(result)) {
-			TALLOC_FREE(subkeys);
-			return result;
-		}
-	}
-
-	/* write this key and values out */
-
-	if (!store_reg_values(&registry_key, values)
-	    || !store_reg_keys(&registry_key, subkeys))
-	{
-		DEBUG(0,("reg_load_tree: Failed to load %s!\n", topkeypath));
-		result = WERR_REGISTRY_IO_FAILED;
-	}
-
-	TALLOC_FREE(subkeys);
-
-	if (!W_ERROR_IS_OK(result)) {
-		return result;
-	}
-
-	/* now continue to load each subkey registry tree */
-
-	key->subkey_index = 0;
-	while ((subkey = regfio_fetch_subkey(regfile, key))) {
-		path = talloc_asprintf(regfile->mem_ctx,
-				       "%s\\%s",
-				       topkeypath,
-				       subkey->keyname);
-		if (path == NULL) {
-			return WERR_NOT_ENOUGH_MEMORY;
-		}
-		result = reg_load_tree(regfile, path, subkey);
-		if (!W_ERROR_IS_OK(result)) {
-			break;
-		}
-	}
-
-	return result;
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static WERROR restore_registry_key(struct registry_key_handle *krecord,
-				   const char *fname)
-{
-	REGF_FILE *regfile;
-	REGF_NK_REC *rootkey;
-	WERROR result;
-
-	/* open the registry file....fail if the file already exists */
-
-	regfile = regfio_open(fname, (O_RDONLY), 0);
-	if (regfile == NULL) {
-		DEBUG(0, ("restore_registry_key: failed to open \"%s\" (%s)\n",
-			  fname, strerror(errno)));
-		return ntstatus_to_werror(map_nt_error_from_unix(errno));
-	}
-
-	/* get the rootkey from the regf file and then load the tree
-	   via recursive calls */
-
-	if (!(rootkey = regfio_rootkey(regfile))) {
-		regfio_close(regfile);
-		return WERR_NOT_REGISTRY_FILE;
-	}
-
-	result = reg_load_tree(regfile, krecord->name, rootkey);
-
-	/* cleanup */
-
-	regfio_close(regfile);
-
-	return result;
-}
-
-WERROR reg_restorekey(struct registry_key *key, const char *fname)
-{
-	return restore_registry_key(key->key, fname);
-}
-
-/********************************************************************
-********************************************************************/
-
-static WERROR reg_write_tree(REGF_FILE *regfile, const char *keypath,
-			     REGF_NK_REC *parent)
-{
-	REGF_NK_REC *key;
-	struct regval_ctr *values;
-	struct regsubkey_ctr *subkeys;
-	int i, num_subkeys;
-	char *key_tmp = NULL;
-	char *keyname, *parentpath;
-	char *subkeypath = NULL;
-	char *subkeyname;
-	struct registry_key_handle registry_key;
-	WERROR result = WERR_OK;
-	struct security_descriptor *sec_desc = NULL;
-
-	if (!regfile) {
-		return WERR_GEN_FAILURE;
-	}
-
-	if (!keypath) {
-		return WERR_BAD_PATHNAME;
-	}
-
-	/* split up the registry key path */
-
-	key_tmp = talloc_strdup(regfile->mem_ctx, keypath);
-	if (!key_tmp) {
-		return WERR_NOT_ENOUGH_MEMORY;
-	}
-	if (!reg_split_key(key_tmp, &parentpath, &keyname)) {
-		return WERR_BAD_PATHNAME;
-	}
-
-	if (!keyname) {
-		keyname = parentpath;
-	}
-
-	/* we need a registry_key_handle object here to enumerate subkeys and values */
-
-	ZERO_STRUCT(registry_key);
-
-	registry_key.name = talloc_strdup(regfile->mem_ctx, keypath);
-	if (registry_key.name == NULL) {
-		return WERR_NOT_ENOUGH_MEMORY;
-	}
-
-	registry_key.ops = reghook_cache_find(registry_key.name);
-	if (registry_key.ops == NULL) {
-		return WERR_FILE_NOT_FOUND;
-	}
-
-	/* lookup the values and subkeys */
-
-	result = regsubkey_ctr_init(regfile->mem_ctx, &subkeys);
-	W_ERROR_NOT_OK_RETURN(result);
-
-	result = regval_ctr_init(subkeys, &values);
-	W_ERROR_NOT_OK_RETURN(result);
-
-	fetch_reg_keys(&registry_key, subkeys);
-	fetch_reg_values(&registry_key, values);
-
-	result = regkey_get_secdesc(regfile->mem_ctx, &registry_key, &sec_desc);
-	if (!W_ERROR_IS_OK(result)) {
-		goto done;
-	}
-
-	/* write out this key */
-
-	key = regfio_write_key(regfile, keyname, values, subkeys, sec_desc,
-			       parent);
-	if (key == NULL) {
-		result = WERR_CAN_NOT_COMPLETE;
-		goto done;
-	}
-
-	/* write each one of the subkeys out */
-
-	num_subkeys = regsubkey_ctr_numkeys(subkeys);
-	for (i=0; i<num_subkeys; i++) {
-		subkeyname = regsubkey_ctr_specific_key(subkeys, i);
-		subkeypath = talloc_asprintf(regfile->mem_ctx, "%s\\%s",
-					     keypath, subkeyname);
-		if (subkeypath == NULL) {
-			result = WERR_NOT_ENOUGH_MEMORY;
-			goto done;
-		}
-		result = reg_write_tree(regfile, subkeypath, key);
-		if (!W_ERROR_IS_OK(result))
-			goto done;
-	}
-
-	DEBUG(6, ("reg_write_tree: wrote key [%s]\n", keypath));
-
-done:
-	TALLOC_FREE(subkeys);
-	TALLOC_FREE(registry_key.name);
-
-	return result;
-}
-
-static WERROR backup_registry_key(struct registry_key_handle *krecord,
-				  const char *fname)
-{
-	REGF_FILE *regfile;
-	WERROR result;
-
-	/* open the registry file....fail if the file already exists */
-
-	regfile = regfio_open(fname, (O_RDWR|O_CREAT|O_EXCL),
-			      (S_IRUSR|S_IWUSR));
-	if (regfile == NULL) {
-		DEBUG(0,("backup_registry_key: failed to open \"%s\" (%s)\n",
-			 fname, strerror(errno) ));
-		return ntstatus_to_werror(map_nt_error_from_unix(errno));
-	}
-
-	/* write the registry tree to the file  */
-
-	result = reg_write_tree(regfile, krecord->name, NULL);
-
-	/* cleanup */
-
-	regfio_close(regfile);
-
-	return result;
-}
-
-WERROR reg_savekey(struct registry_key *key, const char *fname)
-{
-	return backup_registry_key(key->key, fname);
-}
diff --git a/source3/registry/reg_api_regf.h b/source3/registry/reg_api_regf.h
deleted file mode 100644
index c68261fa95f..00000000000
--- a/source3/registry/reg_api_regf.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *  Unix SMB/CIFS implementation.
- *
- *  Virtual Windows Registry Layer
- *
- *  Copyright (C) Volker Lendecke 2006
- *  Copyright (C) Michael Adam 2007-2008
- *
- *  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/>.
- */
-
-/*
- * Portion of reg_api that references regfio.c code.
- * These are the savekey and restorekey calls.
- * These calls are currently only used in the WINREG rpc server.
- */
-
-#ifndef _REG_API_REGF_H
-#define _REG_API_REGF_H
-
-WERROR reg_restorekey(struct registry_key *key, const char *fname);
-WERROR reg_savekey(struct registry_key *key, const char *fname);
-
-#endif /* _REG_API_REGF_H */
diff --git a/source3/rpc_server/winreg/srv_winreg_nt.c b/source3/rpc_server/winreg/srv_winreg_nt.c
index d9ee8d0602d..e42f0ba203e 100644
--- a/source3/rpc_server/winreg/srv_winreg_nt.c
+++ b/source3/rpc_server/winreg/srv_winreg_nt.c
@@ -25,7 +25,6 @@
 #include "../librpc/gen_ndr/srv_winreg.h"
 #include "registry.h"
 #include "registry/reg_api.h"
-#include "registry/reg_api_regf.h"
 #include "registry/reg_perfcount.h"
 #include "rpc_misc.h"
 #include "auth.h"
@@ -639,46 +638,6 @@ WERROR _winreg_AbortSystemShutdown(struct pipes_struct *p,
 	return (ret == 0) ? WERR_OK : WERR_ACCESS_DENIED;
 }
 
-/*******************************************************************
- ********************************************************************/
-
-static int validate_reg_filename(TALLOC_CTX *ctx, char **pp_fname )
-{
-	char *p = NULL;
-	int num_services = lp_numservices();
-	int snum = -1;
-	const char *share_path = NULL;
-	char *fname = *pp_fname;
-
-	/* convert to a unix path, stripping the C:\ along the way */
-
-	if (!(p = valid_share_pathname(ctx, fname))) {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list