~ubuntu-branches/ubuntu/oneiric/samba/oneiric-security

« back to all changes in this revision

Viewing changes to source3/libsmb/clidgram.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-03-10 10:03:01 UTC
  • mfrom: (0.39.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110310100301-jfjg41wv0iq05zj4
Tags: 2:3.5.8~dfsg-1ubuntu1
* 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.
    - 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/mksmbpasswd.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 or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
    - Add cuups breaks to push the package to aslo upgrade cups (LP: #639768)
  + debian/rules:
    - enable "native" PIE hardening.
    - Add BIND_NOW to maximize benefit of RELRO 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
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
    - Don't ship the /etc/network/if-up.d file.
  + debian/samba.postinst: 
    - Fixed bashism.
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/samba.logrotate: Make it upstart compatible
  + debian/samba-common.dhcp: Fix typo to get a proper parsing in
    /etc/samba/dhcp.
  + Dropped:
    - debian/patches/fix-windows7-print-connection.patch: Merged upstream.
    - debian/patches/security-CVE-2011-0719.patch: Merged upstream. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
 
239
239
        if (blob.length < 4) {
240
240
                DEBUG(0,("invalid length: %d\n", (int)blob.length));
 
241
                free_packet(packet);
241
242
                return false;
242
243
        }
243
244
 
244
245
        if (RIVAL(blob.data,0) != DGRAM_SMB) {
245
246
                DEBUG(0,("invalid packet\n"));
 
247
                free_packet(packet);
246
248
                return false;
247
249
        }
248
250
 
253
255
                       (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet);
254
256
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
255
257
                DEBUG(0,("failed to parse packet\n"));
 
258
                free_packet(packet);
256
259
                return false;
257
260
        }
258
261
 
259
262
        if (p.smb.smb_command != SMB_TRANSACTION) {
260
263
                DEBUG(0,("invalid smb_command: %d\n", p.smb.smb_command));
 
264
                free_packet(packet);
261
265
                return false;
262
266
        }
263
267
 
271
275
 
272
276
        status = pull_netlogon_samlogon_response(&blob, mem_ctx, NULL, &r);
273
277
        if (!NT_STATUS_IS_OK(status)) {
 
278
                free_packet(packet);
274
279
                return false;
275
280
        }
276
281
 
285
290
        if (!strequal(returned_domain, domain_name)) {
286
291
                DEBUG(3, ("GetDC: Expected domain %s, got %s\n",
287
292
                          domain_name, returned_domain));
 
293
                free_packet(packet);
288
294
                return false;
289
295
        }
290
296
 
291
297
        *dc_name = talloc_strdup(mem_ctx, returned_dc);
292
298
        if (!*dc_name) {
 
299
                free_packet(packet);
293
300
                return false;
294
301
        }
295
302
 
300
307
                *_r = (struct netlogon_samlogon_response *)talloc_memdup(
301
308
                        mem_ctx, &r, sizeof(struct netlogon_samlogon_response));
302
309
                if (!*_r) {
 
310
                free_packet(packet);
303
311
                        return false;
304
312
                }
305
313
        }
307
315
        DEBUG(10, ("GetDC gave name %s for domain %s\n",
308
316
                   *dc_name, returned_domain));
309
317
 
 
318
        free_packet(packet);
310
319
        return True;
311
320
}