From b4d944e724f7ae2a97ba788b185aba7b7308b475 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Mon, 31 Mar 2008 23:51:34 +0200 Subject: [PATCH] Fix SRVSVC ShareInfo max_users handling server side. Guenther --- source/rpc_client/init_srvsvc.c | 4 ++-- source/rpc_server/srv_srvsvc_nt.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/rpc_client/init_srvsvc.c b/source/rpc_client/init_srvsvc.c index 7b595683f79..4fa260c2c59 100644 --- a/source/rpc_client/init_srvsvc.c +++ b/source/rpc_client/init_srvsvc.c @@ -158,7 +158,7 @@ void init_srvsvc_NetShareInfo502(struct srvsvc_NetShareInfo502 *r, enum srvsvc_ShareType type, const char *comment, uint32_t permissions, - int32_t max_users, + uint32_t max_users, uint32_t current_users, const char *path, const char *password, @@ -202,7 +202,7 @@ void init_srvsvc_NetShareInfo1005(struct srvsvc_NetShareInfo1005 *r, ********************************************************************/ void init_srvsvc_NetShareInfo1006(struct srvsvc_NetShareInfo1006 *r, - int32_t max_users) + uint32_t max_users) { r->max_users = max_users; } diff --git a/source/rpc_server/srv_srvsvc_nt.c b/source/rpc_server/srv_srvsvc_nt.c index 6d7561ed5f3..57b42af4e5d 100644 --- a/source/rpc_server/srv_srvsvc_nt.c +++ b/source/rpc_server/srv_srvsvc_nt.c @@ -291,7 +291,7 @@ static void init_srv_share_info_2(pipes_struct *p, struct srvsvc_NetShareInfo2 * char *remark = NULL; char *path = NULL; int max_connections = lp_max_connections(snum); - uint32 max_uses = max_connections!=0 ? max_connections : 0xffffffff; + uint32_t max_uses = max_connections!=0 ? max_connections : (uint32_t)-1; int count = 0; char *net_name = lp_servicename(snum); @@ -401,7 +401,7 @@ static void init_srv_share_info_502(pipes_struct *p, struct srvsvc_NetShareInfo5 get_share_type(snum), remark ? remark : "", 0, - 0xffffffff, + (uint32_t)-1, 1, path ? path : "", "", @@ -447,7 +447,7 @@ static void init_srv_share_info_1005(pipes_struct *p, struct srvsvc_NetShareInfo static void init_srv_share_info_1006(pipes_struct *p, struct srvsvc_NetShareInfo1006 *r, int snum) { - init_srvsvc_NetShareInfo1006(r, 0xffffffff); + init_srvsvc_NetShareInfo1006(r, (uint32_t)-1); } /*************************************************************************** @@ -1525,7 +1525,7 @@ WERROR _srvsvc_NetShareSetInfo(pipes_struct *p, comment = talloc_strdup(ctx, info->info2->comment); pathname = info->info2->path; type = info->info2->type; - max_connections = (info->info2->max_users == 0xffffffff) ? + max_connections = (info->info2->max_users == (uint32_t)-1) ? 0 : info->info2->max_users; psd = NULL; break; @@ -1720,7 +1720,7 @@ WERROR _srvsvc_NetShareAdd(pipes_struct *p, share_name = talloc_strdup(ctx, r->in.info->info2->name); comment = talloc_strdup(ctx, r->in.info->info2->comment); pathname = talloc_strdup(ctx, r->in.info->info2->path); - max_connections = (r->in.info->info2->max_users == 0xffffffff) ? + max_connections = (r->in.info->info2->max_users == (uint32_t)-1) ? 0 : r->in.info->info2->max_users; type = r->in.info->info2->type; break; @@ -1731,7 +1731,7 @@ WERROR _srvsvc_NetShareAdd(pipes_struct *p, share_name = talloc_strdup(ctx, r->in.info->info502->name); comment = talloc_strdup(ctx, r->in.info->info502->comment); pathname = talloc_strdup(ctx, r->in.info->info502->path); - max_connections = (r->in.info->info502->max_users == 0xffffffff) ? + max_connections = (r->in.info->info502->max_users == (uint32_t)-1) ? 0 : r->in.info->info502->max_users; type = r->in.info->info502->type; psd = r->in.info->info502->sd; -- 2.11.4.GIT