summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-05-31 00:48:40 +0000
committerTim Potter <tpot@samba.org>2002-05-31 00:48:40 +0000
commitc3fb0cd9edd8944d7278cb716b52fbf16939f044 (patch)
treeb780b365fc76d7922d129d5db2a6ec9fbf4bfa8b /source3
parentabc6c4e77ff0d167d718633691288864f185ff31 (diff)
downloadsamba-c3fb0cd9edd8944d7278cb716b52fbf16939f044.tar.gz
samba-c3fb0cd9edd8944d7278cb716b52fbf16939f044.tar.bz2
samba-c3fb0cd9edd8944d7278cb716b52fbf16939f044.zip
Return access denied for net_share_enum when restrict anonymous > 0
(This used to be commit 5df1aa9f20ae2036848b7e46703bfd3a923d7b4f)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 1f3b1945e3..f14928f9f2 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -564,8 +564,25 @@ static BOOL init_srv_share_info_ctr(pipes_struct *p, SRV_SHARE_INFO_CTR *ctr,
static void init_srv_r_net_share_enum(pipes_struct *p, SRV_R_NET_SHARE_ENUM *r_n,
uint32 info_level, uint32 resume_hnd, BOOL all)
{
+ user_struct *user;
+
DEBUG(5,("init_srv_r_net_share_enum: %d\n", __LINE__));
+ /* Don't let anonymous users access this RPC */
+
+ if (!(user = get_valid_user_struct(p->vuid))) {
+ DEBUG(3, ("invalid vuid %d in init_srv_r_net_share_enum()\n",
+ p->vuid));
+ r_n->status = WERR_ACCESS_DENIED;
+ return;
+ }
+
+ if (lp_restrict_anonymous() > 0 && user->guest) {
+ DEBUG(5, ("access denied to anonymous connection"));
+ r_n->status = WERR_ACCESS_DENIED;
+ return;
+ }
+
if (init_srv_share_info_ctr(p, &r_n->ctr, info_level,
&resume_hnd, &r_n->total_entries, all)) {
r_n->status = WERR_OK;