Rev 11386: Deprecate subcontext(). in file:///home/jelmer/bzr.samba/SAMBA_4_0/

Jelmer Vernooij jelmer at samba.org
Wed Feb 7 14:21:48 GMT 2007


At file:///home/jelmer/bzr.samba/SAMBA_4_0/

------------------------------------------------------------
revno: 11386
revision-id: jelmer at samba.org-20070207142119-9ll4dxikikq8gkv1
parent: jelmer at samba.org-20070207130631-qpsztafs8ph0m01h
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: SAMBA_4_0
timestamp: Wed 2007-02-07 15:21:19 +0100
message:
  Deprecate subcontext().
added:
  source/pidl/tests/ndr_deprecations.pl ndr_deprecations.pl-20070207141838-38btwf0hx7cwmnhp-1
modified:
  source/librpc/idl/winreg.idl   svn-v2:6 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flibrpc%2fidl%2fwinreg.idl
  source/pidl/TODO               svn-v2:9459 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fpidl%2fTODO
  source/pidl/lib/Parse/Pidl/NDR.pm svn-v2:9460 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fpidl%2flib%2fParse%2fPidl%2fNDR.pm
  source/pidl/tests/ndr_represent.pl* svn-v2:14687 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fpidl%2ftests%2fndr_represent.pl
  source/script/tests/mktestsetup.sh svn-v2:16522 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2fmktestsetup.sh
  source/script/tests/selftest.sh svn-v2:6564 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2fselftest.sh
  source/script/tests/tests_all.sh svn-v2:8525 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2ftests_all.sh
  source/torture/smbtorture.c    svn-v2:14520 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2ftorture%2fsmbtorture.c
  source/torture/torture.c       svn-v2:2 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-trunk-source%2ftorture%2ftorture.c
=== added file 'source/pidl/tests/ndr_deprecations.pl'
--- a/source/pidl/tests/ndr_deprecations.pl	1970-01-01 00:00:00 +0000
+++ b/source/pidl/tests/ndr_deprecations.pl	2007-02-07 14:21:19 +0000
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+# (C) 2007 Jelmer Vernooij <jelmer at samba.org>
+# Published under the GNU General Public License
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+use FindBin qw($RealBin);
+use lib "$RealBin";
+use Util;
+use Parse::Pidl::Util qw(MyDumper);
+use Parse::Pidl::NDR qw(ValidElement);
+
+# Case 1
+
+my $e = {
+	'FILE' => 'foo.idl',
+	'NAME' => 'v',
+	'PROPERTIES' => {"subcontext" => 1},
+	'POINTERS' => 0,
+	'TYPE' => 'uint8',
+	'PARENT' => { TYPE => 'STRUCT' },
+	'LINE' => 42 };
+
+test_warnings("foo.idl:42: subcontext() is deprecated. Use represent_as() instead\n", 
+	sub { ValidElement($e); });
+
+

=== modified file 'source/librpc/idl/winreg.idl'
--- a/source/librpc/idl/winreg.idl	2006-11-22 18:06:08 +0000
+++ b/source/librpc/idl/winreg.idl	2007-02-07 14:21:19 +0000
@@ -140,6 +140,8 @@
 		[size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name;
 	} winreg_StringBuf;
 
+	/******************/
+	/* Function: 0x09 */
 	WERROR winreg_EnumKey(
 		[in,ref]        policy_handle    *handle,
 		[in]            uint32           enum_index,
@@ -148,17 +150,26 @@
 		[in,out,unique] NTTIME           *last_changed_time
 	);
 
