diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/param/loadparm.c | 18 | ||||
-rw-r--r-- | source4/smb_server/smb/service.c | 2 | ||||
-rw-r--r-- | source4/smb_server/smb2/tcon.c | 2 | ||||
-rw-r--r-- | source4/smb_server/tcon.c | 18 |
4 files changed, 20 insertions, 20 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index c46cf51f4b..183cec802d 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -2543,6 +2543,24 @@ int lp_servicenumber(const char *pszServiceName) return (iService); } +int lp_find_valid_service(const char *pszServiceName) +{ + int iService; + + iService = lp_servicenumber(pszServiceName); + + if (iService >= 0 && !lp_snum_ok(iService)) { + DEBUG(0,("lp_find_valid_service: Invalid snum %d for '%s'\n",iService, pszServiceName)); + iService = -1; + } + + if (iService == -1) { + DEBUG(3,("lp_find_valid_service: failed to find service '%s'\n", pszServiceName)); + } + + return iService; +} + /******************************************************************* A useful volume label function. ********************************************************************/ diff --git a/source4/smb_server/smb/service.c b/source4/smb_server/smb/service.c index 176b954ac6..676f417619 100644 --- a/source4/smb_server/smb/service.c +++ b/source4/smb_server/smb/service.c @@ -136,7 +136,7 @@ static NTSTATUS make_connection(struct smbsrv_request *req, } } - snum = smbsrv_find_service(service); + snum = lp_find_valid_service(service); if (snum == -1) { DEBUG(0,("couldn't find service %s\n", service)); return NT_STATUS_BAD_NETWORK_NAME; diff --git a/source4/smb_server/smb2/tcon.c b/source4/smb_server/smb2/tcon.c index bfb3904d47..b2270640c8 100644 --- a/source4/smb_server/smb2/tcon.c +++ b/source4/smb_server/smb2/tcon.c @@ -158,7 +158,7 @@ static NTSTATUS smb2srv_tcon_backend(struct smb2srv_request *req, union smb_tcon } } - snum = smbsrv_find_service(service); + snum = lp_find_valid_service(service); if (snum == -1) { DEBUG(0,("smb2srv_tcon_backend: couldn't find service %s\n", service)); return NT_STATUS_BAD_NETWORK_NAME; diff --git a/source4/smb_server/tcon.c b/source4/smb_server/tcon.c index ad278e2e77..ad68ddb836 100644 --- a/source4/smb_server/tcon.c +++ b/source4/smb_server/tcon.c @@ -26,24 +26,6 @@ #include "smbd/service_stream.h" #include "ntvfs/ntvfs.h" -int smbsrv_find_service(const char *service) -{ - int iService; - - iService = lp_servicenumber(service); - - if (iService >= 0 && !lp_snum_ok(iService)) { - DEBUG(0,("smbsrv_find_service: Invalid snum %d for '%s'\n",iService, service)); - iService = -1; - } - - if (iService == -1) { - DEBUG(3,("smbsrv_find_service: failed to find service '%s'\n", service)); - } - - return iService; -} - struct socket_address *smbsrv_get_my_addr(void *p, TALLOC_CTX *mem_ctx) { struct smbsrv_connection *smb_conn = talloc_get_type(p, |