The branch, master has been updated via 11620ae smbd/quotas: Remove invalid quota status switch case via 3e6af71 autobuild: Confirm we can build without --enable-developer via d7cc5d4 Add samba4.smb2.create.mkdir-dup(ad_dc_ntvfs) as flapping via 71dcc76 build: Enable NTVFS file server to be omitted from 0ccf842 ctdb-scripts: Use "ctdb ip all" instead of "ctdb ip -n all"
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 11620aefac77ebeb58cce784d20d4415d227f4ee Author: Anoop C S <anoo...@redhat.com> Date: Tue Oct 20 11:23:23 2015 +0530 smbd/quotas: Remove invalid quota status switch case getquota_rslt structure from rquota.h defines the enum named status whose values start from 1. But in quotas.c we have an invalid check for status 0. This change is to remove that particular switch case. Signed-off-by: Anoop C S <anoo...@redhat.com> Reviewed-by: Michael Adam <ob...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Sat Oct 24 01:31:21 CEST 2015 on sn-devel-104 commit 3e6af7109eb9d49328b426095580e4bfb2338ceb Author: Andrew Bartlett <abart...@samba.org> Date: Thu Oct 22 13:54:41 2015 +1300 autobuild: Confirm we can build without --enable-developer We also confirm that such builds do not contain the NTVFS file server Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit d7cc5d459cbb063de9e5ff82487c383c00beb610 Author: Andrew Bartlett <abart...@samba.org> Date: Thu Oct 22 12:01:48 2015 +1300 Add samba4.smb2.create.mkdir-dup(ad_dc_ntvfs) as flapping Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 71dcc76b70d8e249624f9bf057fc4fd3a44125e1 Author: Andrew Bartlett <abart...@samba.org> Date: Sat Oct 10 09:30:17 2015 +1300 build: Enable NTVFS file server to be omitted We now only build it by default with --enable-sefltest, or otherwise if requested. The NTVFS file server still has features not present in the smbd file server, such as a CIFS/SMB proxy, and a radically different design, but it is also not undergoing any ongoing development so this keeps it in a safe state for care and maintaince, with less of a security risk if such an issue were to come up. Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: python/pyglue.c | 11 +++++++++++ python/samba/__init__.py | 1 + python/samba/netcmd/domain.py | 37 ++++++++++++++++++++++++++++------- script/autobuild.py | 9 +++++---- selftest/flapping | 1 + source3/smbd/quotas.c | 17 +++++++--------- source4/smb_server/smb/wscript_build | 2 +- source4/smb_server/smb2/wscript_build | 2 +- source4/smb_server/wscript_build | 4 ++-- source4/torture/rpc/rpc.c | 2 +- source4/torture/wscript_build | 14 +++++++------ wscript | 22 +++++++++++++++++++++ 12 files changed, 90 insertions(+), 32 deletions(-) Changeset truncated at 500 lines: diff --git a/python/pyglue.c b/python/pyglue.c index 3fc6e38..81244a2 100644 --- a/python/pyglue.c +++ b/python/pyglue.c @@ -121,6 +121,15 @@ static PyObject *py_get_debug_level(PyObject *self) return PyInt_FromLong(DEBUGLEVEL); } +static PyObject *py_is_ntvfs_fileserver_built(PyObject *self) +{ +#ifdef WITH_NTVFS_FILESERVER + Py_RETURN_TRUE; +#else + Py_RETURN_FALSE; +#endif +} + /* return the list of interface IPs we have configured takes an loadparm context, returns a list of IPs in string form @@ -267,6 +276,8 @@ static PyMethodDef py_misc_methods[] = { "(for testing) compare two strings using Samba's strcasecmp_m()"}, { "strstr_m", (PyCFunction)py_strstr_m, METH_VARARGS, "(for testing) find one string in another with Samba's strstr_m()"}, + { "is_ntvfs_fileserver_built", (PyCFunction)py_is_ntvfs_fileserver_built, METH_NOARGS, + "is the NTVFS file server built in this installation?" }, { NULL } }; diff --git a/python/samba/__init__.py b/python/samba/__init__.py index 84b0b1f..b04e83c 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -374,3 +374,4 @@ unix2nttime = _glue.unix2nttime generate_random_password = _glue.generate_random_password strcasecmp_m = _glue.strcasecmp_m strstr_m = _glue.strstr_m +is_ntvfs_fileserver_built = _glue.is_ntvfs_fileserver_built diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index 250fdf9..9e6fe71 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -224,7 +224,7 @@ class cmd_domain_provision(Command): Option("--ol-mmr-urls", type="string", metavar="LDAPSERVER", help="List of LDAP-URLS [ ldap://<FQHN>:<PORT>/ (where <PORT> has to be different than 389!) ] separated with comma (\",\") for use with OpenLDAP-MMR (Multi-Master-Replication), e.g.: \"ldap://s4dc1:9000,ldap://s4dc2:9000\""), Option("--use-xattrs", type="choice", choices=["yes", "no", "auto"], help="Define if we should use the native fs capabilities or a tdb file for storing attributes likes ntacl, auto tries to make an inteligent guess based on the user rights and system capabilities", default="auto"), - Option("--use-ntvfs", action="store_true", help="Use NTVFS for the fileserver (default = no)"), + Option("--use-rfc2307", action="store_true", help="Use AD to store posix attributes (default = no)"), ] @@ -239,9 +239,16 @@ class cmd_domain_provision(Command): Option("--ldap-backend-nosync", help="Configure LDAP backend not to call fsync() (for performance in test environments)", action="store_true"), ] + ntvfs_options = [ + Option("--use-ntvfs", action="store_true", help="Use NTVFS for the fileserver (default = no)"), + ] + if os.getenv('TEST_LDAP', "no") == "yes": takes_options.extend(openldap_options) + if samba.is_ntvfs_fileserver_built(): + takes_options.extend(ntvfs_options) + takes_args = [] def run(self, sambaopts=None, versionopts=None, @@ -490,8 +497,6 @@ class cmd_domain_dcpromo(Command): action="store_true"), Option("--machinepass", type=str, metavar="PASSWORD", help="choose machine password (otherwise random)"), - Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)", - action="store_true"), Option("--dns-backend", type="choice", metavar="NAMESERVER-BACKEND", choices=["SAMBA_INTERNAL", "BIND9_DLZ", "NONE"], help="The DNS server backend. SAMBA_INTERNAL is the builtin name server (default), " @@ -502,6 +507,14 @@ class cmd_domain_dcpromo(Command): Option("--verbose", help="Be verbose", action="store_true") ] + ntvfs_options = [ + Option("--use-ntvfs", action="store_true", help="Use NTVFS for the fileserver (default = no)"), + ] + + if samba.is_ntvfs_fileserver_built(): + takes_options.extend(ntvfs_options) + + takes_args = ["domain", "role?"] def run(self, domain, role=None, sambaopts=None, credopts=None, @@ -569,8 +582,6 @@ class cmd_domain_join(Command): help="choose machine password (otherwise random)"), Option("--adminpass", type="string", metavar="PASSWORD", help="choose adminstrator password when joining as a subdomain (otherwise random)"), - Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)", - action="store_true"), Option("--dns-backend", type="choice", metavar="NAMESERVER-BACKEND", choices=["SAMBA_INTERNAL", "BIND9_DLZ", "NONE"], help="The DNS server backend. SAMBA_INTERNAL is the builtin name server (default), " @@ -581,6 +592,13 @@ class cmd_domain_join(Command): Option("--verbose", help="Be verbose", action="store_true") ] + ntvfs_options = [ + Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)", + action="store_true") + ] + if samba.is_ntvfs_fileserver_built(): + takes_options.extend(ntvfs_options) + takes_args = ["domain", "role?"] def run(self, domain, role=None, sambaopts=None, credopts=None, @@ -1358,8 +1376,6 @@ class cmd_domain_classicupgrade(Command): Option("--verbose", help="Be verbose", action="store_true"), Option("--use-xattrs", type="choice", choices=["yes","no","auto"], metavar="[yes|no|auto]", help="Define if we should use the native fs capabilities or a tdb file for storing attributes likes ntacl, auto tries to make an inteligent guess based on the user rights and system capabilities", default="auto"), - Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)", - action="store_true"), Option("--dns-backend", type="choice", metavar="NAMESERVER-BACKEND", choices=["SAMBA_INTERNAL", "BIND9_FLATFILE", "BIND9_DLZ", "NONE"], help="The DNS server backend. SAMBA_INTERNAL is the builtin name server (default), " @@ -1369,6 +1385,13 @@ class cmd_domain_classicupgrade(Command): default="SAMBA_INTERNAL") ] + ntvfs_options = [ + Option("--use-ntvfs", help="Use NTVFS for the fileserver (default = no)", + action="store_true") + ] + if samba.is_ntvfs_fileserver_built(): + takes_options.extend(ntvfs_options) + takes_args = ["smbconf"] def run(self, smbconf=None, targetdir=None, dbdir=None, testparm=None, diff --git a/script/autobuild.py b/script/autobuild.py index 209ad1f..7e6609f 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -112,10 +112,11 @@ tasks = { ("ldb-make", "cd lib/ldb && make", "text/plain"), ("ldb-install", "cd lib/ldb && make install", "text/plain"), - ("configure", samba_libs_configure_samba, "text/plain"), - ("make", "make", "text/plain"), - ("install", "make install", "text/plain"), - ("dist", "make dist", "text/plain"), + ("nondevel-configure", "./configure ${PREFIX}", "text/plain"), + ("nondevel-make", "make -j", "text/plain"), + ("nondevel-check", "./bin/smbd -b | grep WITH_NTVFS_FILESERVER && exit 1; exit 0", "text/plain"), + ("nondevel-install", "make install", "text/plain"), + ("nondevel-dist", "make dist", "text/plain"), # retry with all modules shared ("allshared-distclean", "make distclean", "text/plain"), diff --git a/selftest/flapping b/selftest/flapping index 8e13dc3..6b7af8e 100644 --- a/selftest/flapping +++ b/selftest/flapping @@ -29,3 +29,4 @@ ^samba4.drs.delete_object.python # flakey on sn-devel ^samba4.blackbox.samba_tool_demote # flakey on sn-devel ^samba4.blackbox.dbcheck # flakey on sn-devel +^samba4.smb2.create.mkdir-dup\(ad_dc_ntvfs\) # This test involves a race, not always protected against in the NTVFS file server diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c index c64b63a..3b23e6b 100644 --- a/source3/smbd/quotas.c +++ b/source3/smbd/quotas.c @@ -171,17 +171,12 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t } /* - * gqr.status returns 0 if the rpc call fails, 1 if quotas exist, 2 if there is - * no quota set, and 3 if no permission to get the quota. If 0 or 3 return - * something sensible. + * gqr.status returns 1 if quotas exist, 2 if there is + * no quota set, and 3 if no permission to get the quota. + * If 3, return something sensible. */ switch (gqr.status) { - case 0: - DEBUG(9,("nfs_quotas: Remote Quotas Failed! Error \"%i\" \n", gqr.status)); - ret = False; - goto out; - case 1: DEBUG(9,("nfs_quotas: Good quota data\n")); D.dqb_bsoftlimit = gqr.getquota_rslt_u.gqr_rquota.rq_bsoftlimit; @@ -197,8 +192,10 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t break; default: - DEBUG(9,("nfs_quotas: Remote Quotas Questionable! Error \"%i\" \n", gqr.status )); - break; + DEBUG(9, ("nfs_quotas: Unknown Remote Quota Status \"%i\"\n", + gqr.status)); + ret = false; + goto out; } DEBUG(10,("nfs_quotas: Let`s look at D a bit closer... status \"%i\" bsize \"%i\" active? \"%i\" bhard \"%i\" bsoft \"%i\" curb \"%i\" \n", diff --git a/source4/smb_server/smb/wscript_build b/source4/smb_server/smb/wscript_build index a17de06..3e3df21 100644 --- a/source4/smb_server/smb/wscript_build +++ b/source4/smb_server/smb/wscript_build @@ -5,6 +5,6 @@ bld.SAMBA_SUBSYSTEM('SMB_PROTOCOL', autoproto='smb_proto.h', deps='dfs_server_ad', public_deps='ntvfs LIBPACKET samba-credentials samba_server_gensec', - enabled=bld.AD_DC_BUILD_IS_ENABLED() + enabled=bld.CONFIG_SET('WITH_NTVFS_FILESERVER') ) diff --git a/source4/smb_server/smb2/wscript_build b/source4/smb_server/smb2/wscript_build index 18a2b29..7866ee9 100644 --- a/source4/smb_server/smb2/wscript_build +++ b/source4/smb_server/smb2/wscript_build @@ -4,6 +4,6 @@ bld.SAMBA_SUBSYSTEM('SMB2_PROTOCOL', source='receive.c negprot.c sesssetup.c tcon.c fileio.c fileinfo.c find.c keepalive.c', autoproto='smb2_proto.h', public_deps='ntvfs LIBPACKET LIBCLI_SMB2 samba_server_gensec NDR_DFSBLOBS', - enabled=bld.AD_DC_BUILD_IS_ENABLED() + enabled=bld.CONFIG_SET('WITH_NTVFS_FILESERVER') ) diff --git a/source4/smb_server/wscript_build b/source4/smb_server/wscript_build index bfeba0e..78298d9 100644 --- a/source4/smb_server/wscript_build +++ b/source4/smb_server/wscript_build @@ -7,14 +7,14 @@ bld.SAMBA_MODULE('service_smb', init_function='server_service_smb_init', deps='SMB_SERVER netif shares samba-hostconfig', internal_module=False, - enabled=bld.AD_DC_BUILD_IS_ENABLED() + enabled=bld.CONFIG_SET('WITH_NTVFS_FILESERVER') ) bld.SAMBA_SUBSYSTEM('SMB_SERVER', source='handle.c tcon.c session.c blob.c management.c smb_server.c', autoproto='smb_server_proto.h', public_deps='share LIBPACKET SMB_PROTOCOL SMB2_PROTOCOL', - enabled=bld.AD_DC_BUILD_IS_ENABLED() + enabled=bld.CONFIG_SET('WITH_NTVFS_FILESERVER') ) bld.RECURSE('smb') diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c index e70fac52..aa16242 100644 --- a/source4/torture/rpc/rpc.c +++ b/source4/torture/rpc/rpc.c @@ -489,7 +489,7 @@ NTSTATUS torture_rpc_init(void) torture_suite_add_suite(suite, torture_rpc_object_uuid(suite)); torture_suite_add_suite(suite, torture_rpc_winreg(suite)); torture_suite_add_suite(suite, torture_rpc_spoolss(suite)); -#ifdef AD_DC_BUILD_IS_ENABLED +#ifdef WITH_NTVFS_FILESERVER torture_suite_add_suite(suite, torture_rpc_spoolss_notify(suite)); #endif torture_suite_add_suite(suite, torture_rpc_spoolss_win(suite)); diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build index a7a14fd..0a5c5cc 100755 --- a/source4/torture/wscript_build +++ b/source4/torture/wscript_build @@ -32,11 +32,13 @@ bld.RECURSE('winbind') bld.RECURSE('libnetapi') bld.RECURSE('libsmbclient') -heimdal_specific = dict(source='', deps='') +ntvfs_specific = dict(source='', deps='') -if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'): - heimdal_specific['source'] += ' rpc/spoolss_notify.c' - heimdal_specific['deps'] += ' SMB_SERVER dcerpc_server ntvfs' +# Yes, the spoolss_notify test uses the NTVFS file server to run the SMB server expected +# to handle the RPC callback! +if bld.CONFIG_SET('WITH_NTVFS_FILESERVER'): + ntvfs_specific['source'] += ' rpc/spoolss_notify.c' + ntvfs_specific['deps'] += ' SMB_SERVER dcerpc_server ntvfs' bld.SAMBA_SUBSYSTEM('TORTURE_NDR', source='''ndr/ndr.c @@ -119,7 +121,7 @@ bld.SAMBA_MODULE('torture_rpc', rpc/clusapi.c rpc/witness.c rpc/backupkey.c - ''' + heimdal_specific['source'], + ''' + ntvfs_specific['source'], autoproto='rpc/proto.h', subsystem='smbtorture', init_function='torture_rpc_init', @@ -165,7 +167,7 @@ bld.SAMBA_MODULE('torture_rpc', RPC_NDR_CLUSAPI RPC_NDR_WITNESS RPC_NDR_BACKUPKEY - ''' + heimdal_specific['deps'], + ''' + ntvfs_specific['deps'], internal_module=True) bld.RECURSE('drs') diff --git a/wscript b/wscript index c11e0c0..c3c3cfd 100644 --- a/wscript +++ b/wscript @@ -53,6 +53,14 @@ def set_options(opt): help='disable AD DC functionality (enables Samba 4 client and Samba 3 code base).', action='store_true', dest='without_ad_dc', default=False) + opt.add_option('--with-ntvfs-fileserver', + help='enable the depricated NTVFS file server from the original Samba4 branch (default if --enable-selftest specicifed). Conflicts with --with-system-mitkrb5 and --without-ad-dc', + action='store_true', dest='with_ntvfs_fileserver') + + opt.add_option('--without-ntvfs-fileserver', + help='disable the depricated NTVFS file server from the original Samba4 branch', + action='store_false', dest='with_ntvfs_fileserver') + opt.add_option('--with-pie', help=("Build Position Independent Executables " + "(default if supported by compiler)"), @@ -132,6 +140,7 @@ def configure(conf): conf.PROCESS_SEPARATE_RULE('system_mitkrb5') if not (Options.options.without_ad_dc or Options.options.with_system_mitkrb5): conf.DEFINE('AD_DC_BUILD_IS_ENABLED', 1) + # Only process heimdal_build for non-MIT KRB5 builds # When MIT KRB5 checks are done as above, conf.env.KRB5_VENDOR will be set # to the lowcased output of 'krb5-config --vendor'. @@ -154,6 +163,19 @@ def configure(conf): conf.RECURSE('lib/resolv_wrapper') conf.RECURSE('lib/socket_wrapper') conf.RECURSE('lib/uid_wrapper') + if Options.options.with_ntvfs_fileserver != False: + if not (Options.options.without_ad_dc or Options.options.with_system_mitkrb5): + conf.DEFINE('WITH_NTVFS_FILESERVER', 1) + if Options.options.with_ntvfs_fileserver == False: + if not (Options.options.without_ad_dc or Options.options.with_system_mitkrb5): + raise Utils.WafError('--without-ntvfs-fileserver conflicts with --enable-selftest while building the AD DC') + + if Options.options.with_ntvfs_fileserver == True: + if Options.options.without_ad_dc: + raise Utils.WafError('--with-ntvfs-fileserver conflicts with --without-ad-dc') + if Options.options.with_system_mitkrb5: + raise Utils.WafError('--with-ntvfs-fileserver conflicts with --with-system-mitkrb5') + conf.DEFINE('WITH_NTVFS_FILESERVER', 1) conf.RECURSE('source3') conf.RECURSE('lib/texpect') if conf.env.with_ctdb: -- Samba Shared Repository