~ubuntu-branches/ubuntu/maverick/samba/maverick-security

« back to all changes in this revision

Viewing changes to source/lib/smbconf/smbconf_txt.c

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2009-05-18 13:26:04 UTC
  • mfrom: (0.28.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090518132604-ebyuqimgymtr3h0k
Tags: 2:3.3.4-2ubuntu1
* Merge from debian unstable, remaining changes:
  + debian/patches/VERSION.patch:
    - setup SAMBA_VERSION_SUFFIX to Ubuntu.
  + 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/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted (LP: #312449)
  + debian/mksambapasswd.awk:
    - Do not add user with UID less than 1000 to smbpasswd.
  + debian/control:
    - Make libwbclient0 replace/conflict with hardy's likewise-open.
    - Don't build against ctdb.
    - Add suggests keyutils for smbfs. (LP: #300221)
  + debian/rules:
    - enable "native" PIE hardening.
    - remove --with-ctdb and --with-cluster-support=yes
  + Add ufw integration:
    - Created debian/samba.ufw profile.
    - debian/rules, debian/samba.dirs, debian/samba.files: install 
      profile
    - debian/control: have samba sugguest ufw.
* Dropped patches:
  + debian/patches/fix-upstream-bug-6186.patch: Merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
        if (!(tpd->verbatim) &&
139
139
            smbconf_find_in_array(param_name, param_names, num_params, &idx))
140
140
        {
141
 
                TALLOC_FREE(param_values[idx]);
 
141
                talloc_free(param_values[idx]);
142
142
                param_values[idx] = talloc_strdup(cache, param_value);
143
143
                if (param_values[idx] == NULL) {
144
144
                        return false;
160
160
 
161
161
static void smbconf_txt_flush_cache(struct smbconf_ctx *ctx)
162
162
{
163
 
        TALLOC_FREE(pd(ctx)->cache);
 
163
        talloc_free(pd(ctx)->cache);
 
164
        pd(ctx)->cache = NULL;
164
165
}
165
166
 
166
167
static WERROR smbconf_txt_init_cache(struct smbconf_ctx *ctx)
221
222
static WERROR smbconf_txt_init(struct smbconf_ctx *ctx, const char *path)
222
223
{
223
224
        if (path == NULL) {
224
 
                path = get_dyn_CONFIGFILE();
 
225
                return WERR_BADFILE;
225
226
        }
226
227
        ctx->path = talloc_strdup(ctx, path);
227
228
        if (ctx->path == NULL) {
243
244
        return ctx->ops->close_conf(ctx);
244
245
}
245
246
 
 
247
static bool smbconf_txt_requires_messaging(struct smbconf_ctx *ctx)
 
248
{
 
249
        return false;
 
250
}
 
251
 
 
252
static bool smbconf_txt_is_writeable(struct smbconf_ctx *ctx)
 
253
{
 
254
        /* no write support in this backend yet... */
 
255
        return false;
 
256
}
 
257
 
246
258
static WERROR smbconf_txt_open(struct smbconf_ctx *ctx)
247
259
{
248
260
        return smbconf_txt_load_file(ctx);
348
360
        }
349
361
 
350
362
done:
351
 
        TALLOC_FREE(tmp_ctx);
 
363
        talloc_free(tmp_ctx);
352
364
        return werr;
353
365
}
354
366
 
447
459
        }
448
460
 
449
461
done:
450
 
        TALLOC_FREE(tmp_ctx);
 
462
        talloc_free(tmp_ctx);
451
463
        return werr;
452
464
}
453
465
 
582
594
        werr = WERR_OK;
583
595
 
584
596
done:
585
 
        TALLOC_FREE(tmp_ctx);
 
597
        talloc_free(tmp_ctx);
586
598
        return werr;
587
599
}
588
600
 
600
612
        return WERR_NOT_SUPPORTED;
601
613
}
602
614
 
 
615
static WERROR smbconf_txt_transaction_start(struct smbconf_ctx *ctx)
 
616
{
 
617
        return WERR_OK;
 
618
}
 
619
 
 
620
static WERROR smbconf_txt_transaction_commit(struct smbconf_ctx *ctx)
 
621
{
 
622
        return WERR_OK;
 
623
}
 
624
 
 
625
static WERROR smbconf_txt_transaction_cancel(struct smbconf_ctx *ctx)
 
626
{
 
627
        return WERR_OK;
 
628
}
603
629
 
604
630
static struct smbconf_ops smbconf_ops_txt = {
605
631
        .init                   = smbconf_txt_init,
606
632
        .shutdown               = smbconf_txt_shutdown,
 
633
        .requires_messaging     = smbconf_txt_requires_messaging,
 
634
        .is_writeable           = smbconf_txt_is_writeable,
607
635
        .open_conf              = smbconf_txt_open,
608
636
        .close_conf             = smbconf_txt_close,
609
637
        .get_csn                = smbconf_txt_get_csn,
619
647
        .get_includes           = smbconf_txt_get_includes,
620
648
        .set_includes           = smbconf_txt_set_includes,
621
649
        .delete_includes        = smbconf_txt_delete_includes,
 
650
        .transaction_start      = smbconf_txt_transaction_start,
 
651
        .transaction_commit     = smbconf_txt_transaction_commit,
 
652
        .transaction_cancel     = smbconf_txt_transaction_cancel,
622
653
};
623
654
 
624
655