Changeset 740 for vendor/current/source3/libsmb/smb_share_modes.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
-
vendor/current/source3/libsmb/smb_share_modes.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/libsmb/smb_share_modes.c
r414 r740 26 26 27 27 #include "includes.h" 28 28 29 #include "smb_share_modes.h" 30 29 31 30 32 /* Database context handle. */ … … 68 70 69 71 smb_db->smb_tdb = tdb_open(db_path, 70 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST ,72 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, 71 73 O_RDWR|O_CREAT, 72 74 0644); … … 156 158 157 159 static void create_share_mode_entry(struct share_mode_entry *out, 158 const struct smb_share_mode_entry *in) 160 const struct smb_share_mode_entry *in, 161 uint32_t name_hash) 159 162 { 160 163 memset(out, '\0', sizeof(struct share_mode_entry)); … … 171 174 out->uid = (uint32)geteuid(); 172 175 out->flags = 0; 176 173 177 } 174 178 … … 256 260 } 257 261 258 *p_delete_on_close = ld->u.s. delete_on_close;262 *p_delete_on_close = ld->u.s.; 259 263 *pp_list = list; 260 264 free(db_data.dptr); 261 265 return list_num; 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 262 291 } 263 292 … … 282 311 uint8 *new_data_p = NULL; 283 312 size_t new_data_size = 0; 313 314 315 316 317 318 284 319 285 320 db_data = tdb_fetch(db_ctx->smb_tdb, locking_key); … … 297 332 memset(ld, '\0', sizeof(struct locking_data)); 298 333 ld->u.s.num_share_mode_entries = 1; 299 ld->u.s.delete_on_close = 0; 300 ld->u.s.delete_token_size = 0; 334 ld->u.s.num_delete_token_entries = 0; 301 335 shares = (struct share_mode_entry *)(db_data.dptr + sizeof(struct locking_data)); 302 create_share_mode_entry(shares, new_entry );336 create_share_mode_entry(shares, new_entry); 303 337 304 338 memcpy(db_data.dptr + sizeof(struct locking_data) + sizeof(struct share_mode_entry), … … 339 373 (orig_num_share_modes * sizeof(struct share_mode_entry))); 340 374 341 create_share_mode_entry(shares, new_entry );375 create_share_mode_entry(shares, new_entry); 342 376 343 377 ld = (struct locking_data *)new_data_p; 344 378 ld->u.s.num_share_mode_entries++; 345 379 346 /* Append the original delete_token and filenames. */380 /* Append the original delete_token and filenames. */ 347 381 memcpy(new_data_p + sizeof(struct locking_data) + (ld->u.s.num_share_mode_entries * sizeof(struct share_mode_entry)), 348 382 db_data.dptr + sizeof(struct locking_data) + (orig_num_share_modes * sizeof(struct share_mode_entry)), … … 461 495 } 462 496 463 /* Copy any delete token plus the terminating filenames. */497 /* Copy any delete token plus the terminating filenames. */ 464 498 remaining_ptr = db_data.dptr + sizeof(struct locking_data) + (orig_num_share_modes * sizeof(struct share_mode_entry)); 465 499 remaining_size = db_data.dsize - (remaining_ptr - db_data.dptr); … … 522 556 523 557 if (share_mode_entry_equal(set_entry, share)) { 524 create_share_mode_entry(share, new_entry );558 create_share_mode_entry(share, new_entry); 525 559 found_entry = 1; 526 560 break;
Note:
See TracChangeset
for help on using the changeset viewer.
