[SCM] Samba Shared Repository - branch master updated

Douglas Bagnall dbagnall at samba.org
Fri Aug 7 04:45:03 UTC 2020


The branch, master has been updated
       via  fc83b470513 libprc/test: add pull_string_array large array test
       via  bf16cd72b28 ndr: fix ndr_pull_string_array() off by one alloc
       via  889c461c009 kdc: Remind us that these values need to match other values
       via  9b7066506ea selftest: Work around existing CA certificates to get PKINIT tests working
       via  b063bbf8fd6 heimdal_build: Add missing dependency on heimbase
       via  d4a9e882f67 Revert "build: fix the coverage build"
       via  fb0412360c2 heimdal_build: Do not allow warnings in the heimdal code!
       via  c51c15144e3 Compile .l files (flex) with the waf rule at runtime
       via  8a148193da0 heimdal_build: provide a prototype with the dummy afs header-only function stubs
       via  e8f5a25fa71 heimdal_build: Include keys.c in the hdb autoproto
       via  cb721715b9d Make HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE available in krb5.h
       via  1663ada9751 heimdal: Exclude more of plugin.c if HAVE_DLOPEN (which Samba unsets) is not set
       via  1687813ec2d heimdal: Use #ifdef HAVE_DLOPEN around function used by HAVE_DLOPEN
       via  4e8f3fdf82a heimdal: Use #ifdef HAVE_DLOPEN around functions used only by HAVE_DLOPEN
       via  ebaa002270c wafsamba: run SAMBA_GENERATOR('VERSION') with group='setup'
      from  04b2db7d885 libsmb: Fix CID 1465656 Resource leak

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


- Log -----------------------------------------------------------------
commit fc83b470513890c30bbb26ebd3a9ab4438b3d4a4
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu Aug 6 17:07:09 2020 +1200

    libprc/test: add pull_string_array large array test
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Douglas Bagnall <dbagnall at samba.org>
    Autobuild-Date(master): Fri Aug  7 04:44:17 UTC 2020 on sn-devel-184

commit bf16cd72b285662bcb4367cd2bdd6eac7655254f
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Aug 5 11:04:11 2020 +1200

    ndr: fix ndr_pull_string_array() off by one alloc
    
    The correct line should have been
    
           talloc_realloc(ndr->current_mem_ctx, a, const char *, count + 2);
    
    because if the loop does not increment count on exit (it exits via
    break), so count is left pointing at the thing that just got put in.
    i.e., if there was one item it is at a[0], count is 0, but we also
    need the trailing NULL byte at a[1] and the length is 2. Thus + 2, not
    + 1.
    
    This will not affect ordinary (that is, non-malicious) traffic,
    because talloc_realloc will not actually realloc unless it is saving a
    kilobyte. Since the allocation grows slowly with the exponent ~1.25,
    the actual reallocs will start happening at some point between 512 and
    1024 items.
    
    In the example we have, there were 666 pointers, and space for 824 was
    allocated.
    
    Rather than doing the +2 realloc, it is simpler to leave it off
    altogether; in the common case (<512 items) it is a no-op anyway, and
    in the best possible case it reduces the temporary array by 20%.
    
    Credit to OSS-Fuzz.
    
    REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24646
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 889c461c009e242fd3ce86b08b87192f21852569
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Sep 19 19:24:32 2018 -0700

    kdc: Remind us that these values need to match other values
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 9b7066506eab6b7e4123f6e40420f9395a424834
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Sep 17 21:44:20 2018 -0700

    selftest: Work around existing CA certificates to get PKINIT tests working
    
    This could be reverted in the future, but for now the certificate validation is not what
    we are testing and this allows the heimdal upgrade to work.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit b063bbf8fd67a1d48c66b3526b13a0f0f92c4b6a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Sep 6 14:55:09 2018 +1200

    heimdal_build: Add missing dependency on heimbase
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit d4a9e882f676e965477adf3e8db8cef9e3851569
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed May 27 21:50:41 2020 +1200

    Revert "build: fix the coverage build"
    
    This reverts commit 3e072b3fb78f0d3132b1d3ce719b8f3706e8491a.
    
    This is no longer required now that --noline is set globally
    and that is a much nicer solution.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit fb0412360c299900fe0991bf31a232eb40b480ed
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Mon Sep 25 14:16:48 2017 +1300

    heimdal_build: Do not allow warnings in the heimdal code!
    
    (const excepted)
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    
    Updated to 2020 requirements since changes in
    13a2f70a4dd6dd68e0dbd0379d35409c5f100f06
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit c51c15144e3fbdd3ebed301a077c687e23882e09
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed May 27 21:31:43 2020 +1200

    Compile .l files (flex) with the waf rule at runtime
    
    Other parts of Samba already compile these directly.
    
    This makes these files compile with modern compiler warnings.
    
    The primary difference (other than being built with a newer
    flex) is the loss of the #include "config.h" but
    this is not used in the other .l files elsewehre and does not
    seem to matter on modern systems.
    
    The generated output from compile_et asn1_compile has not changed
    (so I think the hx509 case is safe).
    
    The mdssvc case just has changed file locations and line numbers.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 8a148193da0ba801f5302a6a2285b39ab6f4d247
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Mon Sep 25 14:16:09 2017 +1300

    heimdal_build: provide a prototype with the dummy afs header-only function stubs
    
    We do not do AFS in Samba
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit e8f5a25fa71e975e2730f4f80ef9427859fec008
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Mon Sep 25 14:00:51 2017 +1300

    heimdal_build: Include keys.c in the hdb autoproto
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit cb721715b9d7423388ce015c08ef425c6b67a49d
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Thu Sep 21 16:19:57 2017 +1200

    Make HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE available in krb5.h
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 1663ada9751d35f10c92149801c5b209b0361ac1
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed May 27 22:18:31 2020 +1200

    heimdal: Exclude more of plugin.c if HAVE_DLOPEN (which Samba unsets) is not set
    
    This allows us to avoid warnings and errors due to unsued variables
    and functions.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 1687813ec2d2609b2f9d65ef2917983d8f255af9
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Mon Sep 25 13:58:10 2017 +1300

    heimdal: Use #ifdef HAVE_DLOPEN around function used by HAVE_DLOPEN
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 4e8f3fdf82ab1ed4ecb8edcc284168dc85dadc49
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Mon Sep 25 14:15:28 2017 +1300

    heimdal: Use #ifdef HAVE_DLOPEN around functions used only by HAVE_DLOPEN
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit ebaa002270caf0efee95ab26757a0a3bf9920de4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Apr 1 23:51:59 2020 +0200

    wafsamba: run SAMBA_GENERATOR('VERSION') with group='setup'
    
    This means this is the first thing that's done.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

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

