summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-21 10:06:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:16 -0500
commite0dcbe8dd1d89670a2b4df0415b41b66b70fe487 (patch)
treea940b15643a5765e186da7065e21619679478ff7 /source4
parent8b4da058bcc49a91b332d2999a34e0bb45e0f680 (diff)
downloadsamba-e0dcbe8dd1d89670a2b4df0415b41b66b70fe487.tar.gz
samba-e0dcbe8dd1d89670a2b4df0415b41b66b70fe487.tar.bz2
samba-e0dcbe8dd1d89670a2b4df0415b41b66b70fe487.zip
r15769: this functions belong to params/ so move it.
metze (This used to be commit 9c4c40772bfd8a8324cd086c2234451d164be5d0)
Diffstat (limited to 'source4')
-rw-r--r--source4/param/loadparm.c18
-rw-r--r--source4/smb_server/smb/service.c2
-rw-r--r--source4/smb_server/smb2/tcon.c2
-rw-r--r--source4/smb_server/tcon.c18
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,