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

« back to all changes in this revision

Viewing changes to source/pidl/lib/Parse/Pidl/ODL.pm

  • 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
##########################################
 
2
# Converts ODL stuctures to IDL structures
 
3
# (C) 2004-2005, 2008 Jelmer Vernooij <jelmer@samba.org>
 
4
 
 
5
package Parse::Pidl::ODL;
 
6
 
 
7
use Parse::Pidl qw(error);
 
8
use Parse::Pidl::IDL;
 
9
use Parse::Pidl::Util qw(has_property unmake_str);
 
10
use Parse::Pidl::Typelist qw(hasType getType);
 
11
use strict;
 
12
 
 
13
use vars qw($VERSION);
 
14
$VERSION = '0.01';
 
15
 
 
16
sub FunctionAddObjArgs($)
 
17
{
 
18
        my $e = shift;
 
19
 
 
20
        unshift(@{$e->{ELEMENTS}}, {
 
21
                'NAME' => 'ORPCthis',
 
22
                'POINTERS' => 0,
 
23
                'PROPERTIES' => { 'in' => '1' },
 
24
                'TYPE' => 'ORPCTHIS',
 
25
                'FILE' => $e->{FILE},
 
26
                'LINE' => $e->{LINE}
 
27
        });
 
28
        unshift(@{$e->{ELEMENTS}}, {
 
29
                'NAME' => 'ORPCthat',
 
30
                'POINTERS' => 1,
 
31
                'PROPERTIES' => { 'out' => '1', 'ref' => '1' },
 
32
                'TYPE' => 'ORPCTHAT',
 
33
                'FILE' => $e->{FILE},
 
34
                'LINE' => $e->{LINE}
 
35
        });
 
36
}
 
37
 
 
38
sub ReplaceInterfacePointers($)
 
39
{
 
40
        my ($e) = @_;
 
41
        foreach my $x (@{$e->{ELEMENTS}}) {
 
42
                next unless (hasType($x->{TYPE}));
 
43
                next unless getType($x->{TYPE})->{DATA}->{TYPE} eq "INTERFACE";
 
44
 
 
45
                $x->{TYPE} = "MInterfacePointer";
 
46
        }
 
47
}
 
48
 
 
49
# Add ORPC specific bits to an interface.
 
50
sub ODL2IDL
 
51
{
 
52
        my ($odl, $basedir, $opt_incdirs) = (@_);
 
53
        my $addedorpc = 0;
 
54
        my $interfaces = {};
 
55
 
 
56
        foreach my $x (@$odl) {
 
57
                if ($x->{TYPE} eq "IMPORT") {
 
58
                        foreach my $idl_file (@{$x->{PATHS}}) {
 
59
                                $idl_file = unmake_str($idl_file);
 
60
                                my $podl = Parse::Pidl::IDL::parse_file("$basedir/$idl_file", $opt_incdirs);
 
61
                                if (defined(@$podl)) {
 
62
                                        require Parse::Pidl::Typelist;
 
63
 
 
64
                                        Parse::Pidl::Typelist::LoadIdl($podl);
 
65
                                        my $pidl = ODL2IDL($podl, $basedir, $opt_incdirs);
 
66
 
 
67
                                        foreach my $y (@$pidl) {
 
68
                                                if ($y->{TYPE} eq "INTERFACE") {
 
69
                                                        $interfaces->{$y->{NAME}} = $y;
 
70
                                                }
 
71
                                        }
 
72
                                } else {
 
73
                                        error($x, "Failed to parse $idl_file");
 
74
                                }
 
75
                        }
 
76
                }
 
77
 
 
78
                if ($x->{TYPE} eq "INTERFACE") {
 
79
                        $interfaces->{$x->{NAME}} = $x;
 
80
                        # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that
 
81
                        # and replace interfacepointers with MInterfacePointer
 
82
                        # for 'object' interfaces
 
83
                        if (has_property($x, "object")) {
 
84
                                foreach my $e (@{$x->{DATA}}) {
 
85
                                        ($e->{TYPE} eq "FUNCTION") && FunctionAddObjArgs($e);
 
86
                                        ReplaceInterfacePointers($e);
 
87
                                }
 
88
                                $addedorpc = 1;
 
89
                        }
 
90
 
 
91
                        if ($x->{BASE}) {
 
92
                                my $base = $interfaces->{$x->{BASE}};
 
93
 
 
94
                                unless (defined($base)) {
 
95
                                        error($x, "Undefined base interface `$x->{BASE}'");
 
96
                                } else {
 
97
                                        foreach my $fn (reverse @{$base->{DATA}}) {
 
98
                                                next unless ($fn->{TYPE} eq "FUNCTION");
 
99
                                                push (@{$x->{INHERITED_FUNCTIONS}}, $fn);
 
100
                                        }
 
101
                                }
 
102
                        }
 
103
                }
 
104
        }
 
105
 
 
106
        unshift (@$odl, {
 
107
                TYPE => "IMPORT",
 
108
                PATHS => [ "\"orpc.idl\"" ],
 
109
                FILE => undef,
 
110
                LINE => undef
 
111
        }) if ($addedorpc);
 
112
 
 
113
 
 
114
        return $odl;
 
115
}
 
116
 
 
117
1;