r18591: Better defaults for share creation
authorSimo Sorce <idra@samba.org>
Sun, 17 Sep 2006 03:00:05 +0000 (03:00 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:18:53 +0000 (14:18 -0500)
Fix logic error in paged_results

source/lib/ldb/modules/paged_results.c
source/param/share_ldb.c

index 133ee1fb782296d158ff2454ac005fc82195fae2..3ab575ef6b04484c41bcd520ebd299cac3ecfcaa 100644 (file)
@@ -44,11 +44,15 @@ struct message_store {
        struct message_store *next;
 };
 
+struct private_data;
+
 struct results_store {
+
+       struct private_data *priv;
+
        char *cookie;
        time_t timestamp;
-       int num_sent; /* To be removed */
-       struct ldb_result *result; /* To be removed */
+
        struct results_store *prev;
        struct results_store *next;
        
@@ -79,7 +83,11 @@ int store_destructor(struct results_store *store)
        if (store->next) {
                store->next->prev = store->prev;
        }
-       
+
+       if (store == store->priv->store) {
+               store->priv->store = NULL;
+       }
+
        return 0;
 }
 
@@ -95,6 +103,8 @@ static struct results_store *new_store(struct private_data *priv)
        newr = talloc(priv, struct results_store);
        if (!newr) return NULL;
 
+       newr->priv = priv;
+
        newr->cookie = talloc_asprintf(newr, "%d", new_id);
        if (!newr->cookie) {
                talloc_free(newr);
@@ -103,9 +113,6 @@ static struct results_store *new_store(struct private_data *priv)
 
        newr->timestamp = time(NULL);
 
-       newr->num_sent = 0; /* To be removed */
-       newr->result = NULL; /* To be removed */
-
        newr->first = NULL;
        newr->num_entries = 0;
        newr->first_ref = NULL;
index 21f6938f691fdd70247b1a7c528dc9596b15deaf..fba204c834f23e618ed3681cb1b1e102ac8d2a09 100644 (file)
@@ -361,6 +361,8 @@ NTSTATUS sldb_create(struct share_context *ctx, const char *name, struct share_i
        SHARE_ADD_STRING(SHARE_AVAILABLE, "True");
        SHARE_ADD_STRING(SHARE_BROWSEABLE, "True");
        SHARE_ADD_STRING(SHARE_READONLY, "False");
+       SHARE_ADD_STRING(SHARE_NTVFS_HANDLER, "unixuid");
+       SHARE_ADD_STRING(SHARE_NTVFS_HANDLER, "posix");
 
        err = ldb_add(ldb, msg);
        if (err != LDB_SUCCESS) {
@@ -428,7 +430,7 @@ NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info
        struct ldb_message *msg;
        TALLOC_CTX *tmp_ctx;
        NTSTATUS ret;
-       bool rename = False;
+       bool do_rename = False;
        char *newname;
        int err, i;
 
@@ -462,7 +464,7 @@ NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info
        for (i = 0; i < count; i++) {
                if (strcasecmp(info[i].name, SHARE_NAME) == 0) {
                        if (strcasecmp(name, (char *)info[i].value) != 0) {
-                               rename = True;
+                               do_rename = True;
                                newname = (char *)info[i].value;
                                SHARE_MOD_STRING("cn", (char *)info[i].value);
                        }
@@ -485,7 +487,7 @@ NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info
                }
        }
 
-       if (rename) {
+       if (do_rename) {
                struct ldb_dn *olddn, *newdn;
 
                olddn = msg->dn;