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

« back to all changes in this revision

Viewing changes to source3/smbd/dosmode.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-01-29 06:16:15 UTC
  • mfrom: (0.27.9 upstream) (0.34.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100129061615-37hs6xqpsdhjq3ld
Tags: 2:3.4.5~dfsg-1ubuntu1
* Merge from debian testing.  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 additon to authenticated ones.
    - add map to guest = Bad user, maps bad username to gues access.
  + debian/samba-common.conf:
    - 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 libswbclient0 replace/conflict with hardy's likewise-open.
    - Don't build against ctdb, since its not in main yet.
  + 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
  + Add apoort hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + debian/rules, debian/samba.if-up: allow "NetworkManager" as a recognized address
    family... it's obviously /not/ an address family, but it's what gets
    sent when using NM, so we'll cope for now.  (LP: #462169). Taken from karmic-proposed.
  + debian/control: Recommend keyutils for smbfs (LP: #493565)
  + Dropped patches:
    - debian/patches/security-CVE-2009-3297.patch: No longer needed
    - debian/patches/fix-too-many-open-files.patch: No longer needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "includes.h"
22
22
 
 
23
extern enum protocol_types Protocol;
 
24
 
 
25
static uint32_t filter_mode_by_protocol(uint32_t mode)
 
26
{
 
27
        if (Protocol <= PROTOCOL_LANMAN2) {
 
28
                DEBUG(10,("filter_mode_by_protocol: "
 
29
                        "filtering result 0x%x to 0x%x\n",
 
30
                        (unsigned int)mode,
 
31
                        (unsigned int)(mode & 0x3f) ));
 
32
                mode &= 0x3f;
 
33
        }
 
34
        return mode;
 
35
}
 
36
 
23
37
static int set_sparse_flag(const SMB_STRUCT_STAT * const sbuf)
24
38
{
25
39
#if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
341
355
                result |= aHIDDEN;
342
356
        }
343
357
 
 
358
        if (result == 0) {
 
359
                result = FILE_ATTRIBUTE_NORMAL;
 
360
        }
 
361
 
 
362
        result = filter_mode_by_protocol(result);
 
363
 
344
364
        DEBUG(8,("dos_mode_msdfs returning "));
345
365
 
346
366
        if (result & aHIDDEN) DEBUG(8, ("h"));
518
538
                result |= aHIDDEN;
519
539
        }
520
540
 
 
541
        if (result == 0) {
 
542
                result = FILE_ATTRIBUTE_NORMAL;
 
543
        }
 
544
 
 
545
        result = filter_mode_by_protocol(result);
 
546
 
521
547
        DEBUG(8,("dos_mode returning "));
522
548
 
523
549
        if (result & aHIDDEN) DEBUG(8, ("h"));