Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/source4/ntvfs/common
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/ntvfs/common/brlock.c

    r414 r740  
    2727#include "includes.h"
    2828#include "system/filesys.h"
    29 #include "../tdb/include/tdb.h"
     29#include <tdb.h>
    3030#include "messaging/messaging.h"
    3131#include "lib/messaging/irpc.h"
     
    126126        return ops->brl_close(brl, brlh);
    127127}
     128
     129/*
     130 Get a number of locks associated with a open file.
     131*/
     132NTSTATUS brl_count(struct brl_context *brl,
     133                   struct brl_handle *brlh,
     134                   int *count)
     135{
     136        return ops->brl_count(brl, brlh, count);
     137}
  • vendor/current/source4/ntvfs/common/brlock.h

    r414 r740  
    4747        NTSTATUS (*brl_close)(struct brl_context *,
    4848                              struct brl_handle *);
     49        NTSTATUS (*brl_count)(struct brl_context *,
     50                              struct brl_handle *,
     51                              int *count);
    4952};
    5053
  • vendor/current/source4/ntvfs/common/brlock_tdb.c

    r414 r740  
    2727#include "includes.h"
    2828#include "system/filesys.h"
    29 #include "../tdb/include/tdb.h"
     29#include <tdb.h>
    3030#include "messaging/messaging.h"
    31 #include "tdb_wrap.h"
     31#include "lib/util/tdb_wrap.h"
    3232#include "lib/messaging/irpc.h"
    3333#include "libcli/libcli.h"
     
    8181};
    8282
     83/* see if we have wrapped locks, which are no longer allowed (windows
     84 * changed this in win7 */
     85static bool brl_invalid_lock_range(uint64_t start, uint64_t size)
     86{
     87        return (size > 1 && (start + size < start));
     88}
     89
    8390/*
    8491  Open up the brlock.tdb database. Close it down using
     
    299306        kbuf.dptr = brlh->key.data;
    300307        kbuf.dsize = brlh->key.length;
     308
     309        if (brl_invalid_lock_range(start, size)) {
     310                return NT_STATUS_INVALID_LOCK_RANGE;
     311        }
    301312
    302313        if (tdb_chainlock(brl->w->tdb, kbuf) != 0) {
     
    449460        kbuf.dptr = brlh->key.data;
    450461        kbuf.dsize = brlh->key.length;
     462
     463        if (brl_invalid_lock_range(start, size)) {
     464                return NT_STATUS_INVALID_LOCK_RANGE;
     465        }
    451466
    452467        if (tdb_chainlock(brl->w->tdb, kbuf) != 0) {
     
    621636        kbuf.dsize = brlh->key.length;
    622637
     638        if (brl_invalid_lock_range(start, size)) {
     639                return NT_STATUS_INVALID_LOCK_RANGE;
     640        }
     641
    623642        dbuf = tdb_fetch(brl->w->tdb, kbuf);
    624643        if (dbuf.dptr == NULL) {
     
    720739}
    721740
     741static NTSTATUS brl_tdb_count(struct brl_context *brl, struct brl_handle *brlh,
     742                              int *count)
     743{
     744        TDB_DATA kbuf, dbuf;
     745
     746        kbuf.dptr = brlh->key.data;
     747        kbuf.dsize = brlh->key.length;
     748        *count = 0;
     749
     750        if (tdb_chainlock(brl->w->tdb, kbuf) != 0) {
     751                return NT_STATUS_INTERNAL_DB_CORRUPTION;
     752        }
     753
     754        dbuf = tdb_fetch(brl->w->tdb, kbuf);
     755        if (!dbuf.dptr) {
     756                tdb_chainunlock(brl->w->tdb, kbuf);
     757                return NT_STATUS_OK;
     758        }
     759
     760        *count = dbuf.dsize / sizeof(struct lock_struct);
     761
     762        free(dbuf.dptr);
     763        tdb_chainunlock(brl->w->tdb, kbuf);
     764
     765        return NT_STATUS_OK;
     766}
    722767
    723768static const struct brlock_ops brlock_tdb_ops = {
     
    728773        .brl_remove_pending = brl_tdb_remove_pending,
    729774        .brl_locktest       = brl_tdb_locktest,
    730         .brl_close          = brl_tdb_close
     775        .brl_close          = brl_tdb_close,
     776        .brl_count          = brl_tdb_count
    731777};
    732778
  • vendor/current/source4/ntvfs/common/notify.c

    r414 r740  
    2626#include "includes.h"
    2727#include "system/filesys.h"
    28 #include "../tdb/include/tdb.h"
     28#include <tdb.h>
    2929#include "../lib/util/util_tdb.h"
    3030#include "messaging/messaging.h"
    31 #include "tdb_wrap.h"
     31#include "lib/util/tdb_wrap.h"
    3232#include "lib/messaging/irpc.h"
    33 #include "librpc/gen_ndr/ndr_notify.h"
     33#include "librpc/gen_ndr/ndr_s4_notify.h"
    3434#include "../lib/util/dlinklist.h"
    3535#include "ntvfs/common/ntvfs_common.h"
     
    3737#include "cluster/cluster.h"
    3838#include "param/param.h"
     39#include "lib/util/tsort.h"
    3940
    4041struct notify_context {
     
    4647        int seqnum;
    4748        struct sys_notify_context *sys_notify_ctx;
    48         struct smb_iconv_convenience *iconv_convenience;
    4949};
    5050
     
    113113        notify->list = NULL;
    114114        notify->array = NULL;
    115         notify->iconv_convenience = lp_iconv_convenience(lp_ctx);
    116115        notify->seqnum = tdb_get_seqnum(notify->w->tdb);
    117116
     
    178177        blob.length = dbuf.dsize;
    179178
    180         ndr_err = ndr_pull_struct_blob(&blob, notify->array, notify->iconv_convenience,
    181                                        notify->array,
     179        ndr_err = ndr_pull_struct_blob(&blob, notify->array, notify->array,
    182180                                       (ndr_pull_flags_fn_t)ndr_pull_notify_array);
    183181        free(dbuf.dptr);
     
    227225        NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
    228226
    229         ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, notify->iconv_convenience, notify->array,
     227        ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, notify->array,
    230228                                       (ndr_push_flags_fn_t)ndr_push_notify_array);
    231229        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     
    263261        }
    264262
    265         ndr_err = ndr_pull_struct_blob(data, tmp_ctx, notify->iconv_convenience, &ev,
     263        ndr_err = ndr_pull_struct_blob(data, tmp_ctx, &ev,
    266264                                      (ndr_pull_flags_fn_t)ndr_pull_notify_event);
    267265        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     
    329327        d->max_mask_subdir |= e->subdir_filter;
    330328
    331         if (d->num_entries > 1) {
    332                 qsort(d->entries, d->num_entries, sizeof(d->entries[0]), notify_compare);
    333         }
     329        TYPESAFE_QSORT(d->entries, d->num_entries, notify_compare);
    334330
    335331        /* recalculate the maximum masks */
     
    562558        tmp_ctx = talloc_new(notify);
    563559
    564         ndr_err = ndr_push_struct_blob(&data, tmp_ctx, notify->iconv_convenience, &ev, (ndr_push_flags_fn_t)ndr_push_notify_event);
     560        ndr_err = ndr_push_struct_blob(&data, tmp_ctx, &ev, (ndr_push_flags_fn_t)ndr_push_notify_event);
    565561        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
    566562                talloc_free(tmp_ctx);
  • vendor/current/source4/ntvfs/common/opendb_tdb.c

    r414 r740  
    4141#include "includes.h"
    4242#include "system/filesys.h"
    43 #include "../tdb/include/tdb.h"
     43#include <tdb.h>
    4444#include "messaging/messaging.h"
    45 #include "tdb_wrap.h"
     45#include "lib/util/tdb_wrap.h"
    4646#include "lib/messaging/irpc.h"
    4747#include "librpc/gen_ndr/ndr_opendb.h"
     
    247247        blob.length = dbuf.dsize;
    248248
    249         ndr_err = ndr_pull_struct_blob(&blob, lck, lp_iconv_convenience(lck->odb->ntvfs_ctx->lp_ctx), file, (ndr_pull_flags_fn_t)ndr_pull_opendb_file);
     249        ndr_err = ndr_pull_struct_blob(&blob, lck, file, (ndr_pull_flags_fn_t)ndr_pull_opendb_file);
    250250        free(dbuf.dptr);
    251251        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     
    275275        }
    276276
    277         ndr_err = ndr_push_struct_blob(&blob, lck, lp_iconv_convenience(lck->odb->ntvfs_ctx->lp_ctx), file, (ndr_push_flags_fn_t)ndr_push_opendb_file);
     277        ndr_err = ndr_push_struct_blob(&blob, lck, file, (ndr_push_flags_fn_t)ndr_push_opendb_file);
    278278        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
    279279                return ndr_map_error2ntstatus(ndr_err);
Note: See TracChangeset for help on using the changeset viewer.