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

« back to all changes in this revision

Viewing changes to source3/modules/gpfs.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:
18
18
 */
19
19
 
20
20
#include "includes.h"
 
21
#include "system/filesys.h"
 
22
#include "smbd/smbd.h"
21
23
 
22
24
#ifdef HAVE_GPFS
23
25
 
 
26
#include "libcli/security/security.h"
24
27
#include "gpfs_gpl.h"
25
28
#include "vfs_gpfs.h"
26
29
 
38
41
static int (*gpfs_get_winattrs_path_fn)(char *pathname, struct gpfs_winattr *attrs);
39
42
static int (*gpfs_get_winattrs_fn)(int fd, struct gpfs_winattr *attrs);
40
43
static int (*gpfs_ftruncate_fn)(int fd, gpfs_off64_t length);
 
44
static int (*gpfs_lib_init_fn)(int flags);
41
45
 
42
46
bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
43
47
                        uint32 share_access)
132
136
        return gpfs_putacl_fn(pathname, flags, acl);
133
137
}
134
138
 
135
 
int smbd_gpfs_ftrunctate(int fd, gpfs_off64_t length)
 
139
int smbd_gpfs_ftruncate(int fd, gpfs_off64_t length)
136
140
{
137
 
       if (!gpfs_do_ftruncate || (gpfs_ftruncate_fn == NULL)) {
138
 
               errno = ENOSYS;
139
 
               return -1;
140
 
       }
 
141
        if (!gpfs_do_ftruncate || (gpfs_ftruncate_fn == NULL)) {
 
142
                errno = ENOSYS;
 
143
                return -1;
 
144
        }
141
145
 
142
 
       return gpfs_ftruncate_fn(fd, length);
 
146
        return gpfs_ftruncate_fn(fd, length);
143
147
}
144
148
 
145
149
int smbd_gpfs_get_realfilename_path(char *pathname, char *filenamep,
187
191
        return gpfs_set_winattrs_path_fn(pathname,flags, attrs);
188
192
}
189
193
 
 
194
void smbd_gpfs_lib_init()
 
195
{
 
196
        if (gpfs_lib_init_fn) {
 
197
                int rc = gpfs_lib_init_fn(0);
 
198
                DEBUG(10, ("gpfs_lib_init() finished with rc %d "
 
199
                           "and errno %d\n", rc, errno));
 
200
        } else {
 
201
                DEBUG(10, ("libgpfs lacks gpfs_lib_init\n"));
 
202
        }
 
203
}
 
204
 
190
205
static bool init_gpfs_function_lib(void *plibhandle_pointer,
191
206
                                   const char *libname,
192
207
                                   void *pfn_pointer, const char *fn_name)
248
263
        init_gpfs_function(&gpfs_get_winattrs_path_fn,"gpfs_get_winattrs_path");
249
264
        init_gpfs_function(&gpfs_set_winattrs_path_fn,"gpfs_set_winattrs_path");
250
265
        init_gpfs_function(&gpfs_get_winattrs_fn,"gpfs_get_winattrs");
251
 
        init_gpfs_function(&gpfs_ftruncate_fn,"gpfs_ftruncate");
 
266
        init_gpfs_function(&gpfs_ftruncate_fn, "gpfs_ftruncate");
 
267
        init_gpfs_function(&gpfs_lib_init_fn,"gpfs_lib_init");
252
268
 
253
269
        gpfs_getrealfilename = lp_parm_bool(-1, "gpfs", "getrealfilename",
254
270
                                            True);
255
271
        gpfs_winattr = lp_parm_bool(-1, "gpfs", "winattr", False);
256
 
 
257
272
        gpfs_do_ftruncate = lp_parm_bool(-1, "gpfs", "ftruncate", True);
258
273
 
259
274
        return;
310
325
        return -1;
311
326
}
312
327
 
 
328
void smbd_gpfs_lib_init()
 
329
{
 
330
        return;
 
331
}
 
332
 
313
333
void init_gpfs(void)
314
334
{
315
335
        return;