* Ported to Linux's Second Extended File System as part of the
* dump and restore backup suit
* Remy Card <card@Linux.EU.Org>, 1994-1997
- * Stelian Pop <pop@cybercable.fr>, 1999-2000
+ * Stelian Pop <stelian@popies.net>, 1999-2000
+ * Stelian Pop <stelian@popies.net> - AlcĂ´ve <www.alcove.com>, 2000-2002
*
- * $Id: restore.h,v 1.7 2000/01/21 10:17:41 stelian Exp $
+ * $Id: restore.h,v 1.34 2007/02/22 20:12:50 stelian Exp $
*/
/*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
+#include <config.h>
+#include <protocols/dumprestore.h>
/*
* Flags
*/
+extern int aflag; /* automatic volume increment */
+extern char *Afile; /* archive file */
extern int cvtflag; /* convert from old to new tape format */
extern int bflag; /* set input block size */
extern int dflag; /* print out debugging info */
extern int hflag; /* restore heirarchies */
+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 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; /* print out actions taken */
extern int yflag; /* always try to recover from tape errors */
+extern int zflag; /* tape is in compressed format */
+extern int ufs2flag; /* tape is a FreeBSD UFS2 dump */
+extern char* bot_script; /* beginning of tape script */
/*
* Global variables
*/
+extern char *host; /* name of the remote host */
extern char *dumpmap; /* map of inodes on this dump tape */
extern char *usedinomap; /* map of inodes that are in use on this fs */
-extern ino_t maxino; /* highest numbered inode in this file system */
+extern dump_ino_t maxino; /* highest numbered inode in this file system */
extern long dumpnum; /* location of the dump on this tape */
extern long volno; /* current volume being read */
extern long ntrec; /* number of TP_BSIZE records per tape block */
extern time_t dumpdate; /* time that this dump was made */
extern char command; /* opration being performed */
extern FILE *terminal; /* file descriptor for the terminal input */
+extern int pipein; /* input is from a pipe */
extern char *tmpdir; /* name of temp directory */
extern int oldinofmt; /* reading tape with old format inodes */
extern int Bcvt; /* need byte swapping on inodes and dirs */
/* used to compare incremental dumps, */
/* so messages about "not found" files */
/* isn't seen. */
-extern char *filesys; /* name of dumped filesystem */
+extern int compare_errors; /* did we encounter any compare errors? */
+extern char filesys[NAMELEN];/* name of dumped filesystem */
+extern dump_ino_t volinfo[]; /* which inode on which volume archive info */
+extern int wdfd; /* original working directory */
+extern int dirhash_size; /* size of the directory hash table */
/*
* Each file in the file system is described by one of these entries
u_char e_namlen; /* length of this name */
char e_type; /* type of this entry, see below */
short e_flags; /* status flags, see below */
- ino_t e_ino; /* inode number in previous file sys */
+ dump_ino_t e_ino; /* inode number in previous file sys */
long e_index; /* unique index (for dumpped table) */
struct entry *e_parent; /* pointer to parent directory (..) */
struct entry *e_sibling; /* next element in this directory (.) */
struct entry *e_links; /* hard links to this inode */
- struct entry *e_entries; /* for directories, their entries */
+ struct entry **e_entries; /* for directories, their entries */
struct entry *e_next; /* hash chain list */
};
/* types */
*/
struct context {
char *name; /* name of file */
- ino_t ino; /* inumber of file */
-#ifdef __linux__
+ dump_ino_t ino; /* inumber of file */
+#if defined(__linux__) || defined(sunos)
struct new_bsd_inode *dip; /* pointer to inode */
#else
struct dinode *dip; /* pointer to inode */
#define GOOD 1
#define FAIL 0
+
+#ifdef USE_QFA
+#define QFA_MAGIC "495115637697"
+#define QFA_VERSION "1.0"
+extern FILE *gTapeposfp;
+extern char *gTapeposfile;
+extern char gTps[255];
+extern long gSeekstart;
+extern int tapeposflag;
+extern int gTapeposfd;
+extern int createtapeposflag;
+extern unsigned long qfadumpdate;
+extern long long curtapepos;
+#ifdef sunos
+int fdsmtc;
+long scsiid;
+char smtcpath[2048];
+#endif
+#endif /* USE_QFA */
+
+#ifdef TRANSSELINUX /*GAN6May06 SELinux MLS */
+extern int transselinuxflag;
+extern char *transselinuxarg;
+#endif
+
+#define do_compare_error \
+ if (++compare_errors >= Lflag && Lflag) { \
+ printf("Compare errors limit reached, exiting...\n"); \
+ exit(2); \
+ }
+
+#define XATTR_MAXSIZE 4096