]> git.wh0rd.org - dump.git/commitdiff
Added -o flag to restore.
authorStelian Pop <stelian@popies.net>
Sat, 8 Jun 2002 07:10:36 +0000 (07:10 +0000)
committerStelian Pop <stelian@popies.net>
Sat, 8 Jun 2002 07:10:36 +0000 (07:10 +0000)
CHANGES
THANKS
restore/dirs.c
restore/interactive.c
restore/main.c
restore/restore.8.in
restore/restore.h

diff --git a/CHANGES b/CHANGES
index d7dd61dc2888491494cf02ac4a9f4e459924131b..e4d435783743aa73dae287cf0b8896f8d583682a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.178 2002/06/05 13:29:12 stelian Exp $
+$Id: CHANGES,v 1.179 2002/06/08 07:10:36 stelian Exp $
 
 Changes between versions 0.4b28 and 0.4b29 (released ??????????????)
 ====================================================================
 
 Changes between versions 0.4b28 and 0.4b29 (released ??????????????)
 ====================================================================
@@ -38,6 +38,11 @@ Changes between versions 0.4b28 and 0.4b29 (released ??????????????)
        of the inode being dumped, but this could evolve in future versions
        to include interesting debugging output.
 
        of the inode being dumped, but this could evolve in future versions
        to include interesting debugging output.
 
+8.     Added a -o flag to restore, which automatically restores the current
+       directory permissions in -i or -x mode, without asking the operator
+       whether to do so. Patch submitted by Tony Clayton <tonyc@e-smith.com>
+       and Peter Samuel <peters@e-smith.com>.
+
 Changes between versions 0.4b27 and 0.4b28 (released April 12, 2002)
 ====================================================================
 
 Changes between versions 0.4b27 and 0.4b28 (released April 12, 2002)
 ====================================================================
 
diff --git a/THANKS b/THANKS
index cc4dde5857584e6fc25bb9d35592f4a0ef72af48..7ad8f548fbb28f40759aadfdd5be18aa97c4a9a5 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.59 2002/05/17 08:10:43 stelian Exp $
+$Id: THANKS,v 1.60 2002/06/08 07:10:37 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -30,6 +30,7 @@ Stephen Carr          sgcarr@civeng.adelaide.edu.au
 Rob Cermak             cermak@ahab.rutgers.edu
 Isaac Chuang           ike@isl.stanford.edu
 Rainer Clasen          bj@ncc.cicely.de
 Rob Cermak             cermak@ahab.rutgers.edu
 Isaac Chuang           ike@isl.stanford.edu
 Rainer Clasen          bj@ncc.cicely.de
+Tony Clayton           tonyc@e-smith.com
 W. Reilly Cooley       wcooley@nakedape.cc
 Chris Danis            screechco@home.com
 Abhijit Dasgupta       abhijit@ans.net
 W. Reilly Cooley       wcooley@nakedape.cc
 Chris Danis            screechco@home.com
 Abhijit Dasgupta       abhijit@ans.net
@@ -74,6 +75,7 @@ Dave Platt            dplatt@snulbug.mtview.ca.us
 Kenneth Porter         shiva@well.com
 Graham Reed            greed@users.sourceforge.net
 Bernhard Sadlowski     sadlowsk@Mathematik.Uni-Bielefeld.DE
 Kenneth Porter         shiva@well.com
 Graham Reed            greed@users.sourceforge.net
 Bernhard Sadlowski     sadlowsk@Mathematik.Uni-Bielefeld.DE
+Peter Samuel           peters@e-smith.com
 Jan Sanislo            oystr@cs.washington.edu
 Jörg Schilling         schilling@fokus.gmd.de
 Patrik Schindler       poc@pocnet.net
 Jan Sanislo            oystr@cs.washington.edu
 Jörg Schilling         schilling@fokus.gmd.de
 Patrik Schindler       poc@pocnet.net
index 45d4cbe0743981208e96fa82ce6544ee4deb83de..4a0a2bcfdbb4618bd495189717666f3ce6ad74c0 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dirs.c,v 1.18 2002/02/04 11:18:46 stelian Exp $";
+       "$Id: dirs.c,v 1.19 2002/06/08 07:10:37 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -647,7 +647,8 @@ setdirmodes(int flags)
                                ep->e_flags &= ~NEW;
                                continue;
                        }
                                ep->e_flags &= ~NEW;
                                continue;
                        }
