summaryrefslogtreecommitdiff
path: root/source4/rpc_server/common
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-09-12 02:24:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:25 -0500
commit7736d2f65cf0479c6a1588e3656809047a4b3d49 (patch)
treed5c83a090e3d177a40b9d6db8b13cd7e4f25511a /source4/rpc_server/common
parent33c4fea4cdf7d5418423a81e53ce7b051500f287 (diff)
downloadsamba-7736d2f65cf0479c6a1588e3656809047a4b3d49.tar.gz
samba-7736d2f65cf0479c6a1588e3656809047a4b3d49.tar.bz2
samba-7736d2f65cf0479c6a1588e3656809047a4b3d49.zip
r18412: Implement NetiNameValidate but just for share name right now (type 9)
Simo. (This used to be commit 906429834a102349582017ef73a69e211ef5c500)
Diffstat (limited to 'source4/rpc_server/common')
-rw-r--r--source4/rpc_server/common/server_info.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c
index cd8106c03a..12f5c90e8d 100644
--- a/source4/rpc_server/common/server_info.c
+++ b/source4/rpc_server/common/server_info.c
@@ -132,4 +132,13 @@ _PUBLIC_ const char *dcesrv_common_get_userpath(TALLOC_CTX *mem_ctx, struct dces
return talloc_strdup(mem_ctx, "c:\\");
}
+#define INVALID_SHARE_NAME_CHARS " \"*+,./:;<=>?[\\]|"
+_PUBLIC_ bool dcesrv_common_validate_share_name(TALLOC_CTX *mem_ctx, const char *share_name)
+{
+ if (strpbrk(share_name, INVALID_SHARE_NAME_CHARS)) {
+ return False;
+ }
+
+ return True;
+}