diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-03-29 09:35:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:00 -0500 |
commit | bc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478 (patch) | |
tree | 45124e070043ee0fd3774d74b4cfdcf1c8919c27 /source3/libsmb | |
parent | b9461058d59f8e4f4b69c31592bd12a179b2d8ac (diff) | |
download | samba-bc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478.tar.gz samba-bc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478.tar.bz2 samba-bc2b6436d0f5f3e9ffdfaeb7f1b32996a83d5478.zip |
r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users
metze
(This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/samlogon_cache.c | 4 | ||||
-rw-r--r-- | source3/libsmb/smb_share_modes.c | 14 | ||||
-rw-r--r-- | source3/libsmb/unexpected.c | 6 |
3 files changed, 12 insertions, 12 deletions
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c index e82ee8dbb8..61dddb62fd 100644 --- a/source3/libsmb/samlogon_cache.c +++ b/source3/libsmb/samlogon_cache.c @@ -156,7 +156,7 @@ BOOL netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user ) if ( net_io_user_info3("", user, &ps, 0, 3, 0) ) { data.dsize = prs_offset( &ps ); - data.dptr = prs_data_p( &ps ); + data.dptr = (uint8 *)prs_data_p( &ps ); if (tdb_store_bystring(netsamlogon_tdb, keystr, data, TDB_REPLACE) != -1) result = True; @@ -198,7 +198,7 @@ NET_USER_INFO_3* netsamlogon_cache_get( TALLOC_CTX *mem_ctx, const DOM_SID *user return NULL; prs_init( &ps, 0, mem_ctx, UNMARSHALL ); - prs_give_memory( &ps, data.dptr, data.dsize, True ); + prs_give_memory( &ps, (char *)data.dptr, data.dsize, True ); if ( !prs_uint32( "timestamp", &ps, 0, &t ) ) { prs_mem_free( &ps ); diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index 4c49ecb7bd..e98de5e264 100644 --- a/source3/libsmb/smb_share_modes.c +++ b/source3/libsmb/smb_share_modes.c @@ -96,7 +96,7 @@ static TDB_DATA get_locking_key(uint64_t dev, uint64_t ino) memset(&lk, '\0', sizeof(struct locking_key)); lk.dev = (SMB_DEV_T)dev; lk.inode = (SMB_INO_T)ino; - ld.dptr = (char *)&lk; + ld.dptr = (uint8 *)&lk; ld.dsize = sizeof(lk); return ld; } @@ -258,13 +258,13 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx, int orig_num_share_modes = 0; struct locking_data *ld = NULL; /* internal samba db state. */ struct share_mode_entry *shares = NULL; - char *new_data_p = NULL; + uint8 *new_data_p = NULL; size_t new_data_size = 0; db_data = tdb_fetch(db_ctx->smb_tdb, locking_key); if (!db_data.dptr) { /* We must create the entry. */ - db_data.dptr = (char *)malloc( + db_data.dptr = (uint8 *)malloc( (2*sizeof(struct share_mode_entry)) + strlen(sharepath) + 1 + strlen(filename) + 1); @@ -299,7 +299,7 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx, } /* Entry exists, we must add a new entry. */ - new_data_p = (char *)malloc( + new_data_p = (uint8 *)malloc( db_data.dsize + sizeof(struct share_mode_entry)); if (!new_data_p) { free(db_data.dptr); @@ -370,10 +370,10 @@ int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx, int orig_num_share_modes = 0; struct locking_data *ld = NULL; /* internal samba db state. */ struct share_mode_entry *shares = NULL; - char *new_data_p = NULL; + uint8 *new_data_p = NULL; size_t remaining_size = 0; size_t i, num_share_modes; - const char *remaining_ptr = NULL; + const uint8 *remaining_ptr = NULL; db_data = tdb_fetch(db_ctx->smb_tdb, locking_key); if (!db_data.dptr) { @@ -397,7 +397,7 @@ int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx, } /* More than one - allocate a new record minus the one we'll delete. */ - new_data_p = (char *)malloc( + new_data_p = (uint8 *)malloc( db_data.dsize - sizeof(struct share_mode_entry)); if (!new_data_p) { free(db_data.dptr); diff --git a/source3/libsmb/unexpected.c b/source3/libsmb/unexpected.c index 97d6071e71..5aee16e4c6 100644 --- a/source3/libsmb/unexpected.c +++ b/source3/libsmb/unexpected.c @@ -63,9 +63,9 @@ void unexpected_packet(struct packet_struct *p) key.timestamp = p->timestamp; key.count = count++; - kbuf.dptr = (char *)&key; + kbuf.dptr = (uint8_t *)&key; kbuf.dsize = sizeof(key); - dbuf.dptr = buf; + dbuf.dptr = (uint8_t *)buf; dbuf.dsize = len; tdb_store(tdbd, kbuf, dbuf, TDB_REPLACE); @@ -124,7 +124,7 @@ static int traverse_match(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf, void if (key.packet_type != match_type) return 0; - p = parse_packet(dbuf.dptr, dbuf.dsize, match_type); + p = parse_packet((char *)dbuf.dptr, dbuf.dsize, match_type); if ((match_type == NMB_PACKET && p->packet.nmb.header.name_trn_id == match_id) || |