-                       if (node.ino == ROOTINO &&
+                       if ((flags & FORCE) == 0 &&
+                           node.ino == ROOTINO &&
                            reply("set owner/mode for '.'") == FAIL)
                                continue;
                }
                            reply("set owner/mode for '.'") == FAIL)
                                continue;
                }
index f252fc825f065db75cdf1d2213e085c81936487f..1f00b2a022ebb43b60a02343835fd7f2e717a9f8 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: interactive.c,v 1.23 2002/02/25 13:54:53 stelian Exp $";
+       "$Id: interactive.c,v 1.24 2002/06/08 07:10:37 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -211,7 +211,7 @@ loop:
                        goto bad;
                createfiles();
                createlinks();
                        goto bad;
                createfiles();
                createlinks();
-               setdirmodes(0);
+               setdirmodes(oflag ? FORCE : 0);
                if (dflag)
                        checkrestore();
                volno = 0;
                if (dflag)
                        checkrestore();
                volno = 0;
index dc875be581f746781bbca329f6bae98e503b818c..2f2db7a192c832aae6683f15246884f266eb98e6 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.39 2002/06/05 13:29:15 stelian Exp $";
+       "$Id: main.c,v 1.40 2002/06/08 07:10:37 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -83,7 +83,7 @@ static const char rcsid[] =
 
 int    aflag = 0, bflag = 0, cvtflag = 0, dflag = 0, vflag = 0, yflag = 0;
 int    hflag = 1, mflag = 1, Mflag = 0, Nflag = 0, Vflag = 0, zflag = 0;
 
 int    aflag = 0, bflag = 0, cvtflag = 0, dflag = 0, vflag = 0, yflag = 0;
 int    hflag = 1, mflag = 1, Mflag = 0, Nflag = 0, Vflag = 0, zflag = 0;
-int    uflag = 0, lflag = 0, Lflag = 0;
+int    uflag = 0, lflag = 0, Lflag = 0, oflag = 0;
 char   *Afile = NULL;
 int    dokerberos = 0;
 char   command = '\0';
 char   *Afile = NULL;
 int    dokerberos = 0;
 char   command = '\0';
@@ -166,7 +166,7 @@ main(int argc, char *argv[])
 #ifdef KERBEROS
                "k"
 #endif
 #ifdef KERBEROS
                "k"
 #endif
-               "lL:mMN"
+               "lL:mMNo"
 #ifdef USE_QFA
                "P:Q:"
 #endif
 #ifdef USE_QFA
                "P:Q:"
 #endif
@@ -258,6 +258,9 @@ main(int argc, char *argv[])
                case 'N':
                        Nflag = 1;
                        break;
                case 'N':
                        Nflag = 1;
                        break;
+               case 'o':
+                       oflag = 1;
+                       break;
 #ifdef USE_QFA
                case 'Q':
                        gTapeposfile = optarg;
 #ifdef USE_QFA
                case 'Q':
                        gTapeposfile = optarg;
@@ -530,7 +533,7 @@ main(int argc, char *argv[])
                }
                createfiles();
                createlinks();
                }
                createfiles();
                createlinks();
-               setdirmodes(0);
+               setdirmodes(oflag ? FORCE : 0);
                if (dflag)
                        checkrestore();
 #ifdef DEBUG_QFA
                if (dflag)
                        checkrestore();
 #ifdef DEBUG_QFA
@@ -619,7 +622,7 @@ usage(void)
                "usage:"
                "\t%s -C [-cd" kerbflag "lMvVy] [-b blocksize] [-D filesystem] [-f file]\n"
                "\t%s    [-F script] [-L limit] [-s fileno]\n"
                "usage:"
                "\t%s -C [-cd" kerbflag "lMvVy] [-b blocksize] [-D filesystem] [-f file]\n"
                "\t%s    [-F script] [-L limit] [-s fileno]\n"
