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

« back to all changes in this revision

Viewing changes to source3/lib/ldb/modules/skel.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:
1
 
/* 
2
 
   ldb database library
3
 
 
4
 
   Copyright (C) Simo Sorce  2004
5
 
 
6
 
     ** NOTE! The following LGPL license applies to the ldb
7
 
     ** library. This does NOT imply that all of Samba is released
8
 
     ** under the LGPL
9
 
   
10
 
   This library is free software; you can redistribute it and/or
11
 
   modify it under the terms of the GNU Lesser General Public
12
 
   License as published by the Free Software Foundation; either
13
 
   version 3 of the License, or (at your option) any later version.
14
 
 
15
 
   This library is distributed in the hope that it will be useful,
16
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
 
   Lesser General Public License for more details.
19
 
 
20
 
   You should have received a copy of the GNU Lesser General Public
21
 
   License along with this library; if not, see <http://www.gnu.org/licenses/>.
22
 
*/
23
 
 
24
 
/*
25
 
 *  Name: ldb
26
 
 *
27
 
 *  Component: ldb skel module
28
 
 *
29
 
 *  Description: example module
30
 
 *
31
 
 *  Author: Simo Sorce
32
 
 */
33
 
 
34
 
#include "includes.h"
35
 
#include "ldb/include/includes.h"
36
 
 
37
 
struct private_data {
38
 
 
39
 
        char *some_private_data;
40
 
};
41
 
 
42
 
/* search */
43
 
static int skel_search(struct ldb_module *module, struct ldb_request *req)
44
 
{
45
 
        return ldb_next_request(module, req);
46
 
}
47
 
 
48
 
/* add */
49
 
static int skel_add(struct ldb_module *module, struct ldb_request *req){
50
 
        return ldb_next_request(module, req);
51
 
}
52
 
 
53
 
/* modify */
54
 
static int skel_modify(struct ldb_module *module, struct ldb_request *req)
55
 
{
56
 
        return ldb_next_request(module, req);
57
 
}
58
 
 
59
 
/* delete */
60
 
static int skel_delete(struct ldb_module *module, struct ldb_request *req)
61
 
{
62
 
        return ldb_next_request(module, req);
63
 
}
64
 
 
65
 
/* rename */
66
 
static int skel_rename(struct ldb_module *module, struct ldb_request *req)
67
 
{
68
 
        return ldb_next_request(module, req);
69
 
}
70
 
 
71
 
/* start a transaction */
72
 
static int skel_start_trans(struct ldb_module *module)
73
 
{
74
 
        return ldb_next_start_trans(module);
75
 
}
76
 
 
77
 
/* end a transaction */
78
 
static int skel_end_trans(struct ldb_module *module)
79
 
{
80
 
        return ldb_next_end_trans(module);
81
 
}
82
 
 
83
 
/* delete a transaction */
84
 
static int skel_del_trans(struct ldb_module *module)
85
 
{
86
 
        return ldb_next_del_trans(module);
87
 
}
88
 
 
89
 
static int skel_destructor(struct ldb_module *ctx)
90
 
{
91
 
        struct private_data *data = talloc_get_type(ctx->private_data, struct private_data);
92
 
        /* put your clean-up functions here */
93
 
        if (data->some_private_data) talloc_free(data->some_private_data);
94
 
        return 0;
95
 
}
96
 
 
97
 
static int skel_request(struct ldb_module *module, struct ldb_request *req)
98
 
{
99
 
        return ldb_next_request(module, req);
100
 
}
101
 
 
102
 
static int skel_init(struct ldb_module *ctx)
103
 
{
104
 
        struct private_data *data;
105
 
 
106
 
        data = talloc(ctx, struct private_data);
107
 
        if (data == NULL) {
108
 
                return 1;
109
 
        }
110
 
 
111
 
        data->some_private_data = NULL;
112
 
        ctx->private_data = data;
113
 
 
114
 
        talloc_set_destructor (ctx, skel_destructor);
115
 
 
116
 
        return ldb_next_init(ctx);
117
 
}
118
 
 
119
 
static const struct ldb_module_ops skel_ops = {
120
 
        .name              = "skel",
121
 
        .init_context      = skel_init,
122
 
        .search            = skel_search,
123
 
        .add               = skel_add,
124
 
        .modify            = skel_modify,
125
 
        .del               = skel_delete,
126
 
        .rename            = skel_rename,
127
 
        .request           = skel_request,
128
 
        .start_transaction = skel_start_trans,
129
 
        .end_transaction   = skel_end_trans,
130
 
        .del_transaction   = skel_del_trans,
131
 
};
132
 
 
133
 
int ldb_skel_init(void)
134
 
{
135
 
        return ldb_register_module(&skel_ops);
136
 
}