-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfake_perms_fix_symlinks.patch
39 lines (33 loc) · 1.44 KB
/
fake_perms_fix_symlinks.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Description: Don't clobber symlinks with fake_perms
fake_perms turned any non-directory file system object into a file
which broke symlink traversal.
Author: Jan Harkes <jaharkes@cs.cmu.edu>
---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2023-09-08
--- samba-4.17.9+dfsg.orig/source3/modules/vfs_fake_perms.c
+++ samba-4.17.9+dfsg/source3/modules/vfs_fake_perms.c
@@ -41,7 +41,7 @@ static int fake_perms_stat(vfs_handle_st
if (S_ISDIR(smb_fname->st.st_ex_mode)) {
smb_fname->st.st_ex_mode = S_IFDIR | S_IRWXU;
- } else {
+ } else if (S_ISFILE(smb_fname->st.st_ex_mode)) {
smb_fname->st.st_ex_mode = S_IRWXU;
}
@@ -74,7 +74,7 @@ static int fake_perms_fstat(vfs_handle_s
if (S_ISDIR(sbuf->st_ex_mode)) {
sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
- } else {
+ } else if (S_ISFILE(sbuf->st_ex_mode)) {
sbuf->st_ex_mode = S_IRWXU;
}
if (handle->conn->session_info != NULL) {