~ubuntu-branches/ubuntu/maverick/samba/maverick-security

« back to all changes in this revision

Viewing changes to source/pidl/tests/ndr_tagtype.pl

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-03-03 22:02:23 UTC
  • mfrom: (0.28.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090303220223-3bdlm2d9fwx1p1ye
Tags: 2:3.3.1-1ubuntu1
* Merge from Debian unstable (LP: #337094), remaining changes:
  + debian/patches/VERSION.patch:
    - setup SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access. 
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/mksambapasswd.awk:
    - Do not add user with UID less than 1000 to smbpasswd.
  + debian/control:
    - Make libwbclient0 replace/conflict with hardy's likewise-open.
    - Don't build against ctdb.
  + debian/rules:
    - enable "native" PIE hardening.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
* Dropped changes, merged in Debian:
  + debian/libpam-smbpass.pam-config, debian/libpam-smbpass.postinst,
    debian/libpam-smbpass.prerm, debian/libpam-smbpass.files,
    debian/rules:
    - Make libpam-smbpasswd depend on libpam-runtime to allow 
      libpam-smbpasswd for auto-configuration.
  + debian/control:
    - Provide a config block for the new PAM framework to auto-configure
      itself
  + debian/samba.postinst:
    - When populating the new sambashare group, it is not an error
      if the user simply does not exist; test for this case and let
      the install continue instead of aborting.
  + debian/winbind.files:
    - include additional files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# Support for tagged types
 
3
# (C) 2005 Jelmer Vernooij. Published under the GNU GPL
 
4
use strict;
 
5
 
 
6
use Test::More tests => 3 * 8;
 
7
use FindBin qw($RealBin);
 
8
use lib "$RealBin";
 
9
use Util qw(test_samba4_ndr);
 
10
 
 
11
test_samba4_ndr('struct-notypedef', '[public] struct bla { uint8 x; }; ',
 
12
'
 
13
        struct ndr_push *ndr = ndr_push_init_ctx(NULL, NULL);
 
14
        struct bla r;
 
15
        uint8_t expected[] = { 0x0D };
 
16
        DATA_BLOB expected_blob = { expected, 1 };
 
17
        DATA_BLOB result_blob;
 
18
        r.x = 13;
 
19
 
 
20
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_STRUCT_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
 
21
                return 1;
 
22
 
 
23
        result_blob = ndr_push_blob(ndr);
 
24
 
 
25
        if (data_blob_cmp(&result_blob, &expected_blob) != 0)
 
26
                return 2;
 
27
');
 
28
 
 
29
test_samba4_ndr('struct-notypedef-used', '[public] struct bla { uint8 x; };
 
30
        [public] void myfn([in] struct bla r); ',
 
31
'
 
32
        struct ndr_push *ndr = ndr_push_init_ctx(NULL, NULL);
 
33
        struct myfn fn;
 
34
        uint8_t expected[] = { 0x0D };
 
35
        DATA_BLOB expected_blob = { expected, 1 };
 
36
        DATA_BLOB result_blob;
 
37
        fn.in.r.x = 13;
 
38
 
 
39
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_myfn(ndr, NDR_IN, &fn)))
 
40
                return 1;
 
41
 
 
42
        result_blob = ndr_push_blob(ndr);
 
43
 
 
44
        if (data_blob_cmp(&result_blob, &expected_blob) != 0)
 
45
                return 2;
 
46
');
 
47
 
 
48
 
 
49
test_samba4_ndr('struct-notypedef-embedded', 'struct bla { uint8 x; };
 
50
        [public] struct myst { struct bla r; }; ',
 
51
'
 
52
        struct ndr_push *ndr = ndr_push_init_ctx(NULL, NULL);
 
53
        struct myst st;
 
54
        uint8_t expected[] = { 0x0D };
 
55
        DATA_BLOB expected_blob = { expected, 1 };
 
56
        DATA_BLOB result_blob;
 
57
        st.r.x = 13;
 
58
 
 
59
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_STRUCT_myst(ndr, NDR_IN, &st)))
 
60
                return 1;
 
61
 
 
62
        result_blob = ndr_push_blob(ndr);
 
63
 
 
64
        if (data_blob_cmp(&result_blob, &expected_blob) != 0)
 
65
                return 2;
 
66
');