~ubuntu-branches/ubuntu/wily/samba/wily

« back to all changes in this revision

Viewing changes to .pc/CVE-2012-1182-2.patch/source3/librpc/gen_ndr/ndr_printcap.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-05-15 17:00:56 UTC
  • mfrom: (178.1.1 precise-security) (0.39.27 sid)
  • Revision ID: package-import@ubuntu.com-20120515170056-gludtas4257eb61q
Tags: 2:3.6.5-2ubuntu1
* Merge from Debian unstable, remaining changes: 
  + debian/patches/VERSION.patch:
    - set 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.
    - Other changes now in Debian packaging.
  + 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/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.install: install profile.
    - debian/control: have samba suggest ufw.
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba-common-bin.install: install hook.
  + Switch to upstart:
    - Added debian/samba.{nmbd,smbd}.upstart.
    - debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
      Make upstart compatible.
* d/samba.install, d/samba-common-bin.install: Restore apport hook and ufw
  profile (LP: #999764).
* Dropped:
  + debian/patches/CVE-2012-1182-*.patch: fixed in upstream release 3.6.4.
  + debian/patches/CVE-2012-2111.patch: fixed in upstream release 3.6.5.
  + debian/patches/fix-debuglevel-name-conflict.patch: fixed upstream -
    debug_level is no longer used as a global variable name.
  + debian/patches/error-trans.fix-276472: fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* parser auto-generated by pidl */
2
 
 
3
 
#include "includes.h"
4
 
#include "librpc/gen_ndr/ndr_printcap.h"
5
 
 
6
 
static enum ndr_err_code ndr_push_pcap_printer(struct ndr_push *ndr, int ndr_flags, const struct pcap_printer *r)
7
 
{
8
 
        if (ndr_flags & NDR_SCALARS) {
9
 
                NDR_CHECK(ndr_push_align(ndr, 5));
10
 
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
11
 
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
12
 
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->location));
13
 
                NDR_CHECK(ndr_push_trailer_align(ndr, 5));
14
 
        }
15
 
        if (ndr_flags & NDR_BUFFERS) {
16
 
                if (r->name) {
17
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
18
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
19
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
20
 
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
21
 
                }
22
 
                if (r->info) {
23
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->info, CH_UTF8)));
24
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
25
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->info, CH_UTF8)));
26
 
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->info, ndr_charset_length(r->info, CH_UTF8), sizeof(uint8_t), CH_UTF8));
27
 
                }
28
 
                if (r->location) {
29
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF8)));
30
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
31
 
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF8)));
32
 
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->location, ndr_charset_length(r->location, CH_UTF8), sizeof(uint8_t), CH_UTF8));
33
 
                }
34
 
        }
35
 
        return NDR_ERR_SUCCESS;
36
 
}
37
 
 
38
 
static enum ndr_err_code ndr_pull_pcap_printer(struct ndr_pull *ndr, int ndr_flags, struct pcap_printer *r)
39
 
{
40
 
        uint32_t _ptr_name;
41
 
        TALLOC_CTX *_mem_save_name_0;
42
 
        uint32_t _ptr_info;
43
 
        TALLOC_CTX *_mem_save_info_0;
44
 
        uint32_t _ptr_location;
45
 
        TALLOC_CTX *_mem_save_location_0;
46
 
        if (ndr_flags & NDR_SCALARS) {
47
 
                NDR_CHECK(ndr_pull_align(ndr, 5));
48
 
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
49
 
                if (_ptr_name) {
50
 
                        NDR_PULL_ALLOC(ndr, r->name);
51
 
                } else {
52
 
                        r->name = NULL;
53
 
                }
54
 
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
55
 
                if (_ptr_info) {
56
 
                        NDR_PULL_ALLOC(ndr, r->info);
57
 
                } else {
58
 
                        r->info = NULL;
59
 
                }
60
 
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_location));
61
 
                if (_ptr_location) {
62
 
                        NDR_PULL_ALLOC(ndr, r->location);
63
 
                } else {
64
 
                        r->location = NULL;
65
 
                }
66
 
                NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
67
 
        }
68
 
        if (ndr_flags & NDR_BUFFERS) {
69
 
                if (r->name) {
70
 
                        _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
71
 
                        NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
72
 
                        NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
73
 
                        NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
74
 
                        if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
75
 
                                return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name));
76
 
                        }
77
 
                        NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint8_t)));
78
 
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint8_t), CH_UTF8));
79
 
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
80
 
                }
81
 
                if (r->info) {
82
 
                        _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
83
 
                        NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
84
 
                        NDR_CHECK(ndr_pull_array_size(ndr, &r->info));
85
 
                        NDR_CHECK(ndr_pull_array_length(ndr, &r->info));
86
 
                        if (ndr_get_array_length(ndr, &r->info) > ndr_get_array_size(ndr, &r->info)) {
87
 
                                return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->info), ndr_get_array_length(ndr, &r->info));
88
 
                        }
89
 
                        NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->info), sizeof(uint8_t)));
90
 
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->info, ndr_get_array_length(ndr, &r->info), sizeof(uint8_t), CH_UTF8));
91
 
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
92
 
                }
93
 
                if (r->location) {
94
 
                        _mem_save_location_0 = NDR_PULL_GET_MEM_CTX(ndr);
95
 
                        NDR_PULL_SET_MEM_CTX(ndr, r->location, 0);
96
 
                        NDR_CHECK(ndr_pull_array_size(ndr, &r->location));
97
 
                        NDR_CHECK(ndr_pull_array_length(ndr, &r->location));
98
 
                        if (ndr_get_array_length(ndr, &r->location) > ndr_get_array_size(ndr, &r->location)) {
99
 
                                return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->location), ndr_get_array_length(ndr, &r->location));
100
 
                        }
