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

« back to all changes in this revision

Viewing changes to examples/VFS/skel_transparent.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:
23
23
 
24
24
 
25
25
#include "includes.h"
 
26
#include "smbd/proto.h"
26
27
 
27
28
/* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE 
28
29
   SAMBA DEVELOPERS GUIDE!!!!!!
64
65
        return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq);
65
66
}
66
67
 
67
 
static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
 
68
static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels)
68
69
{
69
70
        return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels);
70
71
}
84
85
        return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
85
86
}
86
87
 
 
88
static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attr)
 
89
{
 
90
        return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
 
91
}
 
92
 
87
93
static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
88
94
                                       SMB_STRUCT_DIR *dirp,
89
95
                                       SMB_STRUCT_STAT *sbuf)
143
149
                                uint32_t file_attributes,
144
150
                                uint32_t oplock_request,
145
151
                                uint64_t allocation_size,
 
152
                                uint32_t private_flags,
146
153
                                struct security_descriptor *sd,
147
154
                                struct ea_list *ea_list,
148
155
                                files_struct **result,
159
166
                                file_attributes,
160
167
                                oplock_request,
161
168
                                allocation_size,
 
169
                                private_flags,
162
170
                                sd,
163
171
                                ea_list,
164
172
                                result,
290
298
        return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
291
299
}
292
300
 
 
301
static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp,
 
302
                        enum vfs_fallocate_mode mode,
 
303
                        SMB_OFF_T offset,
 
304
                        SMB_OFF_T len)
 
305
{
 
306
        return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
 
307
}
 
308
 
293
309
static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
294
310
{
295
311
        return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
330
346
        return SMB_VFS_NEXT_MKNOD(handle, path, mode, dev);
331
347
}
332
348
 
333
 
static char *skel_realpath(vfs_handle_struct *handle,  const char *path, char *resolved_path)
 
349
static char *skel_realpath(vfs_handle_struct *handle,  const char *path)
334
350
{
335
 
        return SMB_VFS_NEXT_REALPATH(handle, path, resolved_path);
 
351
        return SMB_VFS_NEXT_REALPATH(handle, path);
336
352
}
337
353
 
338
354
static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
453
469
}
454
470
 
455
471
static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
456
 
        uint32 security_info, SEC_DESC **ppdesc)
 
472
        uint32 security_info, struct security_descriptor **ppdesc)
457
473
{
458
474
        return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
459
475
}
460
476
 
461
477
static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
462
 
        const char *name, uint32 security_info, SEC_DESC **ppdesc)
 
478
        const char *name, uint32 security_info, struct security_descriptor **ppdesc)
463
479
{
464
480
        return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
465
481
}
466
482
 
467
483
static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
468
 
        uint32 security_info_sent, const SEC_DESC *psd)
 
484
        uint32 security_info_sent, const struct security_descriptor *psd)
469
485
{
470
486
        return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
471
487
}
691
707
        return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
692
708
}
693
709
 
694
 
static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
 
710
static bool skel_is_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname, SMB_STRUCT_STAT *sbuf)
695
711
{
696
 
        return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf);
 
712
        return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
697
713
}
698
714
 
699
 
static int skel_set_offline(struct vfs_handle_struct *handle, const char *path)
 
715
static int skel_set_offline(struct vfs_handle_struct *handle, const struct smb_filename *fname)
700
716
{
701
 
        return SMB_VFS_NEXT_SET_OFFLINE(handle, path);
 
717
        return SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
702
718
}
703
719
 
704
720
/* VFS operations structure */
718
734
        /* Directory operations */
719
735
 
720
736
        .opendir = skel_opendir,
 
737
        .fdopendir = skel_fdopendir,
721
738
        .readdir = skel_readdir,
722
739
        .seekdir = skel_seekdir,
723
740
        .telldir = skel_telldir,
729
746
 
730
747
        /* File operations */
731
748
 
732
 
        .open = skel_open,
 
749
        .open_fn = skel_open,
733
750
        .create_file = skel_create_file,
734
751
        .close_fn = skel_close_fn,
735
752
        .vfs_read = skel_vfs_read,
755
772
        .getwd = skel_getwd,
756
773
        .ntimes = skel_ntimes,
757
774
        .ftruncate = skel_ftruncate,
 
775
        .fallocate = skel_fallocate,
758
776
        .lock = skel_lock,
759
777
        .kernel_flock = skel_kernel_flock,
760
778
        .linux_setlease = skel_linux_setlease,