return true;
}
-static bool smbd_marshall_dir_entry(TALLOC_CTX *ctx,
+static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,
connection_struct *conn,
uint16_t flags2,
uint32_t info_level,
"for padding (wanted %u, had %d)\n",
(unsigned int)pad,
space_remaining ));
- return false; /* Not finished - just out of space */
+ return STATUS_MORE_ENTRIES; /* Not finished - just out of space */
}
off += pad;
fname, PTR_DIFF(end_data, p),
STR_TERMINATE, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
if (flags2 & FLAGS2_UNICODE_STRINGS) {
if (len > 2) {
p, fname, PTR_DIFF(end_data, p),
STR_TERMINATE | STR_NOALIGN, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
if (flags2 & FLAGS2_UNICODE_STRINGS) {
if (len > 2) {
DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_EA_LIST\n"));
if (!name_list) {
- return false;
+ return NT_STATUS_INVALID_PARAMETER;
}
if (requires_resume_key) {
SIVAL(p,0,reskey);
"(wanted %u, had %d)\n",
(unsigned int)PTR_DIFF(p + 255 + ea_len,pdata),
space_remaining ));
- return False; /* Not finished - just out of space */
+ return STATUS_MORE_ENTRIES; /* Not finished - just out of space */
}
/* Push the ea_data followed by the name. */
p + 1, fname, PTR_DIFF(end_data, p+1),
STR_TERMINATE | STR_NOALIGN, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
if (flags2 & FLAGS2_UNICODE_STRINGS) {
if (len > 2) {
p+2, mangled_name, 24,
STR_UPPER|STR_UNICODE, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
if (len < 24) {
memset(p + 2 + len,'\0',24 - len);
fname, PTR_DIFF(end_data, p),
STR_TERMINATE_ASCII, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
SIVAL(q,0,len);
p += len;
p + 4, fname, PTR_DIFF(end_data, p+4),
STR_TERMINATE_ASCII, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
SIVAL(p,0,len);
p += 4 + len;
fname, PTR_DIFF(end_data, p),
STR_TERMINATE_ASCII, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
SIVAL(q, 0, len);
p += len;
fname, PTR_DIFF(end_data, p),
STR_TERMINATE_ASCII, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
SIVAL(p, -4, len);
p += len;
fname, PTR_DIFF(end_data, p),
STR_TERMINATE_ASCII, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
SIVAL(q, 0, len);
p += len;
p+2, mangled_name, 24,
STR_UPPER|STR_UNICODE, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
SSVAL(p, 0, len);
if (len < 24) {
fname, PTR_DIFF(end_data, p),
STR_TERMINATE_ASCII, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
SIVAL(q,0,len);
p += len;
fname, PTR_DIFF(end_data, p),
STR_TERMINATE, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
} else {
DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_FILE_UNIX_INFO2\n"));
status = srvstr_push(base_data, flags2, p, fname,
PTR_DIFF(end_data, p), 0, &len);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
SIVAL(nameptr, 0, len);
}
break;
default:
- return false;
+ return NT_STATUS_INVALID_LEVEL;
}
if (PTR_DIFF(p,pdata) > space_remaining) {
"(wanted %u, had %d)\n",
(unsigned int)PTR_DIFF(p,pdata),
space_remaining ));
- return false; /* Not finished - just out of space */
+ return STATUS_MORE_ENTRIES; /* Not finished - just out of space */
}
/* Setup the last entry pointer, as an offset from base_data */
/* Advance the data pointer to the next slot */
*ppdata = p;
- return true;
+ return NT_STATUS_OK;
}
bool smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
struct smbd_dirptr_lanman2_state state;
bool ok;
uint64_t last_entry_off = 0;
+ NTSTATUS status;
ZERO_STRUCT(state);
state.conn = conn;
*got_exact_match = state.got_exact_match;
- ok = smbd_marshall_dir_entry(ctx,
+ status = smbd_marshall_dir_entry(ctx,
conn,
flags2,
info_level,
&last_entry_off);
TALLOC_FREE(fname);
TALLOC_FREE(smb_fname);
- if (*out_of_space) {
+ if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
dptr_SeekDir(dirptr, prev_dirpos);
return false;
}
- if (!ok) {
+ if (!NT_STATUS_IS_OK(status)) {
return false;
}