~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source4/param/share_classic.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:
47
47
{
48
48
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
49
49
                                                     struct loadparm_service);
50
 
        struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, 
 
50
        struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
51
51
                                                          struct loadparm_context);
52
52
        char *parm, *val;
53
53
        const char *ret;
61
61
                *val = '\0';
62
62
                val++;
63
63
 
64
 
                ret = lp_parm_string(lp_ctx, s, parm, val);
 
64
                ret = lpcfg_parm_string(lp_ctx, s, parm, val);
65
65
                if (!ret) {
66
66
                        ret = defval;
67
67
                }
74
74
        }
75
75
 
76
76
        if (strcmp(opt_name, SHARE_PATH) == 0) {
77
 
                return lp_pathname(s, lp_default_service(lp_ctx));
 
77
                return lpcfg_pathname(s, lpcfg_default_service(lp_ctx));
78
78
        }
79
79
 
80
80
        if (strcmp(opt_name, SHARE_COMMENT) == 0) {
81
 
                return lp_comment(s, lp_default_service(lp_ctx));
 
81
                return lpcfg_comment(s, lpcfg_default_service(lp_ctx));
82
82
        }
83
83
 
84
84
        if (strcmp(opt_name, SHARE_VOLUME) == 0) {
85
 
                return volume_label(s, lp_default_service(lp_ctx));
 
85
                return volume_label(s, lpcfg_default_service(lp_ctx));
86
86
        }
87
87
 
88
88
        if (strcmp(opt_name, SHARE_TYPE) == 0) {
89
 
                if (lp_print_ok(s, lp_default_service(lp_ctx))) {
 
89
                if (lpcfg_print_ok(s, lpcfg_default_service(lp_ctx))) {
90
90
                        return "PRINTER";
91
91
                }
92
 
                if (strcmp("NTFS", lp_fstype(s, lp_default_service(lp_ctx))) == 0) {
 
92
                if (strcmp("NTFS", lpcfg_fstype(s, lpcfg_default_service(lp_ctx))) == 0) {
93
93
                        return "DISK";
94
94
                }
95
 
                return lp_fstype(s, lp_default_service(lp_ctx));
 
95
                return lpcfg_fstype(s, lpcfg_default_service(lp_ctx));
96
96
        }
97
97
 
98
98
        if (strcmp(opt_name, SHARE_PASSWORD) == 0) {
109
109
{
110
110
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
111
111
                                                     struct loadparm_service);
112
 
        struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, 
 
112
        struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
113
113
                                                          struct loadparm_context);
114
114
        char *parm, *val;
115
115
        int ret;
123
123
                *val = '\0';
124
124
                val++;
125
125
 
126
 
                ret = lp_parm_int(lp_ctx, s, parm, val, defval);
 
126
                ret = lpcfg_parm_int(lp_ctx, s, parm, val, defval);
127
127
                if (!ret) {
128
128
                        ret = defval;
129
129
                }
132
132
        }
133
133
 
134
134
        if (strcmp(opt_name, SHARE_CSC_POLICY) == 0) {
135
 
                return lp_csc_policy(s, lp_default_service(lp_ctx));
 
135
                return lpcfg_csc_policy(s, lpcfg_default_service(lp_ctx));
136
136
        }
137
137
 
138
138
        if (strcmp(opt_name, SHARE_MAX_CONNECTIONS) == 0) {
139
 
                return lp_max_connections(s, lp_default_service(lp_ctx));
 
139
                return lpcfg_max_connections(s, lpcfg_default_service(lp_ctx));
140
140
        }
141
141
 
142
142
        if (strcmp(opt_name, SHARE_CREATE_MASK) == 0) {
143
 
                return lp_create_mask(s, lp_default_service(lp_ctx));
 
143
                return lpcfg_create_mask(s, lpcfg_default_service(lp_ctx));
144
144
        }
145
145
 
146
146
        if (strcmp(opt_name, SHARE_DIR_MASK) == 0) {
147
 
                return lp_dir_mask(s, lp_default_service(lp_ctx));
 
147
                return lpcfg_dir_mask(s, lpcfg_default_service(lp_ctx));
148
148
        }
149
149
 
150
150
        if (strcmp(opt_name, SHARE_FORCE_DIR_MODE) == 0) {
151
 
                return lp_force_dir_mode(s, lp_default_service(lp_ctx));
 
151
                return lpcfg_force_dir_mode(s, lpcfg_default_service(lp_ctx));
152
152
        }
153
153
 
154
154
        if (strcmp(opt_name, SHARE_FORCE_CREATE_MODE) == 0) {
155
 
                return lp_force_create_mode(s, lp_default_service(lp_ctx));
 
155
                return lpcfg_force_create_mode(s, lpcfg_default_service(lp_ctx));
156
156
        }
157
157
 
158
158
 
167
167
{
168
168
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
169
169
                                                     struct loadparm_service);
170
 
        struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, 
 
170
        struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
171
171
                                                          struct loadparm_context);
