~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source4/ntvfs/ntvfs_generic.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + 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/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.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.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - 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/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
        time_t write_time = 0;
149
149
        uint32_t set_size = 0;
150
150
        union smb_setfileinfo *sf;
151
 
        uint_t state;
 
151
        unsigned int state;
152
152
 
153
153
        if (!NT_STATUS_IS_OK(status)) {
154
154
                return status;
284
284
                               union smb_open *io2)
285
285
{
286
286
        io2->generic.in.create_options = NTCREATEX_OPTIONS_NON_DIRECTORY_FILE;
 
287
        io2->generic.in.private_flags = 0;
287
288
 
288
289
        if (flags & OPENX_FLAGS_REQUEST_OPLOCK) {
289
290
                io2->generic.in.flags |= NTCREATEX_FLAGS_REQUEST_OPLOCK;
327
328
                break;
328
329
        case OPENX_MODE_DENY_DOS:
329
330
                /* DENY_DOS is quite strange - it depends on the filename! */
330
 
                io2->generic.in.create_options |= 
 
331
                io2->generic.in.private_flags |=
331
332
                        NTCREATEX_OPTIONS_PRIVATE_DENY_DOS;
332
333
                if (is_exe_filename(fname)) {
333
334
                        io2->generic.in.share_access = 
342
343
                }
343
344
                break;
344
345
        case OPENX_MODE_DENY_FCB:
345
 
                io2->generic.in.create_options |= NTCREATEX_OPTIONS_PRIVATE_DENY_FCB;
 
346
                io2->generic.in.private_flags |= NTCREATEX_OPTIONS_PRIVATE_DENY_FCB;
346
347
                io2->generic.in.share_access = NTCREATEX_SHARE_ACCESS_NONE;
347
348
                break;
348
349
        default:
515
516
                        io2->generic.in.flags = 0;
516
517
                        break;
517
518
                }
518
 
                io2->generic.in.root_fid        = 0;
 
519
                io2->generic.in.root_fid.fnum   = 0;
519
520
                io2->generic.in.access_mask     = io->smb2.in.desired_access;
520
521
                io2->generic.in.alloc_size      = io->smb2.in.alloc_size;
521
522
                io2->generic.in.file_attr       = io->smb2.in.file_attributes;
528
529
                io2->generic.in.sec_desc        = io->smb2.in.sec_desc;
529
530
                io2->generic.in.ea_list         = &io->smb2.in.eas;
530
531
                io2->generic.in.query_maximal_access = io->smb2.in.query_maximal_access; 
 
532
                io2->generic.in.private_flags   = 0;
531
533
 
532
534
                /* we don't support timewarp yet */
533
535
                if (io->smb2.in.timewarp != 0) {
579
581
 
580
582
        case RAW_QFS_DSKATTR: {
581
583
                /* map from generic to DSKATTR */
582
 
                uint_t bpunit = 64;
 
584
                unsigned int bpunit = 64;
583
585
 
584
586
                /* we need to scale the sizes to fit */
585
587
                for (bpunit=64; bpunit<0x10000; bpunit *= 2) {
1106
1108
                /* only the first lock gives the UNLOCK bit - see
1107
1109
                   MS-SMB2 3.3.5.14 */
1108
1110
                if (lck->smb2.in.locks[0].flags & SMB2_LOCK_FLAG_UNLOCK) {
 
1111
                        if (lck->smb2.in.locks[0].flags & SMB2_LOCK_FLAG_FAIL_IMMEDIATELY) {
 
1112
                                return NT_STATUS_INVALID_PARAMETER;
 
1113
                        }
1109
1114
                        lck2->generic.in.ulock_cnt = lck->smb2.in.lock_count;
1110
1115
                        isunlock = true;
1111
1116
                } else {
1113
1118
                        isunlock = false;
1114
1119
                }
1115
1120
                for (i=0;i<lck->smb2.in.lock_count;i++) {
 
1121
                        if (!isunlock &&
 
1122
                            lck->smb2.in.locks[i].flags == SMB2_LOCK_FLAG_NONE) {
 
1123
                                return NT_STATUS_INVALID_PARAMETER;
 
1124
                        }
 
1125
 
 
1126
                        if (lck->smb2.in.locks[i].flags & ~SMB2_LOCK_FLAG_ALL_MASK) {
 
1127
                                return NT_STATUS_INVALID_PARAMETER;
 
1128
                        }
 
1129
 
1116
1130
                        if (isunlock && 
1117
1131
                            (lck->smb2.in.locks[i].flags & 
1118
1132
                             (SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_EXCLUSIVE))) {
1175
1189
{
1176
1190
        union smb_lock *lck;
1177
1191
        union smb_close *cl;
1178
 
        uint_t state;
 
1192
        unsigned int state;
1179
1193
 
1180
1194
        if (NT_STATUS_IS_ERR(status)) {
1181
1195
                return status;
1369
1383
        union smb_read *rd2;
1370
1384
        union smb_lock *lck;
1371
1385
        NTSTATUS status;
1372
 
        uint_t state;
 
1386
        unsigned int state;
1373
1387
 
1374
1388
        rd2 = talloc(req, union smb_read);
1375
1389
        if (rd2 == NULL) {