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

« back to all changes in this revision

Viewing changes to source4/rpc_server/srvsvc/srvsvc_ntvfs.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:
21
21
#include "includes.h"
22
22
#include "ntvfs/ntvfs.h"
23
23
#include "rpc_server/dcerpc_server.h"
24
 
#include "librpc/gen_ndr/ndr_srvsvc.h"
25
 
#include "rpc_server/common/common.h"
26
 
#include "rpc_server/srvsvc/proto.h"
27
 
#include "lib/socket/socket.h"
28
24
#include "param/param.h"
29
25
 
30
 
struct socket_address *srvsvc_get_my_addr(void *p, TALLOC_CTX *mem_ctx)
31
 
{
32
 
        struct dcesrv_connection *conn = talloc_get_type(p, struct dcesrv_connection);
33
 
        return dcesrv_connection_get_my_addr(conn, mem_ctx);
34
 
}
35
 
 
36
 
struct socket_address *srvsvc_get_peer_addr(void *p, TALLOC_CTX *mem_ctx)
37
 
{
38
 
        struct dcesrv_connection *conn = talloc_get_type(p, struct dcesrv_connection);
39
 
        return dcesrv_connection_get_peer_addr(conn, mem_ctx);
40
 
}
41
 
 
42
26
struct srvsvc_ntvfs_ctx {
43
27
        struct ntvfs_context *ntvfs;
44
28
};
61
45
        struct share_context *sctx;
62
46
        struct share_config *scfg;
63
47
        const char *sharetype;
 
48
        union smb_tcon tcon;
 
49
        const struct tsocket_address *local_address;
 
50
        const struct tsocket_address *remote_address;
64
51
 
65
 
        status = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
 
52
        status = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
66
53
        if (!NT_STATUS_IS_OK(status)) {
67
54
                return status;
68
55
        }
114
101
        /*
115
102
         * NOTE: we only set the addr callbacks as we're not interesseted in oplocks or in getting file handles
116
103
         */
117
 
        status = ntvfs_set_addr_callbacks(c->ntvfs, srvsvc_get_my_addr, srvsvc_get_peer_addr, dce_call->conn);
 
104
        local_address = dcesrv_connection_get_local_address(dce_call->conn);
 
105
        remote_address = dcesrv_connection_get_remote_address(dce_call->conn);
 
106
        status = ntvfs_set_addresses(c->ntvfs, local_address, remote_address);
118
107
        if (!NT_STATUS_IS_OK(status)) {
119
108
                DEBUG(0,("srvsvc_create_ntvfs_context: NTVFS failed to set the addr callbacks!\n"));
120
109
                return status;
128
117
        NT_STATUS_HAVE_NO_MEMORY(ntvfs_req);
129
118
 
130
119
        /* Invoke NTVFS connection hook */
131
 
        status = ntvfs_connect(ntvfs_req, scfg->name);
 
120
        tcon.tcon.level = RAW_TCON_TCON;
 
121
        ZERO_STRUCT(tcon.tcon.in);
 
122
        tcon.tcon.in.service = scfg->name;
 
123
        status = ntvfs_connect(ntvfs_req, &tcon);
132
124
        if (!NT_STATUS_IS_OK(status)) {
133
125
                DEBUG(0,("srvsvc_create_ntvfs_context: NTVFS ntvfs_connect() failed!\n"));
134
126
                return status;