101
 
                        NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->location), sizeof(uint8_t)));
102
 
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->location, ndr_get_array_length(ndr, &r->location), sizeof(uint8_t), CH_UTF8));
103
 
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_location_0, 0);
104
 
                }
105
 
        }
106
 
        return NDR_ERR_SUCCESS;
107
 
}
108
 
 
109
 
_PUBLIC_ void ndr_print_pcap_printer(struct ndr_print *ndr, const char *name, const struct pcap_printer *r)
110
 
{
111
 
        ndr_print_struct(ndr, name, "pcap_printer");
112
 
        if (r == NULL) { ndr_print_null(ndr); return; }
113
 
        ndr->depth++;
114
 
        ndr_print_ptr(ndr, "name", r->name);
115
 
        ndr->depth++;
116
 
        if (r->name) {
117
 
                ndr_print_string(ndr, "name", r->name);
118
 
        }
119
 
        ndr->depth--;
120
 
        ndr_print_ptr(ndr, "info", r->info);
121
 
        ndr->depth++;
122
 
        if (r->info) {
123
 
                ndr_print_string(ndr, "info", r->info);
124
 
        }
125
 
        ndr->depth--;
126
 
        ndr_print_ptr(ndr, "location", r->location);
127
 
        ndr->depth++;
128
 
        if (r->location) {
129
 
                ndr_print_string(ndr, "location", r->location);
130
 
        }
131
 
        ndr->depth--;
132
 
        ndr->depth--;
133
 
}
134
 
 
135
 
_PUBLIC_ enum ndr_err_code ndr_push_pcap_data(struct ndr_push *ndr, int ndr_flags, const struct pcap_data *r)
136
 
{
137
 
        uint32_t cntr_printers_0;
138
 
        if (ndr_flags & NDR_SCALARS) {
139
 
                NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
140
 
                NDR_CHECK(ndr_push_align(ndr, 5));
141
 
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
142
 
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
143
 
                for (cntr_printers_0 = 0; cntr_printers_0 < r->count; cntr_printers_0++) {
144
 
                        NDR_CHECK(ndr_push_pcap_printer(ndr, NDR_SCALARS, &r->printers[cntr_printers_0]));
145
 
                }
146
 
                NDR_CHECK(ndr_push_trailer_align(ndr, 5));
147
 
        }
148
 
        if (ndr_flags & NDR_BUFFERS) {
149
 
                for (cntr_printers_0 = 0; cntr_printers_0 < r->count; cntr_printers_0++) {
150
 
                        NDR_CHECK(ndr_push_pcap_printer(ndr, NDR_BUFFERS, &r->printers[cntr_printers_0]));
151
 
                }
152
 
        }
153
 
        return NDR_ERR_SUCCESS;
154
 
}
155
 
 
156
 
_PUBLIC_ enum ndr_err_code ndr_pull_pcap_data(struct ndr_pull *ndr, int ndr_flags, struct pcap_data *r)
157
 
{
158
 
        uint32_t cntr_printers_0;
159
 
        TALLOC_CTX *_mem_save_printers_0;
160
 
        if (ndr_flags & NDR_SCALARS) {
161
 
                NDR_CHECK(ndr_pull_array_size(ndr, &r->printers));
162
 
                NDR_CHECK(ndr_pull_align(ndr, 5));
163
 
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
164
 
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
165
 
                NDR_PULL_ALLOC_N(ndr, r->printers, ndr_get_array_size(ndr, &r->printers));
166
 
                _mem_save_printers_0 = NDR_PULL_GET_MEM_CTX(ndr);
167
 
                NDR_PULL_SET_MEM_CTX(ndr, r->printers, 0);
168
 
                for (cntr_printers_0 = 0; cntr_printers_0 < r->count; cntr_printers_0++) {
169
 
                        NDR_CHECK(ndr_pull_pcap_printer(ndr, NDR_SCALARS, &r->printers[cntr_printers_0]));
170
 
                }
171
 
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printers_0, 0);
172
 
                if (r->printers) {
173
 
                        NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->printers, r->count));
174
 
                }
175
 
                NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
176
 
        }
177
 
        if (ndr_flags & NDR_BUFFERS) {
178
 
                _mem_save_printers_0 = NDR_PULL_GET_MEM_CTX(ndr);
179
 
                NDR_PULL_SET_MEM_CTX(ndr, r->printers, 0);
180
 
                for (cntr_printers_0 = 0; cntr_printers_0 < r->count; cntr_printers_0++) {
181
 
                        NDR_CHECK(ndr_pull_pcap_printer(ndr, NDR_BUFFERS, &r->printers[cntr_printers_0]));
182
 
                }
183
 
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printers_0, 0);
184
 
        }
185
 
        return NDR_ERR_SUCCESS;
186
 
}
187
 
 
188
 
_PUBLIC_ void ndr_print_pcap_data(struct ndr_print *ndr, const char *name, const struct pcap_data *r)
189
 
{
190
 
        uint32_t cntr_printers_0;
191
 
        ndr_print_struct(ndr, name, "pcap_data");
192
 
        if (r == NULL) { ndr_print_null(ndr); return; }
193
 
        ndr->depth++;
194
 
        ndr_print_NTSTATUS(ndr, "status", r->status);
195
 
        ndr_print_uint32(ndr, "count", r->count);
196
 
        ndr->print(ndr, "%s: ARRAY(%d)", "printers", (int)r->count);
197
 
        ndr->depth++;
198
 
        for (cntr_printers_0=0;cntr_printers_0<r->count;cntr_printers_0++) {
199
 
                ndr_print_pcap_printer(ndr, "printers", &r->printers[cntr_printers_0]);
200
 
        }
201
 
        ndr->depth--;
202
 
        ndr->depth--;
203
 
}
204