summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-12-21 16:26:34 +0100
committerKarolin Seeger <kseeger@samba.org>2010-01-13 14:01:06 +0100
commit2dbe990fe492872d3a9e63cc1115e6f8b363faa1 (patch)
tree9945defb491c9727ca2ef5a68bbc386bd640b987
parent191b247bd3fc2c8644cbf7c36c7c5e9465674ada (diff)
downloadsamba-2dbe990fe492872d3a9e63cc1115e6f8b363faa1.tar.gz
samba-2dbe990fe492872d3a9e63cc1115e6f8b363faa1.tar.xz
samba-2dbe990fe492872d3a9e63cc1115e6f8b363faa1.zip
smbd: Fix opening the quota magic file
This fixes bug #6642 and bug #6919. metze (cherry picked from commit c30bd2f2ac1c79a4c3893b2c28e0ba7997685c01)
-rw-r--r--source/smbd/reply.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index 8c20e95306b..1141cfe0ec7 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -50,9 +50,9 @@ static NTSTATUS check_path_syntax_internal(char *path,
{
char *d = path;
const char *s = path;
- NTSTATUS ret = NT_STATUS_OK;
bool start_of_name_component = True;
bool stream_started = false;
+ bool check_quota = false;
*p_last_component_contains_wcard = False;
@@ -70,7 +70,7 @@ static NTSTATUS check_path_syntax_internal(char *path,
return NT_STATUS_OBJECT_NAME_INVALID;
}
if (StrCaseCmp(s, ":$DATA") != 0) {
- return NT_STATUS_INVALID_PARAMETER;
+ check_quota = true;
}
break;
}
@@ -131,8 +131,7 @@ static NTSTATUS check_path_syntax_internal(char *path,
/* Are we at the start ? Can't go back further if so. */
if (d <= path) {
- ret = NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
- break;
+ return NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
}
/* Go back one level... */
/* We know this is safe as '/' cannot be part of a mb sequence. */
@@ -205,7 +204,13 @@ static NTSTATUS check_path_syntax_internal(char *path,
*d = '\0';
- return ret;
+ if (check_quota) {
+ if (StrCaseCmp(path, FAKE_FILE_NAME_QUOTA_UNIX) != 0) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ }
+
+ return NT_STATUS_OK;
}
/****************************************************************************