Changeset 149 for trunk/samba/source/lib
- Timestamp:
- Aug 20, 2008, 9:10:33 AM (17 years ago)
- Location:
- trunk/samba/source/lib
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/lib/charcnv.c
r136 r149 48 48 static smb_iconv_t conv_handles[NUM_CHARSETS][NUM_CHARSETS]; 49 49 static bool conv_silent; /* Should we do a debug if the conversion fails ? */ 50 static bool initialized; 50 51 51 52 /** … … 93 94 void lazy_initialize_conv(void) 94 95 { 95 static int initialized = False;96 97 96 if (!initialized) { 98 initialized = True;99 97 load_case_tables(); 100 98 init_iconv(); 99 initialized = true; 101 100 } 102 101 } … … 117 116 } 118 117 } 118 initialized = false; 119 119 } 120 120 -
trunk/samba/source/lib/dbwrap_ctdb.c
r133 r149 489 489 tdb_flags &= TDB_SEQNUM; 490 490 491 /* honor permissions if user has specified O_CREAT */ 492 if (open_flags & O_CREAT) { 493 chmod(db_path, mode); 494 } 495 491 496 db_ctdb->wtdb = tdb_wrap_open(db_ctdb, db_path, hash_size, tdb_flags, O_RDWR, 0); 492 497 if (db_ctdb->wtdb == NULL) { -
trunk/samba/source/lib/dbwrap_util.c
r133 r149 99 99 } 100 100 101 /** 102 * Atomic unsigned integer change (addition): 103 * 104 * if value does not exist yet in the db, use *oldval as initial old value. 105 * return old value in *oldval. 106 * store *oldval + change_val to db. 107 */ 101 108 uint32_t dbwrap_change_uint32_atomic(struct db_context *db, const char *keystr, 102 109 uint32_t *oldval, uint32_t change_val) … … 111 118 } 112 119 113 if ((rec->value.dptr != NULL) 114 && (rec->value.dsize == sizeof(val))) { 120 if (rec->value.dptr == NULL) { 121 val = *oldval; 122 } else if (rec->value.dsize == sizeof(val)) { 115 123 val = IVAL(rec->value.dptr, 0); 124 *oldval = val; 125 } else { 126 return -1; 116 127 } 117 128 … … 128 139 } 129 140 141 /** 142 * Atomic integer change (addition): 143 * 144 * if value does not exist yet in the db, use *oldval as initial old value. 145 * return old value in *oldval. 146 * store *oldval + change_val to db. 147 */ 130 148 int32 dbwrap_change_int32_atomic(struct db_context *db, const char *keystr, 131 149 int32 *oldval, int32 change_val) … … 140 158 } 141 159 142 if ((rec->value.dptr != NULL) 143 && (rec->value.dsize == sizeof(val))) { 160 if (rec->value.dptr == NULL) { 161 val = *oldval; 162 } else if (rec->value.dsize == sizeof(val)) { 144 163 val = IVAL(rec->value.dptr, 0); 164 *oldval = val; 165 } else { 166 return -1; 145 167 } 146 168 -
trunk/samba/source/lib/debug.c
r141 r149 95 95 /* 96 96 * This is to allow assignment to DEBUGLEVEL before the debug 97 * system has been initiali sed.97 * system has been initialized. 98 98 */ 99 99 static int debug_all_class_hack = 1; … … 184 184 ****************************************************************************/ 185 185 186 static bool initialized; 187 186 188 void gfree_debugsyms(void) 187 189 { … … 195 197 } 196 198 197 if ( DEBUGLEVEL_CLASS != &debug_all_class_hack ) 199 if ( DEBUGLEVEL_CLASS != &debug_all_class_hack ) { 198 200 SAFE_FREE( DEBUGLEVEL_CLASS ); 199 200 if ( DEBUGLEVEL_CLASS_ISSET != &debug_all_class_isset_hack ) 201 DEBUGLEVEL_CLASS = &debug_all_class_hack; 202 } 203 204 if ( DEBUGLEVEL_CLASS_ISSET != &debug_all_class_isset_hack ) { 201 205 SAFE_FREE( DEBUGLEVEL_CLASS_ISSET ); 206 DEBUGLEVEL_CLASS_ISSET = &debug_all_class_isset_hack; 207 } 202 208 203 209 SAFE_FREE(format_bufr); 210 211 debug_num_classes = 0; 212 213 debug_level = DEBUGLEVEL_CLASS; 214 215 initialized = false; 204 216 } 205 217 … … 531 543 void debug_init(void) 532 544 { 533 static bool initialised = False;534 545 const char **p; 535 546 536 if (initiali sed)547 if (initialized) 537 548 return; 538 549 539 initiali sed = True;550 initialized = true; 540 551 541 552 for(p = default_classname_table; *p; p++) { -
trunk/samba/source/lib/errmap_unix.c
r133 r149 108 108 int i = 0; 109 109 110 if (unix_error == 0) 111 return NT_STATUS_OK; 110 if (unix_error == 0) { 111 /* we map this to an error, not success, as this 112 function is only called in an error path. Lots of 113 our virtualised functions may fail without making a 114 unix system call that fails (such as when they are 115 checking for some handle existing), so unix_error 116 may be unset 117 */ 118 return NT_STATUS_UNSUCCESSFUL; 119 } 112 120 113 121 /* Look through list */ -
trunk/samba/source/lib/netapi/netapi.h
r133 r149 20 20 #ifndef __LIB_NETAPI_H__ 21 21 #define __LIB_NETAPI_H__ 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif /* __cplusplus */ 22 26 23 27 /**************************************************************** … … 460 464 void **buffer /* [out] [noprint,ref] */); 461 465 462 #endif 466 #ifdef __cplusplus 467 } 468 #endif /* __cplusplus */ 469 470 #endif /* __LIB_NETAPI_H__ */ -
trunk/samba/source/lib/replace/libreplace_cc.m4
r138 r149 168 168 } f2[] = { 169 169 {FOO_ONE} 170 }; 170 }; 171 static const FOOBAR f3[] = {FOO_ONE}; 171 172 ], 172 173 libreplace_cv_immediate_structures=yes, -
trunk/samba/source/lib/replace/replace.c
r141 r149 171 171 172 172 gid_t *grouplst = NULL; 173 int max_gr = 32;173 int max_gr = NGROUPS_MAX; 174 174 int ret; 175 175 int i,j; -
trunk/samba/source/lib/tdb/common/tdb.c
r133 r149 244 244 if (tdb->read_only || tdb->traverse_read) return -1; 245 245 246 if ( tdb->traverse_write != 0 ||246 if (((tdb->traverse_write != 0) && (!TDB_DEAD(rec))) || 247 247 tdb_write_lock_record(tdb, rec_ptr) == -1) { 248 248 /* Someone traversing here: mark it as dead */ -
trunk/samba/source/lib/util.c
r136 r149 192 192 gfree_loadparm(); 193 193 gfree_case_tables(); 194 gfree_debugsyms();195 194 gfree_charcnv(); 196 195 gfree_interfaces(); 197 198 /* release the talloc null_context memory last */ 199 talloc_disable_null_tracking(); 196 gfree_debugsyms(); 200 197 } 201 198 … … 596 593 597 594 ret = S_ISDIR(st->st_mode); 598 if(!ret) 599 errno = ENOTDIR; 595 if(!ret){ 596 DEBUG( 0, ( "PS - ENOTDIR1\n" ) ); 597 errno = ENOTDIR;} 600 598 return ret; 601 599 } -
trunk/samba/source/lib/util_sid.c
r133 r149 679 679 680 680 if (include_user_group_rid) { 681 682 if (!sid_compose(&sid, info3->base.domain_sid, info3->base.rid)) 683 { 681 if (!sid_compose(&sid, info3->base.domain_sid, info3->base.rid)) { 684 682 DEBUG(3, ("could not compose user SID from rid 0x%x\n", 685 683 info3->base.rid)); … … 692 690 return status; 693 691 } 694 695 if (!sid_compose(&sid, info3->base.domain_sid, info3->base.primary_gid)) 696 { 697 DEBUG(3, ("could not compose group SID from rid 0x%x\n", 698 info3->base.primary_gid)); 699 return NT_STATUS_INVALID_PARAMETER; 692 } 693 694 if (!sid_compose(&sid, info3->base.domain_sid, info3->base.primary_gid)) { 695 DEBUG(3, ("could not compose group SID from rid 0x%x\n", 696 info3->base.primary_gid)); 697 return NT_STATUS_INVALID_PARAMETER; 698 } 699 status = add_sid_to_array(mem_ctx, &sid, &sid_array, &num_sids); 700 if (!NT_STATUS_IS_OK(status)) { 701 DEBUG(3, ("could not append group SID from rid 0x%x\n", 702 info3->base.rid)); 703 return status; 704 } 705 706 for (i = 0; i < info3->base.groups.count; i++) { 707 /* Don't add the primary group sid twice. */ 708 if (info3->base.primary_gid == info3->base.groups.rids[i].rid) { 709 continue; 700 710 } 701 status = add_sid_to_array(mem_ctx, &sid, &sid_array, &num_sids);702 if (!NT_STATUS_IS_OK(status)) {703 DEBUG(3, ("could not append group SID from rid 0x%x\n",704 info3->base.rid));705 return status;706 }707 }708 709 for (i = 0; i < info3->base.groups.count; i++) {710 711 if (!sid_compose(&sid, info3->base.domain_sid, 711 info3->base.groups.rids[i].rid)) 712 { 712 info3->base.groups.rids[i].rid)) { 713 713 DEBUG(3, ("could not compose SID from additional group " 714 714 "rid 0x%x\n", info3->base.groups.rids[i].rid)); -
trunk/samba/source/lib/util_unistr.c
r133 r149 34 34 static bool lowcase_table_use_unmap; 35 35 static bool valid_table_use_unmap; 36 static bool initialized; 36 37 37 38 /** … … 60 61 SAFE_FREE(valid_table); 61 62 } 63 initialized = false; 62 64 } 63 65 … … 71 73 void load_case_tables(void) 72 74 { 73 static int initialised;74 75 char *old_locale = NULL, *saved_locale = NULL; 75 76 int i; 76 77 TALLOC_CTX *frame = NULL; 77 78 78 if (initiali sed) {79 if (initialized) { 79 80 return; 80 81 } 81 initiali sed = 1;82 initialized = true; 82 83 83 84 frame = talloc_stackframe();
Note:
See TracChangeset
for help on using the changeset viewer.