-^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_fifo_reparse\(fileserver_smb1\)
-^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_sock_reparse\(fileserver_smb1\)
^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_reparsepoint_posix_type\(fileserver_smb1\)
DATA_BLOB *new_cookie);
struct smb3_file_posix_information;
-void smb3_file_posix_information_init(
+NTSTATUS smb3_file_posix_information_init(
connection_struct *conn,
- const struct stat_ex *st,
- uint32_t reparse_tag,
+ const struct smb_filename *smb_fname,
uint32_t dos_attributes,
struct smb3_file_posix_information *dst);
#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/smb3posix.h"
#include "libcli/security/security.h"
+#include "source3/modules/util_reparse.h"
-void smb3_file_posix_information_init(
+NTSTATUS smb3_file_posix_information_init(
connection_struct *conn,
- const struct stat_ex *st,
- uint32_t reparse_tag,
+ const struct smb_filename *smb_fname,
uint32_t dos_attributes,
struct smb3_file_posix_information *dst)
{
+ const struct stat_ex *st = &smb_fname->st;
+ uint32_t reparse_tag = 0;
+ NTSTATUS status;
+
switch (st->st_ex_mode & S_IFMT) {
case S_IFREG:
case S_IFDIR:
break;
}
+ if (dos_attributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ status = fsctl_get_reparse_tag(smb_fname->fsp,
+ &reparse_tag);
+ if (!NT_STATUS_IS_OK(status)) {
+ DBG_DEBUG("Could not get reparse "
+ "tag for %s: %s\n",
+ smb_fname_str_dbg(smb_fname),
+ nt_errstr(status));
+ return status;
+ }
+ }
+
*dst = (struct smb3_file_posix_information) {
.end_of_file = get_file_size_stat(st),
.allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn,NULL,st),
if (st->st_ex_gid != (uid_t)-1) {
gid_to_sid(&dst->cc.group, st->st_ex_gid);
}
+ return NT_STATUS_OK;
}
.fixed_buf_size = true,
};
enum ndr_err_code ndr_err;
- uint32_t tag = 0;
DBG_DEBUG("FSCC_FILE_POSIX_INFORMATION\n");
return NT_STATUS_INVALID_LEVEL;
}
- if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
- status = fsctl_get_reparse_tag(smb_fname->fsp,
- &tag);
- if (!NT_STATUS_IS_OK(status)) {
- DBG_DEBUG("Could not get reparse "
- "tag for %s: %s\n",
- smb_fname_str_dbg(smb_fname),
- nt_errstr(status));
- return status;
- }
+ status = smb3_file_posix_information_init(
+ conn, smb_fname, mode, &info);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
- smb3_file_posix_information_init(
- conn, &smb_fname->st, tag, mode, &info);
-
ndr_err = ndr_push_smb3_file_posix_information(
&ndr, NDR_SCALARS|NDR_BUFFERS, &info);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
return NT_STATUS_INVALID_LEVEL;
}
- smb3_file_posix_information_init(
- conn, &smb_fname->st, 0, mode, &info);
+ status = smb3_file_posix_information_init(
+ conn, smb_fname, mode, &info);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
ndr_err = ndr_push_smb3_file_posix_information(
&ndr, NDR_SCALARS|NDR_BUFFERS, &info);