1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

s3: smbd: cleanup. Change 'int referral_count' -> 'size_t referral_count' in struct junction_map.

This is a non-negative count. Fix remaing code to not mix int and size_t.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison
2019-12-13 09:52:31 -08:00
committed by Ralph Boehme
parent 2048ff3adc
commit cc1ec0a9f1
4 changed files with 13 additions and 11 deletions

View File

@ -53,7 +53,7 @@ struct junction_map {
char *service_name;
char *volume_name;
const char *comment;
int referral_count;
size_t referral_count;
struct referral* referral_list;
};

View File

@ -192,7 +192,7 @@ static NTSTATUS vfswrap_get_dfs_referrals(struct vfs_handle_struct *handle,
char *pathnamep = NULL;
char *local_dfs_path = NULL;
NTSTATUS status;
int i;
size_t i;
uint16_t max_referral_level = r->in.req.max_referral_level;
if (DEBUGLVL(10)) {

View File

@ -162,9 +162,11 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r)
return WERR_NERR_DFSNOSUCHVOLUME;
}
} else {
int i=0;
size_t i = 0;
/* compare each referral in the list with the one to remove */
DEBUG(10,("altpath: .%s. refcnt: %d\n", altpath, jn->referral_count));
DBG_DEBUG("altpath: .%s. refcnt: %zu\n",
altpath,
jn->referral_count);
for(i=0;i<jn->referral_count;i++) {
char *refpath = talloc_strdup(ctx,
jn->referral_list[i].alternate_path);
@ -226,7 +228,7 @@ static bool init_reply_dfs_info_2(TALLOC_CTX *mem_ctx, struct junction_map* j, s
static bool init_reply_dfs_info_3(TALLOC_CTX *mem_ctx, struct junction_map* j, struct dfs_Info3* dfs3)
{
int ii;
size_t ii;
if (j->volume_name[0] == '\0')
dfs3->path = talloc_asprintf(mem_ctx, "\\\\%s\\%s",
lp_netbios_name(), j->service_name);
@ -268,7 +270,7 @@ static bool init_reply_dfs_info_3(TALLOC_CTX *mem_ctx, struct junction_map* j, s
continue;
}
*p = '\0';
DEBUG(5,("storage %d: %s.%s\n",ii,path,p+1));
DBG_INFO("storage %zu: %s.%s\n",ii,path,p+1);
stor->state = 2; /* set all stores as ONLINE */
stor->server = talloc_strdup(mem_ctx, path);
stor->share = talloc_strdup(mem_ctx, p+1);

View File

@ -535,12 +535,12 @@ static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
int snum,
const char *target,
struct referral **preflist,
int *refcount)
size_t *refcount)
{
char *temp = NULL;
char *prot;
char **alt_path = NULL;
int count = 0, i;
size_t count = 0, i;
struct referral *reflist;
char *saveptr;
@ -570,7 +570,7 @@ static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
shuffle_strlist(alt_path, count);
}
DEBUG(10,("parse_msdfs_symlink: count=%d\n", count));
DBG_DEBUG("count=%zu\n", count);
if (count) {
reflist = *preflist = talloc_zero_array(ctx,
@ -1083,7 +1083,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
if (pdp->reqpath[0] == '\0') {
char *tmp;
struct referral *ref;
int refcount;
size_t refcount;
if (*lp_msdfs_proxy(talloc_tos(), lp_sub, snum) == '\0') {
TALLOC_FREE(frame);
@ -1363,7 +1363,7 @@ bool create_msdfs_link(const struct junction_map *jucn)
char *path = NULL;
char *msdfs_link = NULL;
connection_struct *conn;
int i=0;
size_t i = 0;
bool insert_comma = False;
bool ret = False;
struct smb_filename *smb_fname = NULL;