struct set_share_mode_state {
struct share_mode_entry e;
- uint32_t num_share_modes;
+ bool created_share_mode_record;
NTSTATUS status;
};
}
}
- state->num_share_modes = num_share_modes+1;
+ state->created_share_mode_record = (num_share_modes == 0);
state->status = dbwrap_record_storev(rec, dbufs, num_dbufs, 0);
}
return false;
}
- d->num_share_modes = state.num_share_modes;
- d->modified = true;
+ if (state.created_share_mode_record) {
+ d->num_share_modes = 1;
+ d->modified = true;
+ }
return true;
}
bool *modified,
void *private_data);
void *private_data;
- size_t num_share_modes;
bool ok;
};
return;
}
- if (num_share_modes != d->num_share_modes) {
- d->num_share_modes = num_share_modes;
- d->modified = true;
- }
-
if (num_share_modes == 0) {
+ if (data.dsize != 0) {
+ d->num_share_modes = 0;
+ d->modified = true;
+ }
status = dbwrap_record_delete(rec);
} else {
TDB_DATA value = {
nt_errstr(state.status));
return false;
}
-
- d->num_share_modes = state.num_share_modes;
- d->modified = true;
+ d->num_share_modes = 1;
return true;
}