172
172
        char *parm, *val;
173
173
        bool ret;
181
181
                *val = '\0';
182
182
                val++;
183
183
 
184
 
                ret = lp_parm_bool(lp_ctx, s, parm, val, defval);
 
184
                ret = lpcfg_parm_bool(lp_ctx, s, parm, val, defval);
185
185
                talloc_free(parm);
186
186
                return ret;
187
187
        }
191
191
        }
192
192
 
193
193
        if (strcmp(opt_name, SHARE_BROWSEABLE) == 0) {
194
 
                return lp_browseable(s, lp_default_service(lp_ctx));
 
194
                return lpcfg_browseable(s, lpcfg_default_service(lp_ctx));
195
195
        }
196
196
 
197
197
        if (strcmp(opt_name, SHARE_READONLY) == 0) {
198
 
                return lp_readonly(s, lp_default_service(lp_ctx));
 
198
                return lpcfg_readonly(s, lpcfg_default_service(lp_ctx));
199
199
        }
200
200
 
201
201
        if (strcmp(opt_name, SHARE_MAP_SYSTEM) == 0) {
202
 
                return lp_map_system(s, lp_default_service(lp_ctx));
 
202
                return lpcfg_map_system(s, lpcfg_default_service(lp_ctx));
203
203
        }
204
204
 
205
205
        if (strcmp(opt_name, SHARE_MAP_HIDDEN) == 0) {
206
 
                return lp_map_hidden(s, lp_default_service(lp_ctx));
 
206
                return lpcfg_map_hidden(s, lpcfg_default_service(lp_ctx));
207
207
        }
208
208
 
209
209
        if (strcmp(opt_name, SHARE_MAP_ARCHIVE) == 0) {
210
 
                return lp_map_archive(s, lp_default_service(lp_ctx));
 
210
                return lpcfg_map_archive(s, lpcfg_default_service(lp_ctx));
211
211
        }
212
212
 
213
213
        if (strcmp(opt_name, SHARE_STRICT_LOCKING) == 0) {
214
 
                return lp_strict_locking(s, lp_default_service(lp_ctx));
 
214
                return lpcfg_strict_locking(s, lpcfg_default_service(lp_ctx));
215
215
        }
216
216
 
217
217
        if (strcmp(opt_name, SHARE_OPLOCKS) == 0) {
218
 
                return lp_oplocks(s, lp_default_service(lp_ctx));
 
218
                return lpcfg_oplocks(s, lpcfg_default_service(lp_ctx));
219
219
        }
220
220
 
221
221
        if (strcmp(opt_name, SHARE_STRICT_SYNC) == 0) {
222
 
                return lp_strict_sync(s, lp_default_service(lp_ctx));
 
222
                return lpcfg_strict_sync(s, lpcfg_default_service(lp_ctx));
223
223
        }
224
224
 
