summaryrefslogtreecommitdiff
path: root/source3/smbd/fake_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/fake_file.c')
-rw-r--r--source3/smbd/fake_file.c49
1 files changed, 13 insertions, 36 deletions
diff --git a/source3/smbd/fake_file.c b/source3/smbd/fake_file.c
index 6898793d29..ef54398bc4 100644
--- a/source3/smbd/fake_file.c
+++ b/source3/smbd/fake_file.c
@@ -71,45 +71,28 @@ static struct fake_file_handle *init_fake_file_handle(enum FAKE_FILE_TYPE type)
Does this name match a fake filename ?
****************************************************************************/
-enum FAKE_FILE_TYPE is_fake_file_path(const char *path)
+enum FAKE_FILE_TYPE is_fake_file(const char *fname)
{
+#ifdef HAVE_SYS_QUOTAS
int i;
+#endif
- if (!path) {
+ if (!fname) {
return FAKE_FILE_TYPE_NONE;
}
+#ifdef HAVE_SYS_QUOTAS
for (i=0;fake_files[i].name!=NULL;i++) {
- if (strncmp(path,fake_files[i].name,strlen(fake_files[i].name))==0) {
- DEBUG(5,("is_fake_file: [%s] is a fake file\n",path));
+ if (strncmp(fname,fake_files[i].name,strlen(fake_files[i].name))==0) {
+ DEBUG(5,("is_fake_file: [%s] is a fake file\n",fname));
return fake_files[i].type;
}
}
+#endif
return FAKE_FILE_TYPE_NONE;
}
-enum FAKE_FILE_TYPE is_fake_file(const struct smb_filename *smb_fname)
-{
- char *fname = NULL;
- NTSTATUS status;
- enum FAKE_FILE_TYPE ret;
-
- if (!smb_fname) {
- return FAKE_FILE_TYPE_NONE;
- }
-
- status = get_full_smb_filename(talloc_tos(), smb_fname, &fname);
- if (!NT_STATUS_IS_OK(status)) {
- return FAKE_FILE_TYPE_NONE;
- }
-
- ret = is_fake_file_path(fname);
-
- TALLOC_FREE(fname);
-
- return ret;
-}
/****************************************************************************
Open a fake quota file with a share mode.
@@ -118,7 +101,7 @@ enum FAKE_FILE_TYPE is_fake_file(const struct smb_filename *smb_fname)
NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
uint16_t current_vuid,
enum FAKE_FILE_TYPE fake_file_type,
- const struct smb_filename *smb_fname,
+ const char *fname,
uint32 access_mask,
files_struct **result)
{
@@ -129,8 +112,7 @@ NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
if (conn->server_info->utok.uid != 0) {
DEBUG(3, ("open_fake_file_shared: access_denied to "
"service[%s] file[%s] user[%s]\n",
- lp_servicename(SNUM(conn)),
- smb_fname_str_dbg(smb_fname),
+ lp_servicename(SNUM(conn)), fname,
conn->server_info->unix_name));
return NT_STATUS_ACCESS_DENIED;
@@ -142,8 +124,7 @@ NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
}
DEBUG(5,("open_fake_file_shared: fname = %s, FID = %d, access_mask = 0x%x\n",
- smb_fname_str_dbg(smb_fname), fsp->fnum,
- (unsigned int)access_mask));
+ fname, fsp->fnum, (unsigned int)access_mask));
fsp->conn = conn;
fsp->fh->fd = -1;
@@ -151,12 +132,8 @@ NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn,
fsp->fh->pos = -1;
fsp->can_lock = False; /* Should this be true ? - No, JRA */
fsp->access_mask = access_mask;
- status = fsp_set_smb_fname(fsp, smb_fname);
- if (!NT_STATUS_IS_OK(status)) {
- file_free(req, fsp);
- return NT_STATUS_NO_MEMORY;
- }
-
+ string_set(&fsp->fsp_name,fname);
+
fsp->fake_file_handle = init_fake_file_handle(fake_file_type);
if (fsp->fake_file_handle==NULL) {