Summary of changes:
 buildtools/wafsamba/samba_patterns.py             |    1 +
 librpc/ndr/ndr_string.c                           |    2 -
 librpc/tests/test_ndr_string.c                    |   36 +-
 selftest/target/Samba.pm                          |   10 +
 source3/rpc_server/wscript_build                  |   28 +-
 source3/wscript_build                             |    6 +-
 source4/heimdal/lib/asn1/lex.c                    | 2623 ---------------------
 source4/heimdal/lib/com_err/lex.c                 | 1863 ---------------
 source4/heimdal/lib/gssapi/mech/gss_mech_switch.c |    4 +
 source4/heimdal/lib/hx509/sel-lex.c               | 1898 ---------------
 source4/heimdal/lib/krb5/plugin.c                 |   22 +-
 source4/heimdal_build/include/krb5-types.h        |    3 +
 source4/heimdal_build/kafs.h                      |   13 +
 source4/heimdal_build/lexyacc.sh                  |   42 -
 source4/heimdal_build/wscript_build               |   29 +-
 source4/heimdal_build/wscript_configure           |   18 +
 source4/kdc/sdb.h                                 |    2 +
 wscript                                           |    3 +
 18 files changed, 133 insertions(+), 6470 deletions(-)
 delete mode 100644 source4/heimdal/lib/asn1/lex.c
 delete mode 100644 source4/heimdal/lib/com_err/lex.c
 delete mode 100644 source4/heimdal/lib/hx509/sel-lex.c


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index 43422a71f99..bf62ee88070 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -23,6 +23,7 @@ def SAMBA_MKVERSION(bld, target, source='VERSION'):
     # git revision) included in the version.
     t = bld.SAMBA_GENERATOR('VERSION',
                             rule=write_version_header,
+                            group='setup',
                             source=source,
                             target=target,
                             always=bld.is_install)
diff --git a/librpc/ndr/ndr_string.c b/librpc/ndr/ndr_string.c
index bddab9edd51..77efb3e9848 100644
--- a/librpc/ndr/ndr_string.c
+++ b/librpc/ndr/ndr_string.c
@@ -437,8 +437,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string_array(struct ndr_pull *ndr, int ndr_f
 				a[count] = s;
 			}
 		}
-		a = talloc_realloc(ndr->current_mem_ctx, a, const char *, count + 1);
-		NDR_ERR_HAVE_NO_MEMORY(a);
 
 		*_a =a;
 		break;
