mkfs.ubifs: use gid from table instead 2x uid

Submitted by Sebastian Siewior on Aug. 22, 2014, 4:49 p.m.

Details

Message ID 1408726141-25608-1-git-send-email-bigeasy@linutronix.de
State Accepted
Delegated to: Richard Weinberger
Headers show

Commit Message

Sebastian Siewior Aug. 22, 2014, 4:49 p.m.
If the devtable is used then the tool uses uid twice and doesn't
consider gid at all. This changes it to use gid & uid.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 mkfs.ubifs/mkfs.ubifs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brian Norris Dec. 10, 2015, 12:05 a.m.
With the archaeology hat on...

On Fri, Aug 22, 2014 at 06:49:01PM +0200, Sebastian Andrzej Siewior wrote:
> If the devtable is used then the tool uses uid twice and doesn't
> consider gid at all. This changes it to use gid & uid.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  mkfs.ubifs/mkfs.ubifs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
> index 200c8a5..d7a252c 100644
> --- a/mkfs.ubifs/mkfs.ubifs.c
> +++ b/mkfs.ubifs/mkfs.ubifs.c
> @@ -1535,7 +1535,7 @@ static int add_directory(const char *dir_name, ino_t dir_inum, struct stat *st,
>  
>  		memcpy(&fake_st, &root_st, sizeof(struct stat));
>  		fake_st.st_uid  = nh_elt->uid;
> -		fake_st.st_uid  = nh_elt->uid;
> +		fake_st.st_gid  = nh_elt->gid;
>  		fake_st.st_mode = nh_elt->mode;
>  		fake_st.st_rdev = nh_elt->dev;
>  		fake_st.st_nlink = 1;

LGTM. Applied to mtd-utils.git

Patch hide | download patch | download mbox

diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index 200c8a5..d7a252c 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -1535,7 +1535,7 @@  static int add_directory(const char *dir_name, ino_t dir_inum, struct stat *st,
 
 		memcpy(&fake_st, &root_st, sizeof(struct stat));
 		fake_st.st_uid  = nh_elt->uid;
-		fake_st.st_uid  = nh_elt->uid;
+		fake_st.st_gid  = nh_elt->gid;
 		fake_st.st_mode = nh_elt->mode;
 		fake_st.st_rdev = nh_elt->dev;
 		fake_st.st_nlink = 1;