smbd: Simplify parse_share_modes
authorVolker Lendecke <vl@samba.org>
Mon, 10 Sep 2018 13:14:00 +0000 (15:14 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 14 Sep 2018 05:49:14 +0000 (07:49 +0200)
Since 823bc4c07ad pidl initializes the [skip] entries

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/locking/share_mode_lock.c

index 2850e502bdac83ad4c7a14f8b445b1f6c97b2f7e..919e74c0851664ba1efa4745642c76447eca7921 100644 (file)
@@ -297,7 +297,6 @@ static struct share_mode_data *parse_share_modes(TALLOC_CTX *mem_ctx,
 {
        struct share_mode_data *d;
        enum ndr_err_code ndr_err;
-       uint32_t i;
        DATA_BLOB blob;
 
        blob.data = dbuf.dptr;
@@ -323,17 +322,6 @@ static struct share_mode_data *parse_share_modes(TALLOC_CTX *mem_ctx,
                goto fail;
        }
 
-       /*
-        * Initialize the values that are [skip] or [ignore]
-        * in the idl. The NDR code does not initialize them.
-        */
-
-       for (i=0; i<d->num_share_modes; i++) {
-               d->share_modes[i].stale = false;
-       }
-       d->modified = false;
-       d->fresh = false;
-
        if (DEBUGLEVEL >= 10) {
                DEBUG(10, ("parse_share_modes:\n"));
                NDR_PRINT_DEBUG(share_mode_data, d);
@@ -786,7 +774,6 @@ static int share_mode_traverse_fn(struct db_record *rec, void *_state)
 {
        struct share_mode_forall_state *state =
                (struct share_mode_forall_state *)_state;
-       uint32_t i;
        TDB_DATA key;
        TDB_DATA value;
        DATA_BLOB blob;
@@ -819,10 +806,6 @@ static int share_mode_traverse_fn(struct db_record *rec, void *_state)
                return 0;
        }
 
-       for (i=0; i<d->num_share_modes; i++) {
-               d->share_modes[i].stale = false;
-       }
-
        if (DEBUGLEVEL > 10) {
                DEBUG(11, ("parse_share_modes:\n"));
                NDR_PRINT_DEBUG(share_mode_data, d);