225
225
        if (strcmp(opt_name, SHARE_MSDFS_ROOT) == 0) {
226
 
                return lp_msdfs_root(s, lp_default_service(lp_ctx));
 
226
                return lpcfg_msdfs_root(s, lpcfg_default_service(lp_ctx));
227
227
        }
228
228
 
229
229
        if (strcmp(opt_name, SHARE_CI_FILESYSTEM) == 0) {
230
 
                return lp_ci_filesystem(s, lp_default_service(lp_ctx));
 
230
                return lpcfg_ci_filesystem(s, lpcfg_default_service(lp_ctx));
231
231
        }
232
232
 
233
233
        DEBUG(0,("request for unknown share bool option '%s'\n",
240
240
{
241
241
        struct loadparm_service *s = talloc_get_type(scfg->opaque, 
242
242
                                                     struct loadparm_service);
243
 
        struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, 
 
243
        struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
244
244
                                                          struct loadparm_context);
245
245
        char *parm, *val;
246
246
        const char **ret;
254
254
                *val = '\0';
255
255
                val++;
256
256
 
257
 
                ret = lp_parm_string_list(mem_ctx, lp_ctx, s, parm, val, ",;");
 
257
                ret = lpcfg_parm_string_list(mem_ctx, lp_ctx, s, parm, val, ",;");
258
258
                talloc_free(parm);
259
259
                return ret;
260
260
        }
261
261
 
262
262
        if (strcmp(opt_name, SHARE_HOSTS_ALLOW) == 0) {
263
 
                return lp_hostsallow(s, lp_default_service(lp_ctx));
 
263
                return lpcfg_hostsallow(s, lpcfg_default_service(lp_ctx));
264
264
        }
265
265
 
266
266
        if (strcmp(opt_name, SHARE_HOSTS_DENY) == 0) {
267
 
                return lp_hostsdeny(s, lp_default_service(lp_ctx));
 
267
                return lpcfg_hostsdeny(s, lpcfg_default_service(lp_ctx));
268
268
        }
269
269
 
270
270
        if (strcmp(opt_name, SHARE_NTVFS_HANDLER) == 0) {
271
 
                return lp_ntvfs_handler(s, lp_default_service(lp_ctx));
 
271
                return lpcfg_ntvfs_handler(s, lpcfg_default_service(lp_ctx));
272
272
        }
273
273
 
274
274
        DEBUG(0,("request for unknown share list option '%s'\n",
286
286
        int num_services;
287
287
        const char **n;
288
288
       
289
 
        num_services = lp_numservices((struct loadparm_context *)ctx->priv_data);
 
289
        num_services = lpcfg_numservices((struct loadparm_context *)ctx->priv_data);
290
290
 
291
291
        n = talloc_array(mem_ctx, const char *, num_services);
292
292
        if (!n) {
295
295
        }
296
296
 
297
297
        for (i = 0; i < num_services; i++) {
298
 
                n[i] = talloc_strdup(n, lp_servicename(lp_servicebynum((struct loadparm_context *)ctx->priv_data, i)));
 
298
                n[i] = talloc_strdup(n, lpcfg_servicename(lpcfg_servicebynum((struct loadparm_context *)ctx->priv_data, i)));
299
299
                if (!n[i]) {
300
300
                        DEBUG(0,("ERROR: Out of memory!\n"));
301
301
                        talloc_free(n);
317
317
        struct share_config *s;
318
318
        struct loadparm_service *service;
319
319
 
320
 
        service = lp_service((struct loadparm_context *)ctx->priv_data, name);
 
320
        service = lpcfg_service((struct loadparm_context *)ctx->priv_data, name);
321
321
 
322
322
        if (service == NULL) {
323
323
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
329
329
                return NT_STATUS_NO_MEMORY;
330
330
        }
331
331
 
332
 
        s->name = talloc_strdup(s, lp_servicename(service));
 
332
        s->name = talloc_strdup(s, lpcfg_servicename(service));
333
333
        if (!s->name) {
334
334
                DEBUG(0,("ERROR: Out of memory!\n"));
335
335
                talloc_free(s);