summaryrefslogtreecommitdiff
path: root/source4/param
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/param
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/param')
-rw-r--r--source4/param/loadparm.c18
1 files changed, 18 insertions, 0 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.
********************************************************************/