+	typedef struct {
+		[value(strlen_m_term(name)*2)] uint16 length; 
+		/* size cannot be auto-set by value() as it is the
+		   amount of space the server is allowed to use for this
+		   string in the reply, not its current size */
+		uint16 size;
+		[size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name;
+	} winreg_ValNameBuf;
+
 	/******************/
 	/* Function: 0x0a */
 
 	WERROR winreg_EnumValue(
 		[in,ref]        policy_handle *handle,
 		[in]            uint32 enum_index,
-		[in,out,ref]    winreg_StringBuf *name,
-		[in,out,unique] winreg_Type *type,
-		[in,out,unique,size_is(*size),length_is(*length)] uint8 *value,
-		[in,out,unique] uint32 *size,
-		[in,out,unique] uint32 *length
+		[in,out,ref]    winreg_ValNameBuf *name,
+		[in,out,ref]    winreg_Type **type,
+		[in,out,ref,size_is(**data_size),length_is(**value_length)] uint8 **data,
+		[in,out,ref]    uint32 **data_size,
+		[in,out,ref]    uint32 **value_length
 	);
 
 	/******************/
@@ -209,11 +220,10 @@
 	/* Function: 0x10 */
 	WERROR winreg_QueryInfoKey(
 		[in,ref] policy_handle *handle,
-		[in] winreg_String class_in,
-		[out,unique] winreg_String *class_out,
+		[in,out,ref] winreg_String *classname,
 		[out,ref] uint32 *num_subkeys,
 		[out,ref] uint32 *max_subkeylen,
-		[out,ref] uint32 *max_subkeysize,
+		[out,ref] uint32 *max_classlen,
 		[out,ref] uint32 *num_values,
 		[out,ref] uint32 *max_valnamelen,
 		[out,ref] uint32 *max_valbufsize,
@@ -227,9 +237,9 @@
 		[in,ref] policy_handle *handle,
 		[in] winreg_String value_name,
 		[in,out] winreg_Type *type,
-		[in,out,size_is(*size),length_is(*length)] uint8 *data,
-		[in,out] uint32 *size,
-		[in,out] uint32 *length
+		[in,out,size_is(*data_size),length_is(*value_length)] uint8 *data,
+		[in,out] uint32 *data_size,
+		[in,out] uint32 *value_length
 	);
 
 	/******************/
@@ -240,11 +250,24 @@
 	/******************/
 	/* Function: 0x13 */
 	WERROR winreg_RestoreKey(
+		[in,ref] policy_handle *handle,
+		[in,ref] winreg_String *filename,
+		[in]     uint32 flags 
 	);
 
 	/******************/
 	/* Function: 0x14 */
+
+	typedef struct {
+		uint32 data_size;
+		KeySecurityData sec_data;
+		uint8 inherit;
+	} KeySecurityAttribute;
+
 	WERROR winreg_SaveKey(
+		[in,ref] policy_handle *handle,
+		[in,ref] winreg_String *filename,
+		[in,unique] KeySecurityAttribute *sec_attrib
 	);
 
 	/******************/
@@ -252,7 +275,7 @@
 	WERROR winreg_SetKeySecurity(
 		[in,ref] policy_handle *handle,
 		[in] winreg_AccessMask access_mask,
-		[in,out,ref] KeySecurityData *sd
+		[in,ref] KeySecurityData *sd
 	);
 
 	/******************/

=== modified file 'source/pidl/TODO'
--- a/source/pidl/TODO	2006-09-15 20:07:55 +0000
+++ b/source/pidl/TODO	2007-02-07 14:21:19 +0000
@@ -1,8 +1,6 @@
 - EJS output backend shouldn't use the NDR levels stuff but instead 
   as the "C levels" and NDR levels don't necessarily match.
 
-- warn about [out] attributes on pointers (midl/samba3 compatibility)
-
 - true multiple dimension array / strings in arrays support
 
 - compatibility mode for generating MIDL-readable data:

=== modified file 'source/pidl/lib/Parse/Pidl/NDR.pm'
--- a/source/pidl/lib/Parse/Pidl/NDR.pm	2007-01-09 15:50:36 +0000
+++ b/source/pidl/lib/Parse/Pidl/NDR.pm	2007-02-07 14:21:19 +0000
@@ -35,7 +35,7 @@
 $VERSION = '0.01';
 @ISA = qw(Exporter);
 @EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred ContainsString);
- at EXPORT_OK = qw(GetElementLevelTable ParseElement);
+ at EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement);
 
 use strict;
 use Parse::Pidl qw(warning fatal);
@@ -902,7 +902,6 @@
 		}
 	}
 
