- Timestamp:
- Jun 7, 2010, 9:08:40 AM (16 years ago)
- Location:
- trunk/server
- Files:
-
- 16 edited
-
lib/replace/getifaddrs.c (modified) (6 diffs)
-
lib/replace/system/network.h (modified) (1 diff)
-
lib/replace/system/passwd.h (modified) (1 diff)
-
lib/tdb/common/io.c (modified) (2 diffs)
-
lib/tdb/common/lock.c (modified) (4 diffs)
-
lib/tdb/common/open.c (modified) (14 diffs)
-
lib/tdb/common/tdb_private.h (modified) (2 diffs)
-
lib/tdb/common/transaction.c (modified) (6 diffs)
-
lib/tdb/tools/tdbtool.c (modified) (6 diffs)
-
lib/util/become_daemon.c (modified) (1 diff)
-
lib/util/blocking.c (modified) (2 diffs)
-
lib/util/genrand.c (modified) (3 diffs)
-
lib/util/util.c (modified) (1 diff)
-
libcli/util/ntstatus.h (modified) (1 diff)
-
libcli/util/werror.h (modified) (1 diff)
-
source3/build.cmd (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/lib/replace/getifaddrs.c
r414 r456 262 262 struct ifaddrs *curif; 263 263 struct ifaddrs *lastif = NULL; 264 265 266 264 267 265 268 *ifap = NULL; … … 288 291 289 292 if (ioctl(fd, SIOCGIFADDR, ifr) != 0) { 293 290 294 freeaddrinfo(*ifap); 291 295 return -1; 296 297 298 292 299 } 293 300 … … 307 314 308 315 if (ioctl(fd, SIOCGIFFLAGS, ifr) != 0) { 316 309 317 freeaddrinfo(*ifap); 310 318 return -1; 319 320 321 311 322 } 312 323 … … 314 325 315 326 if (ioctl(fd, SIOCGIFNETMASK, ifr) != 0) { 327 316 328 freeaddrinfo(*ifap); 317 329 return -1; 330 331 332 318 333 } 319 334 … … 321 336 322 337 lastif = curif; 338 323 339 324 340 next: … … 339 355 340 356 close(fd); 357 341 358 return 0; 359 360 361 362 363 364 342 365 } 343 366 -
trunk/server/lib/replace/system/network.h
r414 r456 297 297 #endif 298 298 299 299 300 #ifndef HAVE_SA_FAMILY_T 300 301 #define HAVE_SA_FAMILY_T 301 302 typedef unsigned short int sa_family_t; 303 302 304 #endif 303 305 -
trunk/server/lib/replace/system/passwd.h
r414 r456 68 68 #endif 69 69 70 #if def REPLACE_GETPASS70 #if 71 71 #if defined(REPLACE_GETPASS_BY_GETPASSPHRASE) 72 72 #define getpass(prompt) getpassphrase(prompt) -
trunk/server/lib/tdb/common/io.c
r414 r456 90 90 return -1; 91 91 92 93 94 95 96 97 98 99 100 101 102 92 103 if (tdb->map_ptr) { 93 104 memcpy(off + (char *)tdb->map_ptr, buf, len); … … 115 126 "write %d bytes at %d in two attempts\n", 116 127 len, off)); 117 return -1; 118 } 119 } 128 129 #ifdef __OS2__ // remove our lock 130 tdb_brlock( tdb, off, F_UNLCK, F_SETLK, 0, len); 131 #endif 132 return -1; 133 } 134 } 135 136 #ifdef __OS2__ // remove our lock 137 tdb_brlock( tdb, off, F_UNLCK, F_SETLK, 0, len); 138 #endif 139 120 140 return 0; 121 141 } -
trunk/server/lib/tdb/common/lock.c
r414 r456 30 30 #define TDB_MARK_LOCK 0x80000000 31 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 32 120 void tdb_setalarm_sigptr(struct tdb_context *tdb, volatile sig_atomic_t *ptr) 33 121 { … … 46 134 int rw_type, int lck_type, int probe, size_t len) 47 135 { 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 48 223 struct flock fl; 49 224 int ret; … … 87 262 } 88 263 return 0; 264 89 265 } 90 266 … … 101 277 while (count--) { 102 278 struct timeval tv; 279 280 281 282 283 284 103 285 if (tdb_brlock(tdb, offset, F_WRLCK, F_SETLKW, 1, len) == 0) { 104 286 return 0; -
trunk/server/lib/tdb/common/open.c
r414 r456 27 27 28 28 #include "tdb_private.h" 29 30 31 32 33 29 34 30 35 /* all contexts, to ensure no double-opens (fcntl locks don't nest!) */ … … 179 184 tdb->hash_fn = hash_fn ? hash_fn : default_tdb_hash; 180 185 186 187 188 189 190 191 181 192 /* cache the page size */ 182 193 tdb->page_size = getpagesize(); … … 250 261 /* we need to zero database if we are the only one with it open */ 251 262 if ((tdb_flags & TDB_CLEAR_IF_FIRST) && 252 (!tdb->read_only) && 253 (locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0))) { 263 (!tdb->read_only) 264 #ifndef __OS2__ 265 && (locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0)) 266 #endif 267 ) { 254 268 open_flags |= O_CREAT; 255 269 if (ftruncate(tdb->fd, 0) == -1) { … … 314 328 tdb_mmap(tdb); 315 329 if (locked) { 330 316 331 if (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_UNLCK, F_SETLK, 0, 1) == -1) { 317 332 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: " … … 321 336 } 322 337 338 323 339 } 324 340 … … 327 343 users know we're using it. */ 328 344 345 329 346 if (tdb_flags & TDB_CLEAR_IF_FIRST) { 330 347 /* leave this lock in place to indicate it's in use */ … … 332 349 goto fail; 333 350 } 351 334 352 335 353 /* if needed, run recovery */ … … 337 355 goto fail; 338 356 } 357 358 359 360 361 362 339 363 340 364 #ifdef TDB_TRACE … … 358 382 * do with disk files, and resume here by releasing their 359 383 * global lock and hooking into the active list. */ 384 360 385 if (tdb->methods->tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0, 1) == -1) 361 386 goto fail; 387 362 388 tdb->next = tdbs; 363 tdbs = tdb;389 tdbs = tdb; 364 390 return tdb; 365 391 … … 380 406 } 381 407 SAFE_FREE(tdb->name); 408 409 410 411 412 413 414 415 382 416 if (tdb->fd != -1) 383 417 if (close(tdb->fd) != 0) … … 420 454 } 421 455 SAFE_FREE(tdb->name); 456 457 458 459 460 422 461 if (tdb->fd != -1) { 423 462 ret = close(tdb->fd); … … 425 464 } 426 465 SAFE_FREE(tdb->lockrecs); 466 467 468 469 470 471 472 473 427 474 428 475 /* Remove from contexts list */ … … 465 512 return 0; /* Nothing to do. */ 466 513 } 514 515 516 517 518 519 520 521 522 523 524 525 526 467 527 468 528 if (tdb->num_locks != 0 || tdb->global_lock.count) { … … 551 611 return 0; 552 612 } 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 -
trunk/server/lib/tdb/common/tdb_private.h
r414 r456 23 23 License along with this library; if not, see <http://www.gnu.org/licenses/>. 24 24 */ 25 26 27 28 29 30 25 31 26 32 #include "replace.h" … … 204 210 #endif 205 211 volatile sig_atomic_t *interrupt_sig_ptr; 212 213 214 215 216 206 217 }; 207 218 -
trunk/server/lib/tdb/common/transaction.c
r414 r456 495 495 /* get a read lock from the freelist to the end of file. This 496 496 is upgraded to a write lock during the commit */ 497 497 498 if (tdb_brlock(tdb, FREELIST_TOP, F_RDLCK, F_SETLKW, 0, 0) == -1) { 498 499 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_start: failed to get hash locks\n")); … … 500 501 goto fail; 501 502 } 503 502 504 503 505 /* setup a copy of the hash table heads so the hash scan in … … 531 533 532 534 fail: 535 533 536 tdb_brlock(tdb, FREELIST_TOP, F_UNLCK, F_SETLKW, 0, 0); 537 534 538 tdb_transaction_unlock(tdb); 535 539 SAFE_FREE(tdb->transaction->blocks); … … 632 636 tdb->methods = tdb->transaction->io_methods; 633 637 638 634 639 tdb_brlock(tdb, FREELIST_TOP, F_UNLCK, F_SETLKW, 0, 0); 640 635 641 tdb_transaction_unlock(tdb); 636 642 SAFE_FREE(tdb->transaction->hash_heads); … … 940 946 941 947 /* upgrade the main transaction lock region to a write lock */ 948 942 949 if (tdb_brlock_upgrade(tdb, FREELIST_TOP, 0) == -1) { 943 950 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_prepare_commit: failed to upgrade hash locks\n")); … … 946 953 return -1; 947 954 } 955 948 956 949 957 /* get the global lock - this prevents new users attaching to the database -
trunk/server/lib/tdb/tools/tdbtool.c
r414 r456 37 37 char cmdline[1024]; 38 38 static int disable_mmap; 39 40 41 42 39 43 40 44 enum commands { … … 239 243 tdb = tdb_open_ex(tdbname, 0, disable_mmap?TDB_NOMMAP:0, O_RDWR, 0600, 240 244 &log_ctx, NULL); 245 246 247 241 248 if (!tdb) { 249 242 250 printf("Could not open %s: %s\n", tdbname, strerror(errno)); 243 251 } … … 563 571 int cmd_len; 564 572 573 574 575 576 565 577 if (cmdname && strlen(cmdname) == 0) { 566 578 mycmd = CMD_NEXT; … … 575 587 } 576 588 } 589 590 591 577 592 578 593 switch (mycmd) { … … 730 745 arg2 = NULL; 731 746 arg2len = 0; 747 748 749 750 751 752 753 754 755 756 757 758 732 759 733 760 if (argv[1]) { … … 770 797 cmdname = argv[2]; 771 798 default: 799 800 801 802 803 772 804 do_command(); 773 805 break; -
trunk/server/lib/util/become_daemon.c
r414 r456 69 69 _PUBLIC_ void become_daemon(bool do_fork, bool no_process_group) 70 70 { 71 72 73 74 71 75 if (do_fork) { 72 76 if (sys_fork()) { -
trunk/server/lib/util/blocking.c
r414 r456 54 54 if((val = fcntl(fd, F_GETFL, 0)) == -1) 55 55 return -1; 56 56 57 if(set) /* Turn blocking on - ie. clear nonblock flag */ 57 58 val &= ~FLAG_TO_SET; … … 59 60 val |= FLAG_TO_SET; 60 61 return fcntl( fd, F_SETFL, val); 62 63 64 65 66 67 68 69 61 70 #undef FLAG_TO_SET 62 71 } -
trunk/server/lib/util/genrand.c
r414 r456 224 224 unsigned char *p; 225 225 226 226 227 if(!done_reseed) { 227 228 bytes_since_reseed += len; … … 242 243 done_reseed = true; 243 244 } 245 244 246 245 247 /* … … 254 256 int copy_len = len > 16 ? 16 : len; 255 257 258 259 260 256 261 get_random_stream(md4_buf, sizeof(md4_buf)); 262 257 263 mdfour(tmp_buf, md4_buf, sizeof(md4_buf)); 258 264 memcpy(p, tmp_buf, copy_len); -
trunk/server/lib/util/util.c
r414 r456 223 223 lock.l_pid = 0; 224 224 225 225 226 ret = fcntl(fd,op,&lock); 226 227 -
trunk/server/libcli/util/ntstatus.h
r414 r456 30 30 */ 31 31 32 #if defined(HAVE_IMMEDIATE_STRUCTURES) 32 #if defined(HAVE_IMMEDIATE_STRUCTURES) 33 33 typedef struct {uint32_t v;} NTSTATUS; 34 34 #define NT_STATUS(x) ((NTSTATUS) { x }) -
trunk/server/libcli/util/werror.h
r414 r456 30 30 */ 31 31 32 #if defined(HAVE_IMMEDIATE_STRUCTURES) 32 #if defined(HAVE_IMMEDIATE_STRUCTURES) 33 33 typedef struct {uint32_t v;} WERROR; 34 34 #define W_ERROR(x) ((WERROR) { x }) -
trunk/server/source3/build.cmd
r454 r456 85 85 if conf = "YES" then do 86 86 address cmd 'SETLOCAL' 87 87 88 address cmd 'SET CFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4' 88 89 address cmd 'SET CXXFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4' … … 90 91 address cmd 'SET AR=emxomfar' 91 92 address cmd 'SET LIBS=-lsocket -lsyslog' 93 92 94 /* disabled options: 93 95 --enable-developer --enable-socket-wrapper
Note:
See TracChangeset
for help on using the changeset viewer.
