Commit d592a91
ksmbd: don't allow O_TRUNC open on read-only share
When file is changed using notepad on read-only share(read_only = yes in
ksmbd.conf), There is a problem where existing data is truncated.
notepad in windows try to O_TRUNC open(FILE_OVERWRITE_IF) and all data
in file is truncated. This patch don't allow O_TRUNC open on read-only
share and add KSMBD_TREE_CONN_FLAG_WRITABLE check in smb2_set_info().
Cc: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>1 parent 8d99c11 commit d592a91
1 file changed
+9
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2972 | 2972 | | |
2973 | 2973 | | |
2974 | 2974 | | |
2975 | | - | |
| 2975 | + | |
2976 | 2976 | | |
2977 | 2977 | | |
2978 | 2978 | | |
| |||
5944 | 5944 | | |
5945 | 5945 | | |
5946 | 5946 | | |
5947 | | - | |
5948 | | - | |
5949 | | - | |
5950 | | - | |
5951 | | - | |
5952 | | - | |
5953 | 5947 | | |
5954 | 5948 | | |
5955 | 5949 | | |
| |||
5969 | 5963 | | |
5970 | 5964 | | |
5971 | 5965 | | |
5972 | | - | |
5973 | | - | |
5974 | | - | |
5975 | | - | |
5976 | | - | |
5977 | | - | |
5978 | 5966 | | |
5979 | 5967 | | |
5980 | 5968 | | |
| |||
6036 | 6024 | | |
6037 | 6025 | | |
6038 | 6026 | | |
6039 | | - | |
| 6027 | + | |
6040 | 6028 | | |
6041 | 6029 | | |
6042 | 6030 | | |
| |||
6056 | 6044 | | |
6057 | 6045 | | |
6058 | 6046 | | |
| 6047 | + | |
| 6048 | + | |
| 6049 | + | |
| 6050 | + | |
| 6051 | + | |
| 6052 | + | |
| 6053 | + | |
6059 | 6054 | | |
6060 | 6055 | | |
6061 | 6056 | | |
| |||
0 commit comments