-
 	if (has_property($e, "subcontext") and has_property($e, "represent_as")) {
 		fatal($e, el_name($e) . " : subcontext() and represent_as() can not be used on the same element");
 	}
@@ -919,6 +918,10 @@
 		fatal($e, el_name($e) . " : represent_as() and value() can not be used on the same element");
 	}
 
+	if (has_property($e, "subcontext")) {
+		warning($e, "subcontext() is deprecated. Use represent_as() instead");
+	}
+
 	if (defined (has_property($e, "subcontext_size")) and not defined(has_property($e, "subcontext"))) {
 		fatal($e, el_name($e) . " : subcontext_size() on non-subcontext element");
 	}

=== modified file 'source/pidl/tests/ndr_represent.pl' (properties changed)
=== modified file 'source/script/tests/mktestsetup.sh'
--- a/source/script/tests/mktestsetup.sh	2007-01-31 07:08:36 +0000
+++ b/source/script/tests/mktestsetup.sh	2007-02-07 14:21:19 +0000
@@ -273,30 +273,30 @@
 
 $srcdir/bin/ldbadd -H $PRIVATEDIR/wins_config.ldb < $PRIVATEDIR/wins_config.ldif >/dev/null || exit 1
 
-echo "KRB5_CONFIG=$KRB5_CONFIG"
-echo "PREFIX_ABS=$PREFIX_ABS"
-echo "TEST_DATA_PREFIX=$TEST_DATA_PREFIX"
-echo "CONFIGURATION=$CONFIGURATION"
-echo "CONFFILE=$CONFFILE"
-echo "SLAPD_CONF=$SLAPD_CONF"
-echo "PIDDIR=$PIDDIR"
-echo "AUTH=$AUTH"
-echo "SERVER=$SERVER"
-echo "NETBIOSNAME=$NETBIOSNAME"
-echo "LDAP_URI=$LDAP_URI"
-echo "LDAP_URI_ESCAPE=$LDAP_URI_ESCAPE"
-echo "FEDORA_DS_INF=$FEDORA_DS_INF"
-echo "DOMAIN=$DOMAIN"
-echo "USERNAME=$USERNAME"
-echo "REALM=$REALM"
-echo "DNSNAME=$DNSNAME"
-echo "BASEDN=$BASEDN"
-echo "PASSWORD=$PASSWORD"
-echo "AUTH=$AUTH"
-echo "SRCDIR=$SRCDIR"
-echo "ROOT=$ROOT"
-echo "SERVER=$SERVER"
-echo "NETBIOSNAME=$NETBIOSNAME"
-echo "PREFIX=$PREFIX"
-echo "SMBD_LOGLEVEL=$SMBD_LOGLEVEL"
-echo "LDAPDIR=$LDAPDIR"
+echo "KRB5_CONFIG=\"$KRB5_CONFIG"\""
+echo "PREFIX_ABS=\"$PREFIX_ABS"\""
+echo "TEST_DATA_PREFIX=\"$TEST_DATA_PREFIX"\""
+echo "CONFIGURATION=\"$CONFIGURATION"\""
+echo "CONFFILE=\"$CONFFILE"\""
+echo "SLAPD_CONF=\"$SLAPD_CONF"\""
+echo "PIDDIR=\"$PIDDIR"\""
+echo "AUTH=\"$AUTH"\""
+echo "SERVER=\"$SERVER"\""
+echo "NETBIOSNAME=\"$NETBIOSNAME"\""
+echo "LDAP_URI=\"$LDAP_URI"\""
+echo "LDAP_URI_ESCAPE=\"$LDAP_URI_ESCAPE"\""
+echo "FEDORA_DS_INF=\"$FEDORA_DS_INF"\""
+echo "DOMAIN=\"$DOMAIN"\""
+echo "USERNAME=\"$USERNAME"\""
+echo "REALM=\"$REALM"\""
+echo "DNSNAME=\"$DNSNAME"\""
+echo "BASEDN=\"$BASEDN"\""
+echo "PASSWORD=\"$PASSWORD"\""
+echo "AUTH=\"$AUTH"\""
+echo "SRCDIR=\"$SRCDIR"\""
+echo "ROOT=\"$ROOT"\""
+echo "SERVER=\"$SERVER"\""
+echo "NETBIOSNAME=\"$NETBIOSNAME"\""
+echo "PREFIX=\"$PREFIX"\""
+echo "SMBD_LOGLEVEL=\"$SMBD_LOGLEVEL\""
+echo "LDAPDIR=\"$LDAPDIR"\""

