a ksmbd server fix
-----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmi4/KAACgkQiiy9cAdy T1FaMQv6Ajof6zQK1yFVsteTl+hGqG29fuwSOTgRiiYX1FDy1R9TVwCGCsRRj89n ApZ86eXryL+w382XlhL3KArvwseJvC69AZLGkA581os8MsrOtSiTSQAaHsrKRnvd kUbIm/UnlxfvkPveclSDN35Hh8b2yzEXmqG2lq2DvCm9Y9CGdz7dwKwD+AMCyTtZ mzx03DEBlf6NFzOdhj/KWmTxluqN8nicdi6OjAzDO7MFTR+HtGsTgv7runEGGSzM +ajC9zirjcCqvjlG74mF9kePB3hzwRo17to44mRAmwVYywCB1+2b84p+IsRM+48c nlx5fHCTzOtxuvm+WpctqU3ZlhQxAuQpasyA+HxsZMH/adj6lQZ89RWtmhjjTa+Y 4pUR7rvf+RcooYdc7XQDANJOoV6eEd+XxULEgo5xb6uJKy83V98No45hPITtAR02 9bpU4300e+pXE7ekQ6geIsBRylVRRRooDVDy6BVdg5Fked6no6tprGnhiZs8UK9a MZq7+8xQ =esJU -----END PGP SIGNATURE----- Merge tag 'v6.17-rc4-ksmbd-fix' of git://git.samba.org/ksmbd Pull smb server fix from Steve French: - fix handling filenames with ":" (colon) in them * tag 'v6.17-rc4-ksmbd-fix' of git://git.samba.org/ksmbd: ksmbd: allow a filename to contain colons on SMB3.1.1 posix extensions
This commit is contained in:
commit
08b06c30a4
|
@ -2951,18 +2951,19 @@ int smb2_open(struct ksmbd_work *work)
|
|||
}
|
||||
|
||||
ksmbd_debug(SMB, "converted name = %s\n", name);
|
||||
if (strchr(name, ':')) {
|
||||
if (!test_share_config_flag(work->tcon->share_conf,
|
||||
KSMBD_SHARE_FLAG_STREAMS)) {
|
||||
rc = -EBADF;
|
||||
goto err_out2;
|
||||
}
|
||||
rc = parse_stream_name(name, &stream_name, &s_type);
|
||||
if (rc < 0)
|
||||
goto err_out2;
|
||||
}
|
||||
|
||||
if (posix_ctxt == false) {
|
||||
if (strchr(name, ':')) {
|
||||
if (!test_share_config_flag(work->tcon->share_conf,
|
||||
KSMBD_SHARE_FLAG_STREAMS)) {
|
||||
rc = -EBADF;
|
||||
goto err_out2;
|
||||
}
|
||||
rc = parse_stream_name(name, &stream_name, &s_type);
|
||||
if (rc < 0)
|
||||
goto err_out2;
|
||||
}
|
||||
|
||||
rc = ksmbd_validate_filename(name);
|
||||
if (rc < 0)
|
||||
goto err_out2;
|
||||
|
@ -3443,6 +3444,8 @@ int smb2_open(struct ksmbd_work *work)
|
|||
fp->attrib_only = !(req->DesiredAccess & ~(FILE_READ_ATTRIBUTES_LE |
|
||||
FILE_WRITE_ATTRIBUTES_LE | FILE_SYNCHRONIZE_LE));
|
||||
|
||||
fp->is_posix_ctxt = posix_ctxt;
|
||||
|
||||
/* fp should be searchable through ksmbd_inode.m_fp_list
|
||||
* after daccess, saccess, attrib_only, and stream are
|
||||
* initialized.
|
||||
|
@ -5988,7 +5991,7 @@ static int smb2_rename(struct ksmbd_work *work,
|
|||
if (IS_ERR(new_name))
|
||||
return PTR_ERR(new_name);
|
||||
|
||||
if (strchr(new_name, ':')) {
|
||||
if (fp->is_posix_ctxt == false && strchr(new_name, ':')) {
|
||||
int s_type;
|
||||
char *xattr_stream_name, *stream_name = NULL;
|
||||
size_t xattr_stream_size;
|
||||
|
|
|
@ -112,6 +112,8 @@ struct ksmbd_file {
|
|||
bool is_durable;
|
||||
bool is_persistent;
|
||||
bool is_resilient;
|
||||
|
||||
bool is_posix_ctxt;
|
||||
};
|
||||
|
||||
static inline void set_ctx_actor(struct dir_context *ctx,
|
||||
|
|
Loading…
Reference in New Issue