aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifs_fs_sb.h2
-rw-r--r--fs/cifs/cifsproto.h2
-rw-r--r--fs/cifs/connect.c4
-rw-r--r--fs/cifs/dir.c12
-rw-r--r--fs/cifs/inode.c8
-rw-r--r--fs/cifs/ioctl.c2
-rw-r--r--fs/cifs/misc.c4
7 files changed, 17 insertions, 17 deletions
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index 877c85409f1f..1e7b87497f26 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -19,7 +19,7 @@
19#define _CIFS_FS_SB_H 19#define _CIFS_FS_SB_H
20 20
21#define CIFS_MOUNT_NO_PERM 1 /* do not do client vfs_perm check */ 21#define CIFS_MOUNT_NO_PERM 1 /* do not do client vfs_perm check */
22#define CIFS_MOUNT_SET_UID 2 /* set current->euid in create etc. */ 22#define CIFS_MOUNT_SET_UID 2 /* set current's euid in create etc. */
23#define CIFS_MOUNT_SERVER_INUM 4 /* inode numbers from uniqueid from server */ 23#define CIFS_MOUNT_SERVER_INUM 4 /* inode numbers from uniqueid from server */
24#define CIFS_MOUNT_DIRECT_IO 8 /* do not write nor read through page cache */ 24#define CIFS_MOUNT_DIRECT_IO 8 /* do not write nor read through page cache */
25#define CIFS_MOUNT_NO_XATTR 0x10 /* if set - disable xattr support */ 25#define CIFS_MOUNT_NO_XATTR 0x10 /* if set - disable xattr support */
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 6f21ecb85ce5..9d8b978137ad 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -39,7 +39,7 @@ extern int smb_send(struct socket *, struct smb_hdr *,
39 unsigned int /* length */ , struct sockaddr *, bool); 39 unsigned int /* length */ , struct sockaddr *, bool);
40extern unsigned int _GetXid(void); 40extern unsigned int _GetXid(void);
41extern void _FreeXid(unsigned int); 41extern void _FreeXid(unsigned int);
42#define GetXid() (int)_GetXid(); cFYI(1,("CIFS VFS: in %s as Xid: %d with uid: %d",__func__, xid,current->fsuid)); 42#define GetXid() (int)_GetXid(); cFYI(1,("CIFS VFS: in %s as Xid: %d with uid: %d",__func__, xid,current_fsuid()));
43#define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__func__,curr_xid,(int)rc));} 43#define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__func__,curr_xid,(int)rc));}
44extern char *build_path_from_dentry(struct dentry *); 44extern char *build_path_from_dentry(struct dentry *);
45extern char *build_wildcard_path_from_dentry(struct dentry *direntry); 45extern char *build_wildcard_path_from_dentry(struct dentry *direntry);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index c7d341714586..683dee4d2f76 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -836,8 +836,8 @@ cifs_parse_mount_options(char *options, const char *devname,
836 /* null target name indicates to use *SMBSERVR default called name 836 /* null target name indicates to use *SMBSERVR default called name
837 if we end up sending RFC1001 session initialize */ 837 if we end up sending RFC1001 session initialize */
838 vol->target_rfc1001_name[0] = 0; 838 vol->target_rfc1001_name[0] = 0;
839 vol->linux_uid = current->uid; /* current->euid instead? */ 839 vol->linux_uid = current_uid(); /* use current_euid() instead? */
840 vol->linux_gid = current->gid; 840 vol->linux_gid = current_gid();
841 vol->dir_mode = S_IRWXUGO; 841 vol->dir_mode = S_IRWXUGO;
842 /* 2767 perms indicate mandatory locking support */ 842 /* 2767 perms indicate mandatory locking support */
843 vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP); 843 vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP);
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index e962e75e6f7b..2f02c52db666 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -235,11 +235,11 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
235 }; 235 };
236 236
237 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { 237 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
238 args.uid = (__u64) current->fsuid; 238 args.uid = (__u64) current_fsuid();
239 if (inode->i_mode & S_ISGID) 239 if (inode->i_mode & S_ISGID)
240 args.gid = (__u64) inode->i_gid; 240 args.gid = (__u64) inode->i_gid;
241 else 241 else
242 args.gid = (__u64) current->fsgid; 242 args.gid = (__u64) current_fsgid();
243 } else { 243 } else {
244 args.uid = NO_CHANGE_64; 244 args.uid = NO_CHANGE_64;
245 args.gid = NO_CHANGE_64; 245 args.gid = NO_CHANGE_64;
@@ -271,13 +271,13 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
271 if ((oplock & CIFS_CREATE_ACTION) && 271 if ((oplock & CIFS_CREATE_ACTION) &&
272 (cifs_sb->mnt_cifs_flags & 272 (cifs_sb->mnt_cifs_flags &
273 CIFS_MOUNT_SET_UID)) { 273 CIFS_MOUNT_SET_UID)) {
274 newinode->i_uid = current->fsuid; 274 newinode->i_uid = current_fsuid();
275 if (inode->i_mode & S_ISGID) 275 if (inode->i_mode & S_ISGID)
276 newinode->i_gid = 276 newinode->i_gid =
277 inode->i_gid; 277 inode->i_gid;
278 else 278 else
279 newinode->i_gid = 279 newinode->i_gid =
280 current->fsgid; 280 current_fsgid();
281 } 281 }
282 } 282 }
283 } 283 }
@@ -375,8 +375,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
375 .device = device_number, 375 .device = device_number,
376 }; 376 };
377 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { 377 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
378 args.uid = (__u64) current->fsuid; 378 args.uid = (__u64) current_fsuid();
379 args.gid = (__u64) current->fsgid; 379 args.gid = (__u64) current_fsgid();
380 } else { 380 } else {
381 args.uid = NO_CHANGE_64; 381 args.uid = NO_CHANGE_64;
382 args.gid = NO_CHANGE_64; 382 args.gid = NO_CHANGE_64;
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index ff8c68de4a92..8b7305e73d7e 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1143,11 +1143,11 @@ mkdir_get_info:
1143 .device = 0, 1143 .device = 0,
1144 }; 1144 };
1145 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { 1145 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
1146 args.uid = (__u64)current->fsuid; 1146 args.uid = (__u64)current_fsuid();
1147 if (inode->i_mode & S_ISGID) 1147 if (inode->i_mode & S_ISGID)
1148 args.gid = (__u64)inode->i_gid; 1148 args.gid = (__u64)inode->i_gid;
1149 else 1149 else
1150 args.gid = (__u64)current->fsgid; 1150 args.gid = (__u64)current_fsgid();
1151 } else { 1151 } else {
1152 args.uid = NO_CHANGE_64; 1152 args.uid = NO_CHANGE_64;
1153 args.gid = NO_CHANGE_64; 1153 args.gid = NO_CHANGE_64;
@@ -1184,13 +1184,13 @@ mkdir_get_info:
1184 if (cifs_sb->mnt_cifs_flags & 1184 if (cifs_sb->mnt_cifs_flags &
1185 CIFS_MOUNT_SET_UID) { 1185 CIFS_MOUNT_SET_UID) {
1186 direntry->d_inode->i_uid = 1186 direntry->d_inode->i_uid =
1187 current->fsuid; 1187 current_fsuid();
1188 if (inode->i_mode & S_ISGID) 1188 if (inode->i_mode & S_ISGID)
1189 direntry->d_inode->i_gid = 1189 direntry->d_inode->i_gid =
1190 inode->i_gid; 1190 inode->i_gid;
1191 else 1191 else
1192 direntry->d_inode->i_gid = 1192 direntry->d_inode->i_gid =
1193 current->fsgid; 1193 current_fsgid();
1194 } 1194 }
1195 } 1195 }
1196 } 1196 }
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index 0088a5b52564..f94650683a00 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -65,7 +65,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
65 switch (command) { 65 switch (command) {
66 case CIFS_IOC_CHECKUMOUNT: 66 case CIFS_IOC_CHECKUMOUNT:
67 cFYI(1, ("User unmount attempted")); 67 cFYI(1, ("User unmount attempted"));
68 if (cifs_sb->mnt_uid == current->uid) 68 if (cifs_sb->mnt_uid == current_uid())
69 rc = 0; 69 rc = 0;
70 else { 70 else {
71 rc = -EACCES; 71 rc = -EACCES;
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 9ee3f689c2b0..8a82d076450b 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -338,13 +338,13 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
338 /* BB Add support for establishing new tCon and SMB Session */ 338 /* BB Add support for establishing new tCon and SMB Session */
339 /* with userid/password pairs found on the smb session */ 339 /* with userid/password pairs found on the smb session */
340 /* for other target tcp/ip addresses BB */ 340 /* for other target tcp/ip addresses BB */
341 if (current->fsuid != treeCon->ses->linux_uid) { 341 if (current_fsuid() != treeCon->ses->linux_uid) {
342 cFYI(1, ("Multiuser mode and UID " 342 cFYI(1, ("Multiuser mode and UID "
343 "did not match tcon uid")); 343 "did not match tcon uid"));
344 read_lock(&cifs_tcp_ses_lock); 344 read_lock(&cifs_tcp_ses_lock);
345 list_for_each(temp_item, &treeCon->ses->server->smb_ses_list) { 345 list_for_each(temp_item, &treeCon->ses->server->smb_ses_list) {
346 ses = list_entry(temp_item, struct cifsSesInfo, smb_ses_list); 346 ses = list_entry(temp_item, struct cifsSesInfo, smb_ses_list);
347 if (ses->linux_uid == current->fsuid) { 347 if (ses->linux_uid == current_fsuid()) {
348 if (ses->server == treeCon->ses->server) { 348 if (ses->server == treeCon->ses->server) {
349 cFYI(1, ("found matching uid substitute right smb_uid")); 349 cFYI(1, ("found matching uid substitute right smb_uid"));
350 buffer->Uid = ses->Suid; 350 buffer->Uid = ses->Suid;