aboutsummaryrefslogtreecommitdiffstats
path: root/restore
diff options
context:
space:
mode:
authorIvan Rayner <ivanr@sgi.com>2001-12-14 01:47:07 +0000
committerIvan Rayner <ivanr@sgi.com>2001-12-14 01:47:07 +0000
commitaf277305407fc73fd5e336446d1a2edee3aa0e9f (patch)
tree123da8a1ca3bb7f5431069483f1df15afc577cb6 /restore
parent3cca2b3ebe790176e70a60d49ce08c3f6d8524df (diff)
downloadxfsdump-dev-af277305407fc73fd5e336446d1a2edee3aa0e9f.tar.gz
bump minor number for new xfsrestore -B option
Diffstat (limited to 'restore')
-rw-r--r--restore/content.c5
-rw-r--r--restore/getopt.h12
-rw-r--r--restore/tree.c12
3 files changed, 27 insertions, 2 deletions
diff --git a/restore/content.c b/restore/content.c
index e0f1614c..a35137c4 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -818,6 +818,7 @@ static int quotafilecheck(char *type, char *dstdir, char *quotafile);
/* definition of locally defined global variables ****************************/
bool_t content_media_change_needed;
+bool_t restore_rootdir_permissions;
char *media_change_alert_program = NULL;
size_t perssz;
@@ -931,6 +932,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
firststsensepr = firststsenseprvalpr = BOOL_FALSE;
stsz = 0;
interpr = BOOL_FALSE;
+ restore_rootdir_permissions = BOOL_FALSE;
optind = 1;
opterr = 0;
while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
@@ -1154,6 +1156,9 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
case GETOPT_SMALLWINDOW:
tranp->t_largewindowpr = BOOL_FALSE;
break;
+ case GETOPT_ROOTPERM:
+ restore_rootdir_permissions = BOOL_TRUE;
+ break;
}
}
diff --git a/restore/getopt.h b/restore/getopt.h
index 4f3d8555..df4d44d8 100644
--- a/restore/getopt.h
+++ b/restore/getopt.h
@@ -40,7 +40,7 @@
* purpose is to contain that command string.
*/
-#define GETOPT_CMDSTRING "a:b:c:def:himn:op:qrs:tv:wACDEFG:H:I:JL:M:NO:PQRS:TUVWX:Y:Z"
+#define GETOPT_CMDSTRING "a:b:c:def:himn:op:qrs:tv:wABCDEFG:H:I:JL:M:NO:PQRS:TUVWX:Y:Z"
#define GETOPT_WORKSPACE 'a' /* workspace dir (content.c) */
#define GETOPT_BLOCKSIZE 'b' /* blocksize for rmt */
@@ -48,8 +48,12 @@
#define GETOPT_PV766024 'd' /* DRIVE_ERROR_MEDIA for pv#766024 */
#define GETOPT_EXISTING 'e' /* don't overwrite existing files */
#define GETOPT_DUMPDEST 'f' /* dump src. file (drive.c) */
+/* 'g' */
#define GETOPT_HELP 'h' /* display version and usage */
#define GETOPT_INTERACTIVE 'i' /* interactive subtree selection */
+/* 'j' */
+/* 'k' */
+/* 'l' */
#define GETOPT_MINRMT 'm' /* use minimal rmt protocol */
#define GETOPT_NEWER 'n' /* only restore files newer than arg */
#define GETOPT_OWNER 'o' /* restore owner/grp even if not root */
@@ -58,9 +62,14 @@
#define GETOPT_CUMULATIVE 'r' /* accumulating restore (content.c) */
#define GETOPT_SUBTREE 's' /* subtree restore (content.c) */
#define GETOPT_TOC 't' /* display contents only (content.c) */
+/* 'u' */
#define GETOPT_VERBOSITY 'v' /* verbosity level (0 to 4 ) */
#define GETOPT_SMALLWINDOW 'w' /* use a small window for dir entries */
+/* 'x' */
+/* 'y' */
+/* 'z' */
#define GETOPT_NOEXTATTR 'A' /* do not restore ext. file attr. */
+#define GETOPT_ROOTPERM 'B' /* restore ownership and permissions for root directory */
#define GETOPT_RECCHKSUM 'C' /* use record checksums */
#define GETOPT_SETDM 'D' /* set DMAPI event mask and state */
#define GETOPT_CHANGED 'E' /* overwrite if missing or old */
@@ -69,6 +78,7 @@
#define GETOPT_MAXSTACKSZ 'H' /* maximum stack size (bytes) */
#define GETOPT_INVPRINT 'I' /* just display the inventory */
#define GETOPT_NOINVUPDATE 'J' /* do not update the dump inventory */
+/* 'K' */
#define GETOPT_DUMPLABEL 'L' /* dump session label (global.c) */
#define GETOPT_MEDIALABEL 'M' /* media object label (media.c) */
#define GETOPT_TIMESTAMP 'N' /* show timestamps in log msgs */
diff --git a/restore/tree.c b/restore/tree.c
index efaad8fc..67db0e67 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -255,7 +255,7 @@ typedef struct link_iter_context link_iter_context_t;
extern void usage( void );
extern size_t pgsz;
extern size_t pgmask;
-
+extern bool_t restore_rootdir_permissions;
/* forward declarations of locally defined static functions ******************/
@@ -2353,7 +2353,17 @@ bool_t
tree_setattr( char *path )
{
bool_t ok;
+ node_t *rootp;
+
ok = tree_setattr_recurse( persp->p_rooth, path );
+
+ if ( restore_rootdir_permissions && ok ) {
+ rootp = Node_map( persp->p_rooth );
+ /* "." is cwd which is the destination dir */
+ setdirattr( rootp->n_dah, "." );
+ Node_unmap( persp->p_rooth, &rootp );
+ }
+
return ok;
}