xfs
[Top] [All Lists]

Re: Compiled 'xfsdump'

To: Dean Brissinger <brissing@xxxxxxxxxx>
Subject: Re: Compiled 'xfsdump'
From: Timothy Shimmin <tes@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 7 Jun 2001 10:57:09 +1000
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <p05100300b7440ca0c052@[192.92.90.17]>; from brissing@xxxxxxxxxx on Wed, Jun 06, 2001 at 10:40:34AM -0600
References: <p05100300b7440ca0c052@[192.92.90.17]>
Sender: owner-linux-xfs@xxxxxxxxxxx
Hi Dean,

On Wed, Jun 06, 2001 at 10:40:34AM -0600, Dean Brissinger wrote:
>   I'm having a heck of a time dealing with a bug with SUID bits in 
> 'xfsrestore' (or 'xfsdump' whichever it is that loses the bits).  
The bits are stored correctly in the dump.
It's just that xfsrestore does a chown after the chmod which clears
the SUID/SGID bits. The fix is to do the chown before the chmod.

> I 
> read somewhere that others have had this problem and it was fixed in 
> the devel tree.  
Yes, as mentioned above.

> I have a firewall that is very disagreeable with 
> CVS.  Is there a place I can obtain a compiled copy of the current 
> dump/restore binaries (and/or whatever I need to fix the lossy SUID 
> bit problem)?
I could email you the binaries directly...

Below are the diffs - which are just movements of code - a reordering
of chmod and chown....

--Tim

*** /usr/tmp/TmpDir.2419384-0/cmd/xfsdump/restore/content.c_1.6 Thu Jun  7 
10:37:32 2001
--- /usr/tmp/TmpDir.2419384-0/cmd/xfsdump/restore/content.c_1.7 Thu Jun  7 
10:37:32 2001
***************
*** 7398,7414 ****
                              strerror( errno ));
                }
  
-               /* set the permissions/mode
-                */
-               rval = fchmod( fd, ( mode_t )bstatp->bs_mode );
-               if ( rval ) {
-                       mlog( MLOG_VERBOSE | MLOG_WARNING,
-                             "unable to set mode "
-                             "of %s: %s\n",
-                             path,
-                             strerror( errno ));
-               }
- 
                /* set the owner and group (if enabled)
                 */
                if ( persp->a.ownerpr ) {
--- 7398,7403 ----
***************
*** 7422,7427 ****
--- 7411,7427 ----
                                      path,
                                      strerror( errno ));
                        }
+               }
+ 
+               /* set the permissions/mode
+                */
+               rval = fchmod( fd, ( mode_t )bstatp->bs_mode );
+               if ( rval ) {
+                       mlog( MLOG_VERBOSE | MLOG_WARNING,
+                             "unable to set mode "
+                             "of %s: %s\n",
+                             path,
+                             strerror( errno ));
                }
  
                rval = close( fd );


*** /usr/tmp/TmpDir.2728373-0/cmd/xfsdump/restore/tree.c_1.3    Thu Jun  7 
10:38:22 2001
--- /usr/tmp/TmpDir.2728373-0/cmd/xfsdump/restore/tree.c_1.4    Thu Jun  7 
10:38:22 2001
***************
*** 2446,2458 ****
                      strerror( errno ));
        }
        mode = dirattr_get_mode( dah );
-       rval = chmod( path, mode );
-       if ( rval ) {
-               mlog( MLOG_NORMAL | MLOG_TREE,
-                     "chmod %s failed: %s\n",
-                     path,
-                     strerror( errno ));
-       }
        if ( persp->p_ownerpr  ) {
                rval = chown( path,
                              dirattr_get_uid( dah ),
--- 2446,2451 ----
***************
*** 2465,2470 ****
--- 2458,2470 ----
                              path,
                              strerror( errno ));
                }
+       }
+       rval = chmod( path, mode );
+       if ( rval ) {
+               mlog( MLOG_NORMAL | MLOG_TREE,
+                     "chmod %s failed: %s\n",
+                     path,
+                     strerror( errno ));
        }
  }

<Prev in Thread] Current Thread [Next in Thread>