diff --git a/librpc/tests/test_ndr_string.c b/librpc/tests/test_ndr_string.c
index 571aae42f34..24ec93b17d5 100644
--- a/librpc/tests/test_ndr_string.c
+++ b/librpc/tests/test_ndr_string.c
@@ -159,13 +159,47 @@ static void test_ndr_string_n_length(void **state)
 	assert_int_equal(len, 26);
 }
 
+static void test_pull_string_array(void **state)
+{
+	/* We try pulling long string arrays without long strings */
+	const char **r = NULL;
+	struct ndr_pull ndr = {0};
+	enum ndr_err_code err;
+	TALLOC_CTX *mem_ctx = talloc_new(NULL);
+	size_t len = 1 * 1024 * 1024;
+	uint8_t *data = talloc_array(mem_ctx, uint8_t, len);
+	size_t i;
+
+	for (i = 0; i < len; i++) {
+		data[i] = (i & 1) ? '\0' : 'X';
+	}
+
+	ndr.current_mem_ctx = mem_ctx;
+
+	ndr.flags = (LIBNDR_FLAG_REF_ALLOC |
+		     LIBNDR_FLAG_REMAINING |
+		     LIBNDR_FLAG_STR_NULLTERM |
+		     LIBNDR_FLAG_STR_RAW8);
+	ndr.data = data;
+	ndr.data_size = len;
+
+	err = ndr_pull_string_array(&ndr, NDR_SCALARS, &r);
+	assert_int_equal(err, NDR_ERR_SUCCESS);
+	assert_string_equal(r[0], "X");
+	assert_string_equal(r[len / 3], "X");
+	assert_string_equal(r[len / 2 - 1], "X");
+	assert_ptr_equal(r[len / 2], NULL);
+	TALLOC_FREE(mem_ctx);
+}
+
 int main(int argc, const char **argv)
 {
 	const struct CMUnitTest tests[] = {
 		cmocka_unit_test(test_pull_string_zero_len_nul_term),
 		cmocka_unit_test(test_pull_string_len_1_nul_term),
 		cmocka_unit_test(test_pull_string_len_2_nul_term),
-		cmocka_unit_test(test_ndr_string_n_length)
+		cmocka_unit_test(test_ndr_string_n_length),
+		cmocka_unit_test(test_pull_string_array)
 	};
 
 	cmocka_set_message_output(CM_OUTPUT_SUBUNIT);
diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm
index 6118f2e243a..0d7e13b7e66 100644
--- a/selftest/target/Samba.pm
+++ b/selftest/target/Samba.pm
@@ -362,26 +362,36 @@ sub mk_realms_stanza($$$$)
 	my ($realm, $dnsname, $domain, $kdc_ipv4) = @_;
 	my $lc_domain = lc($domain);
 
+	# The   pkinit_require_krbtgt_otherName = false
+	# is just because the certificates we have saved
+	# do not have the realm in the subjectAltName
+	# (specially encoded as a principal)
+	# per
+	# https://github.com/heimdal/heimdal/wiki/Setting-up-PK-INIT-and-Certificates
 	my $realms_stanza = "
  $realm = {
   kdc = $kdc_ipv4:88
   admin_server = $kdc_ipv4:88
   default_domain = $dnsname
+  pkinit_require_krbtgt_otherName = false
  }
  $dnsname = {
   kdc = $kdc_ipv4:88
   admin_server = $kdc_ipv4:88
   default_domain = $dnsname
+  pkinit_require_krbtgt_otherName = false
  }
  $domain = {
   kdc = $kdc_ipv4:88
   admin_server = $kdc_ipv4:88
   default_domain = $dnsname
+  pkinit_require_krbtgt_otherName = false
  }
  $lc_domain = {
   kdc = $kdc_ipv4:88
   admin_server = $kdc_ipv4:88
   default_domain = $dnsname
+  pkinit_require_krbtgt_otherName = false
  }
 
 ";
diff --git a/source3/rpc_server/wscript_build b/source3/rpc_server/wscript_build
index 2af02ad6fa8..e61c362ef72 100644
--- a/source3/rpc_server/wscript_build
+++ b/source3/rpc_server/wscript_build
@@ -134,42 +134,18 @@ if bld.env.spotlight_backend_tracker:
                           mdssvc/mdssvc_tracker.c
                           mdssvc/sparql_mapping.c
                           mdssvc/sparql_parser.y
+                          mdssvc/sparql_lexer.l
                           '''
     rpc_mdssvc_deps += 'tevent-glib-glue ' + bld.env['libtracker']
-    # flex adds "#line nnn <stdout>" to the generated source
-    # which then causes issues with lcov, so need to filter out those
-    # lines. We need to use a different target name, as the default flex rule
-    # will also build sparql_lexer.lex.c
-    bld.SAMBA_GENERATOR(
-        "sparql_lexer.gcov.lex.c",
-        group='build_source',
-        source="mdssvc/sparql_lexer.l",
-        target="mdssvc/sparql_lexer.gcov.lex.c",
-        rule='${FLEX} ${FLEXFLAGS} ${SRC} |'
-             'grep -v "#line.*<stdout>" >${TGT}')
-    rpc_mdssvc_sources += ' mdssvc/sparql_lexer.gcov.lex.c'
 
 if bld.env.spotlight_backend_es:
     rpc_mdssvc_sources += '''
                           mdssvc/mdssvc_es.c
                           mdssvc/es_mapping.c
                           mdssvc/es_parser.y
+                          mdssvc/es_lexer.l
                           '''
     rpc_mdssvc_deps += ' http jansson'
-
-    # flex adds "#line nnn <stdout>" to the generated source
-    # which then causes issues with lcov, so need to filter out those
-    # lines. We need to use a different target name, as the default flex rule
-    # will also build es_lexer.lex.c
-    bld.SAMBA_GENERATOR(
-        "es_lexer.gcov.lex.c",
-        group='build_source',
-        source="mdssvc/es_lexer.l",
-        target="mdssvc/es_lexer.gcov.lex.c",
-        rule='${FLEX} ${FLEXFLAGS} ${SRC} |'
-             'grep -v "#line.*<stdout>" >${TGT}')
-    rpc_mdssvc_sources += ' mdssvc/es_lexer.gcov.lex.c'
-
     if bld.SAMBA3_IS_ENABLED_MODULE('rpc_mdssvc_module'):
         bld.INSTALL_FILES(bld.env.SAMBA_DATADIR,
                           'mdssvc/elasticsearch_mappings.json')
diff --git a/source3/wscript_build b/source3/wscript_build
index ec8135c302f..cf2dd1a4120 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -1266,7 +1266,7 @@ bld.SAMBA3_BINARY('test_mdsparser_es',
                  source='''
                  rpc_server/mdssvc/test_mdsparser_es.c
                  rpc_server/mdssvc/es_parser.y
-                 rpc_server/mdssvc/es_lexer.gcov.lex.c
+                 rpc_server/mdssvc/es_lexer.l
                  rpc_server/mdssvc/es_mapping.c
                  ''',
                  deps='''
@@ -1358,7 +1358,7 @@ bld.SAMBA3_BINARY('spotlight2sparql',
                  source='''
                  rpc_server/mdssvc/sparql_parser_test.c
                  rpc_server/mdssvc/sparql_parser.y
-                 rpc_server/mdssvc/sparql_lexer.gcov.lex.c
+                 rpc_server/mdssvc/sparql_lexer.l
                  rpc_server/mdssvc/sparql_mapping.c''',
                  deps='samba3-util talloc ' + bld.env['libtracker'],
                  enabled=bld.env.spotlight_backend_tracker,
@@ -1368,7 +1368,7 @@ bld.SAMBA3_BINARY('spotlight2es',
                  source='''
                  rpc_server/mdssvc/es_parser_test.c
                  rpc_server/mdssvc/es_parser.y
-                 rpc_server/mdssvc/es_lexer.gcov.lex.c
+                 rpc_server/mdssvc/es_lexer.l
                  rpc_server/mdssvc/es_mapping.c''',
                  deps='samba3-util talloc jansson smbconf',
                  enabled=bld.env.spotlight_backend_es,
diff --git a/source4/heimdal/lib/asn1/lex.c b/source4/heimdal/lib/asn1/lex.c
deleted file mode 100644
index 3069f242776..00000000000
--- a/source4/heimdal/lib/asn1/lex.c
+++ /dev/null
@@ -1,2623 +0,0 @@
-#include "config.h"
-
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin  )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-extern int yyleng;
-
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    #define YY_LESS_LINENO(n)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		*yy_cp = (yy_hold_char); \
-		YY_RESTORE_YY_MORE_OFFSET \
-		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr)  )
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-
-	};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
-                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;		/* whether we need to initialize */
-static int yy_start = 0;	/* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart (FILE *input_file  );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
-void yy_delete_buffer (YY_BUFFER_STATE b  );
-void yy_flush_buffer (YY_BUFFER_STATE b  );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void yypop_buffer_state (void );
-
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );


-- 
Samba Shared Repository



More information about the samba-cvs mailing list