File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,21 @@ static char *automount_fullpath(struct dentry *dentry, void *page)
168
168
return s ;
169
169
}
170
170
171
+ static void fs_context_set_ids (struct smb3_fs_context * ctx )
172
+ {
173
+ kuid_t uid = current_fsuid ();
174
+ kgid_t gid = current_fsgid ();
175
+
176
+ if (ctx -> multiuser ) {
177
+ if (!ctx -> uid_specified )
178
+ ctx -> linux_uid = uid ;
179
+ if (!ctx -> gid_specified )
180
+ ctx -> linux_gid = gid ;
181
+ }
182
+ if (!ctx -> cruid_specified )
183
+ ctx -> cred_uid = uid ;
184
+ }
185
+
171
186
/*
172
187
* Create a vfsmount that we can automount
173
188
*/
@@ -205,6 +220,7 @@ static struct vfsmount *cifs_do_automount(struct path *path)
205
220
tmp .leaf_fullpath = NULL ;
206
221
tmp .UNC = tmp .prepath = NULL ;
207
222
tmp .dfs_root_ses = NULL ;
223
+ fs_context_set_ids (& tmp );
208
224
209
225
rc = smb3_fs_context_dup (ctx , & tmp );
210
226
if (rc ) {
You can’t perform that action at this time.
0 commit comments