From 7736d2f65cf0479c6a1588e3656809047a4b3d49 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 12 Sep 2006 02:24:21 +0000 Subject: r18412: Implement NetiNameValidate but just for share name right now (type 9) Simo. (This used to be commit 906429834a102349582017ef73a69e211ef5c500) --- source4/rpc_server/common/server_info.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/rpc_server/common/server_info.c') 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; +} -- cgit