=== modified file 'source/script/tests/selftest.sh'
--- a/source/script/tests/selftest.sh	2007-01-31 01:28:55 +0000
+++ b/source/script/tests/selftest.sh	2007-02-07 14:21:19 +0000
@@ -52,7 +52,12 @@
 
 incdir=`dirname $ARG0`
 echo -n "PROVISIONING..."
-. $incdir/mktestsetup.sh $PREFIX >/dev/null || exit 1
+$incdir/mktestsetup.sh $PREFIX > vars
+cat vars | while read x
+do
+	eval $x
+	export `cut -d = -f 1`
+done
 echo "DONE"
 
 PATH=bin:$PATH

=== modified file 'source/script/tests/tests_all.sh'
--- a/source/script/tests/tests_all.sh	2007-01-26 13:43:21 +0000
+++ b/source/script/tests/tests_all.sh	2007-02-07 14:21:19 +0000
@@ -1,10 +1,10 @@
 #!/bin/sh
+ $SRCDIR/script/tests/test_session_key.sh $SERVER $USERNAME $PASSWORD $DOMAIN $NETBIOSNAME
  $SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD
  $SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD
  $SRCDIR/script/tests/test_nbt.sh $SERVER
  $SRCDIR/script/tests/test_rpc.sh $SERVER $USERNAME $PASSWORD $DOMAIN
  $SRCDIR/script/tests/test_net.sh $SERVER $USERNAME $PASSWORD $DOMAIN
- $SRCDIR/script/tests/test_session_key.sh $SERVER $USERNAME $PASSWORD $DOMAIN $NETBIOSNAME
  $SRCDIR/script/tests/test_binding_string.sh $SERVER $USERNAME $PASSWORD $DOMAIN
  $SRCDIR/script/tests/test_echo.sh $SERVER $USERNAME $PASSWORD $DOMAIN
  $SRCDIR/script/tests/test_posix.sh //$SERVER/tmp $USERNAME $PASSWORD ""

=== modified file 'source/torture/smbtorture.c'
--- a/source/torture/smbtorture.c	2007-01-30 12:10:42 +0000
+++ b/source/torture/smbtorture.c	2007-02-07 14:21:19 +0000
@@ -583,10 +583,8 @@
 
 	if (strcmp(target, "samba3") == 0) {
 		lp_set_cmdline("torture:samba3", "true");
-		lp_set_cmdline("torture:knownfail", "samba3-knownfail");
 	} else if (strcmp(target, "samba4") == 0) {
 		lp_set_cmdline("torture:samba4", "true");
-		lp_set_cmdline("torture:knownfail", "samba4-knownfail");
 	}
 
 	if (max_runtime) {
@@ -662,8 +660,7 @@
 		exit(1);
 	}
 
-	torture = torture_context_init(talloc_autofree_context(), 
-				lp_parm_string(-1, "torture", "knownfail"), ui_ops);
+	torture = torture_context_init(talloc_autofree_context(), ui_ops);
 
 	if (argc_new == 0) {
 		printf("You must specify a test to run, or 'ALL'\n");

=== modified file 'source/torture/torture.c'
--- a/source/torture/torture.c	2007-01-31 00:30:52 +0000
+++ b/source/torture/torture.c	2007-02-07 14:21:19 +0000
@@ -42,7 +42,6 @@
 }
 
 struct torture_context *torture_context_init(TALLOC_CTX *mem_ctx, 
-											 const char *known_failures_file, 
 											 const struct torture_ui_ops *ui_ops)
 {
 	struct torture_context *torture = talloc_zero(mem_ctx, 



More information about the samba-cvs mailing list