-               "\t%s -i [-acdh" kerbflag "lmMuvVy] [-A file] [-b blocksize] [-f file]\n"
+               "\t%s -i [-acdh" kerbflag "lmMouvVy] [-A file] [-b blocksize] [-f file]\n"
                "\t%s    [-F script] " qfaflag "[-s fileno]\n"
 #ifdef USE_QFA
                "\t%s -P file [-acdh" kerbflag "lmMuvVy] [-A file] [-b blocksize]\n"
                "\t%s    [-F script] " qfaflag "[-s fileno]\n"
 #ifdef USE_QFA
                "\t%s -P file [-acdh" kerbflag "lmMuvVy] [-A file] [-b blocksize]\n"
@@ -631,7 +634,7 @@ usage(void)
                "\t%s    [-s fileno] [-T directory]\n"
                "\t%s -t [-cdh" kerbflag "lMuvVy] [-A file] [-b blocksize] [-f file]\n"
                "\t%s    [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]\n"
                "\t%s    [-s fileno] [-T directory]\n"
                "\t%s -t [-cdh" kerbflag "lMuvVy] [-A file] [-b blocksize] [-f file]\n"
                "\t%s    [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]\n"
-               "\t%s -x [-acdh" kerbflag "lmMuvVy] [-A file] [-b blocksize] [-f file]\n"
+               "\t%s -x [-acdh" kerbflag "lmMouvVy] [-A file] [-b blocksize] [-f file]\n"
                "\t%s    [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]\n",
                __progname, white, 
                __progname, white, 
                "\t%s    [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]\n",
                __progname, white, 
                __progname, white, 
index 74c182ee2aa61b48e6fd65883c9af59c0d0209b4..4dbaeceba563c35e06a53a4e664deb8a683760f4 100644 (file)
@@ -29,7 +29,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\"    $Id: restore.8.in,v 1.26 2002/06/05 13:29:15 stelian Exp $
+.\"    $Id: restore.8.in,v 1.27 2002/06/08 07:10:37 stelian Exp $
 .\"
 .Dd __DATE__
 .Dt RESTORE 8
 .\"
 .Dd __DATE__
 .Dt RESTORE 8
@@ -50,7 +50,7 @@
 .Op Fl T Ar directory
 .Nm restore
 .Fl i
 .Op Fl T Ar directory
 .Nm restore
 .Fl i
-.Op Fl acdhklmMNuvVy
+.Op Fl acdhklmMNouvVy
 .Op Fl A Ar file
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
 .Op Fl A Ar file
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
@@ -99,7 +99,7 @@
 .Op file ...
 .Nm restore
 .Fl x
 .Op file ...
 .Nm restore
 .Fl x
-.Op Fl adchklmMNuvVy
+.Op Fl adchklmMNouvVy
 .Op Fl A Ar file
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
 .Op Fl A Ar file
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
@@ -468,6 +468,17 @@ to perform a full execution as requested by one of
 or
 .Fl x
 command without actually writing any file on disk.
 or
 .Fl x
 command without actually writing any file on disk.
+.It Fl o
+The
+.Fl o
+flag causes
+.Nm
+to automatically restore the current directory permissions
+without asking the operator whether to do so in one of
+.Fl i
+or
+.Fl x
+modes.
 .It Fl Q Ar file
 Use the file
 .Ar file
 .It Fl Q Ar file
 Use the file
 .Ar file
index 572a1bcea342bae68fd00a6c3000755a0316c9a7..6c45e8b2b0427a176f0805af468067ebff9d115a 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
- *     $Id: restore.h,v 1.25 2002/02/04 11:18:46 stelian Exp $
+ *     $Id: restore.h,v 1.26 2002/06/08 07:10:37 stelian Exp $
  */
 
 /*
  */
 
 /*
@@ -61,6 +61,7 @@ extern int    lflag;          /* assume remote filename is a regular file */
 extern int     Lflag;          /* compare errors limit */
 extern int     mflag;          /* restore by name instead of inode number */
 extern int     Mflag;          /* multi-volume restore */
 extern int     Lflag;          /* compare errors limit */
 extern int     mflag;          /* restore by name instead of inode number */
 extern int     Mflag;          /* multi-volume restore */
+extern int     oflag;          /* do restore permissions without asking */
 extern int     Vflag;          /* multi-volume on a single device like CDROM */
 extern int     Nflag;          /* do not write the disk */
 extern int     uflag;          /* unlink symlink targets */
 extern int     Vflag;          /* multi-volume on a single device like CDROM */
 extern int     Nflag;          /* do not write the disk */
 extern int     uflag;          /* unlink symlink targets */