Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1629064 > unrolled thread

[PATCH 1/2 linux-next] udf: use octal for permissions

Started byFabian Frederick <fabf@skynet.be>
First post2017-04-23 21:00 +0200
Last post2017-04-24 16:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2 linux-next] udf: use octal for permissions Fabian Frederick <fabf@skynet.be> - 2017-04-23 21:00 +0200
    Re: [PATCH 1/2 linux-next] udf: use octal for permissions Jan Kara <jack@suse.cz> - 2017-04-24 16:30 +0200

#1629064 — [PATCH 1/2 linux-next] udf: use octal for permissions

FromFabian Frederick <fabf@skynet.be>
Date2017-04-23 21:00 +0200
Subject[PATCH 1/2 linux-next] udf: use octal for permissions
Message-ID<tzuTL-3JU-1@gated-at.bofh.it>
According to commit f90774e1fd27 ("checkpatch: look for symbolic
permissions and suggest octal instead")

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/udf/inode.c | 14 +++++++-------
 fs/udf/namei.c |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index a8d8f71..8715dcd 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1535,7 +1535,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode)
 		inode->i_data.a_ops = &udf_symlink_aops;
 		inode->i_op = &udf_symlink_inode_operations;
 		inode_nohighmem(inode);
-		inode->i_mode = S_IFLNK | S_IRWXUGO;
+		inode->i_mode = S_IFLNK | 0777;
 		break;
 	case ICBTAG_FILE_TYPE_MAIN:
 		udf_debug("METADATA FILE-----\n");
@@ -1591,9 +1591,9 @@ static umode_t udf_convert_permissions(struct fileEntry *fe)
 	permissions = le32_to_cpu(fe->permissions);
 	flags = le16_to_cpu(fe->icbTag.flags);
 
-	mode =	((permissions) & S_IRWXO) |
-		((permissions >> 2) & S_IRWXG) |
-		((permissions >> 4) & S_IRWXU) |
+	mode =	((permissions) & 0007) |
+		((permissions >> 2) & 0070) |
+		((permissions >> 4) & 0700) |
 		((flags & ICBTAG_FLAG_SETUID) ? S_ISUID : 0) |
 		((flags & ICBTAG_FLAG_SETGID) ? S_ISGID : 0) |
 		((flags & ICBTAG_FLAG_STICKY) ? S_ISVTX : 0);
@@ -1669,9 +1669,9 @@ static int udf_update_inode(struct inode *inode, int do_sync)
 	else
 		fe->gid = cpu_to_le32(i_gid_read(inode));
 
-	udfperms = ((inode->i_mode & S_IRWXO)) |
-		   ((inode->i_mode & S_IRWXG) << 2) |
-		   ((inode->i_mode & S_IRWXU) << 4);
+	udfperms = ((inode->i_mode & 0007)) |
+		   ((inode->i_mode & 0070) << 2) |
+		   ((inode->i_mode & 0700) << 4);
 
 	udfperms |= (le32_to_cpu(fe->permissions) &
 		    (FE_PERM_O_DELETE | FE_PERM_O_CHATTR |
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index babf48d..385ee89 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -906,7 +906,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry)
 static int udf_symlink(struct inode *dir, struct dentry *dentry,
 		       const char *symname)
 {
-	struct inode *inode = udf_new_inode(dir, S_IFLNK | S_IRWXUGO);
+	struct inode *inode = udf_new_inode(dir, S_IFLNK | 0777);
 	struct pathComponent *pc;
 	const char *compstart;
 	struct extent_position epos = {};
-- 
2.9.3

[toc] | [next] | [standalone]


#1629632

FromJan Kara <jack@suse.cz>
Date2017-04-24 16:30 +0200
Message-ID<tzNa3-87g-39@gated-at.bofh.it>
In reply to#1629064
On Sun 23-04-17 20:58:15, Fabian Frederick wrote:
> According to commit f90774e1fd27 ("checkpatch: look for symbolic
> permissions and suggest octal instead")

OK, applied. Thanks.

								Honza

> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  fs/udf/inode.c | 14 +++++++-------
>  fs/udf/namei.c |  2 +-
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/udf/inode.c b/fs/udf/inode.c
> index a8d8f71..8715dcd 100644
> --- a/fs/udf/inode.c
> +++ b/fs/udf/inode.c
> @@ -1535,7 +1535,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode)
>  		inode->i_data.a_ops = &udf_symlink_aops;
>  		inode->i_op = &udf_symlink_inode_operations;
>  		inode_nohighmem(inode);
> -		inode->i_mode = S_IFLNK | S_IRWXUGO;
> +		inode->i_mode = S_IFLNK | 0777;
>  		break;
>  	case ICBTAG_FILE_TYPE_MAIN:
>  		udf_debug("METADATA FILE-----\n");
> @@ -1591,9 +1591,9 @@ static umode_t udf_convert_permissions(struct fileEntry *fe)
>  	permissions = le32_to_cpu(fe->permissions);
>  	flags = le16_to_cpu(fe->icbTag.flags);
>  
> -	mode =	((permissions) & S_IRWXO) |
> -		((permissions >> 2) & S_IRWXG) |
> -		((permissions >> 4) & S_IRWXU) |
> +	mode =	((permissions) & 0007) |
> +		((permissions >> 2) & 0070) |
> +		((permissions >> 4) & 0700) |
>  		((flags & ICBTAG_FLAG_SETUID) ? S_ISUID : 0) |
>  		((flags & ICBTAG_FLAG_SETGID) ? S_ISGID : 0) |
>  		((flags & ICBTAG_FLAG_STICKY) ? S_ISVTX : 0);
> @@ -1669,9 +1669,9 @@ static int udf_update_inode(struct inode *inode, int do_sync)
>  	else
>  		fe->gid = cpu_to_le32(i_gid_read(inode));
>  
> -	udfperms = ((inode->i_mode & S_IRWXO)) |
> -		   ((inode->i_mode & S_IRWXG) << 2) |
> -		   ((inode->i_mode & S_IRWXU) << 4);
> +	udfperms = ((inode->i_mode & 0007)) |
> +		   ((inode->i_mode & 0070) << 2) |
> +		   ((inode->i_mode & 0700) << 4);
>  
>  	udfperms |= (le32_to_cpu(fe->permissions) &
>  		    (FE_PERM_O_DELETE | FE_PERM_O_CHATTR |
> diff --git a/fs/udf/namei.c b/fs/udf/namei.c
> index babf48d..385ee89 100644
> --- a/fs/udf/namei.c
> +++ b/fs/udf/namei.c
> @@ -906,7 +906,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry)
>  static int udf_symlink(struct inode *dir, struct dentry *dentry,
>  		       const char *symname)
>  {
> -	struct inode *inode = udf_new_inode(dir, S_IFLNK | S_IRWXUGO);
> +	struct inode *inode = udf_new_inode(dir, S_IFLNK | 0777);
>  	struct pathComponent *pc;
>  	const char *compstart;
>  	struct extent_position epos = {};
> -- 
> 2.9.3
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web