Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improve git compatibility

  • Loading branch information...
commit 887429bc1fdb2b3c9f8c62f44bc1a574c760da4f 1 parent d20b677
@kholtman authored
View
4 ANNOUNCE-2.5.1
@@ -5,7 +5,7 @@ Keywords: backup archiver compressed fault tolerant afio cpio
* WHAT IS AFIO?
Afio is an archiver/backup program that produces cpio-format archives.
-
+
Like tar, afio can make compressed archives. However, the compressed
archives produced by afio are much safer than tar -z archives. If a
tar -z archive has a read error, tar is unable to extract the files
@@ -33,7 +33,7 @@ much is new:
* WHERE DO I GET IT?
Version 2.5.1 is at:
-
+
http://members.brabant.chello.nl/~k.holtman/afio-2.5.1.tgz
And at
View
34 HISTORY
@@ -62,7 +62,7 @@ This code really really needs splitting up into multiple source files!
I have tested backing up and restoring off floppies fairly thoroughly
(various options), but I have no the faintest idea how reliable any of
-the other stuff is.
+the other stuff is.
I have included my favourite backup script as an example of the usage
of afio. [This script is in the script1 subdirectory.]
@@ -71,9 +71,9 @@ dates and a file /usr/adm/dump/DONTDUMP (example included) to
filter out non-dumpable areas.
The afio source as given will not attempt to compress files ending in
- .Z .z .gz
- .arc .gif .zip .zoo .lha .jpeg .jpg
- .tpz .taz .tgz .tzg
+ .Z .z .gz
+ .arc .gif .zip .zoo .lha .jpeg .jpg
+ .tpz .taz .tgz .tzg
See also the -E option in the manual page.
@@ -109,7 +109,7 @@ Bug fix in -F option by Dave Gymer (dpg@Cs.Nott.AC.UK).
Version 2.3.7:
-Deleted shared memory code to reduce code clutter.
+Deleted shared memory code to reduce code clutter.
Removed `buggy gzip workaround' in compfile.c, this caused afio to
hang occasionally if the -f option was used. This means that afio will
@@ -208,7 +208,7 @@ Fixed tocentry() to print -B byte offset to stdout instead of stderr.
Added support for creation of UNIX sockets in restore.
-Added single qoutes around rsh switches.
+Added single qoutes around rsh switches.
Added `-s 0' functionality to the -I command.
@@ -395,7 +395,7 @@ the -3 option! This fixes a security hole:
[SECURITY] afio: security hole in 'afio -P pgp' encrypted archives
I. Description
-
+
Since version 2.4.2, the afio archiver has had an interface, the '-P
pgp' command line option, which can be used to pgp-encrypt the file
data witten to an afio archive. Following up on some bug reports, I
@@ -458,7 +458,7 @@ Updated manpage BUGS section to say that afio does not restore
owner/group information on symlinks. Restoring this info would be
possible using the relatively new `lchown' system call, but that call
is not supported on older linux systems and some other unix systems.
-Problem reported by Marko Jahnke. Further reporting by
+Problem reported by Marko Jahnke. Further reporting by
Giuliano P Procida.
Added gnupg_* scripts to script3/ dir. Scripts by Jens Getreu.
@@ -576,7 +576,7 @@ afio -i.
Version 2.4.7.9beta:
-[This is a BETA release, meaning that I (the maintainer) am applying
+[This is a BETA release, meaning that I (the maintainer) am applying
less strict quality control than I would do for a normal release.
The main reason for the BETA is to get >2GB functionality out to
people who need it now and are willing to take some extra risk.]
@@ -658,7 +658,7 @@ Improved makesparse code in regression test.
Version 2.4.8beta1:
Added -6 option based on suggestions from, discussions with, and patch
-from Matthias Stolte.
+from Matthias Stolte.
Extended -E option syntax. Created new mechanism to create -E default
extensions list from the manpage, because I keep updating it. Added
@@ -730,8 +730,8 @@ see the error messages and press ctrl-C in time.
Documented archive format in the manpage, and improved documentation
of the -k option. Also included a hint about the -k option in the
-unrecognisable archive error messages. Based on problem reports by
-Evren Yurtesen and Carter Alvord.
+unrecognisable archive error messages. Based on problem reports by
+Evren Yurtesen and Carter Alvord.
Added example of splitting archive into 1GB parts to overcome 2GB
filesystem limitations. Based on question by Bob Stewart.
@@ -891,7 +891,7 @@ Schrader (via Debian). Note that the semantics of the -7 command line
options is sligtly different than it was in the Debian 2.5-3 to 2.5-6
branches: in those branches, -7 was non-toggling so it was not
necessary to supply the -7 before any -yYwW options it should
-affect.
+affect.
Replaced several 0 by NULL to avoid compiler warnings. Based on patch
by Erik Schanze (downstream Debian).
@@ -936,4 +936,12 @@ the intent of the original license text.
Increase default size for -M option from 2 to 250 megabytes.
+Improved typesetting and ordering of manpage material: patch by Jaari
+Aalto.
+
+Some things to improve git compatibility: removed RCS tags from afio.1
+and afio.c, removed trailing whitespace from files. Based om report
+by Jaari Aalto.
+
+
View
6 INSTALLATION
@@ -1,7 +1,7 @@
To install afio, follow these steps:
-STEP 1. Compile.
+STEP 1. Compile.
----------------
Unpack the afio sources, go to the top level source directory, compile
@@ -126,9 +126,9 @@ This test prints a line with 'OK!' at the end it succeeds.
in afio, but more likely to a missing feature or configuration
problem in the kernel, the filesystem, the compiler, or the
libraries.
- As of Dec 2003, the test is known to report success on
+ As of Dec 2003, the test is known to report success on
- Red Hat Linux 7.3
- - Debian Linux 3.0/testing (not 3.0/stable) on most platforms,
+ - Debian Linux 3.0/testing (not 3.0/stable) on most platforms,
including i386
- At least some versions of Solaris
- FreeBSD 3.5-STABLE
View
4 Makefile
@@ -27,7 +27,7 @@ SHELL=/bin/sh
## Define HAVEMEMCMP if you have memcmp otherwise assumes bcmp
c = -DHAVEMEMCMP
## Define DEFFMTCMD to being how to format the media you use the most
-## This is the DEFault FoRMat CoManD.
+## This is the DEFault FoRMat CoManD.
d = -DDEFFMTCMD='"fdformat /dev/fd0H1440"'
## Define LONGZFILE if you want .Z to be tagged on the end of a 14 char
## file name (or longer for BSD) in the archive when the file is compressed
@@ -82,7 +82,7 @@ afio : afio.o compfile.o exten.o match.o $M
${CC} ${LDFLAGS} afio.o compfile.o exten.o match.o $M -o afio
clean:
- rm -f *.o afio
+ rm -f *.o afio
rm -f regtest/cmpstat regtest/makesparse
rm -f regtest/statsize regtest/statsize64
cd regtest; /bin/sh regtest.clean
View
10 PORTING
@@ -130,7 +130,7 @@ Some notes about regression testing on (some versions of) sun
+lrwxr-xr-x 1 x x DATE afiot/link with spaces S-> name with spaces
+lrwxr-xr-x 1 x x DATE afiot/link1 S-> y2k
+lrwxr-xr-x 1 x x DATE afiot/linkx S-> /etc/sysconfig/ipchains
- FAILURE in: compare table-of-contents file made by new afio
+ FAILURE in: compare table-of-contents file made by new afio
with archived toc
------------------------------------------------------------------
@@ -144,18 +144,18 @@ systems.
Note for SCO porters from Karel Kubat, karel@icce.rug.nl:
Please read the makefile about the changes needed for fnmatch().
-
+
You may want to change the -DDEFFMTCMD value in the makefile.
- If you encounter any other options which may need changing, please mail me
- at karel@icce.rug.nl. I'm not the maintainer of afio for SCO platforms, but
+ If you encounter any other options which may need changing, please mail me
+ at karel@icce.rug.nl. I'm not the maintainer of afio for SCO platforms, but
I'd like to know if you come across anything spectacular.
Note for IRIX porters using the SGI native C compiler (cc):
Modify the Makefile to use CC=cc, comment out the CFLAGS1 line,
- and add
+ and add
-Dirix_cc_compatibility
to the CFLAGS line.
View
2  README
@@ -45,7 +45,7 @@ Thus, it should be safe to advertise ports of this code to other UNIX
versions as ports of afio version 2.4.1.
---------------------------------------------------------------------------
-
+
Afio has far too many options and features (some of which are not even
in the manual page). Anything in afio that doesn't relate to reading
or writing an archive from/to a simple file or pipe or backing up and
View
456 afio.1
@@ -1,10 +1,10 @@
-'br $Header: /u/buhrt/src/afio/RCS/afio.1,v 2.3 1991/09/25 20:08:33 buhrt Exp $
+'br
.TH AFIO 1
.SH NAME
afio \- manipulate archives and files
.SH SYNOPSIS
.B ...
-|
+|
.B afio \-o
[
.I options
@@ -35,7 +35,7 @@ afio \- manipulate archives and files
manipulates groups of files, copying them within the (collective)
filesystem or between the filesystem and an
.I afio
-archive.
+archive.
.PP
With
.BR \-o ,
@@ -74,7 +74,7 @@ tape archives.
Creates missing directories as necessary, with permissions
to match their parents.
.PP
-Removes leading slashes from pathnames,
+Removes leading slashes from pathnames,
making all paths relative to the current directory.
This is a safety feature to prevent inadvertent overwriting
of system files when doing restores. To suppress this safety
@@ -88,7 +88,7 @@ Supports compression while archiving, with the
option. Will compress individual files in the archive, not the
entire archive datastream, which makes
.I afio
-compressed archives much more robust than
+compressed archives much more robust than
.I `tar\ zc'
type archives.
.PP
@@ -113,7 +113,7 @@ to send the mail.
Preserve the last access times (atimes) of the files read when
making or verifying an archive.
.B Warning:
-if this option is used,
+if this option is used,
.I afio
will change the last inode changed times (ctimes) of these files.
Thus, this option cannot be used together with an incremental backup
@@ -144,12 +144,12 @@ In some cases, notably when using
.I ftape
with some tape drives,
.B \-b 10k
-is needed for compatibility. Note that
+is needed for compatibility. Note that
.B \-b 10k
-is the default block size used by
+is the default block size used by
.IR tar (1),
so it is usually a good choice if the tape setup is known to work
-with
+with
.IR tar (1).
.TP
.BI \-c "\ count"
@@ -199,14 +199,14 @@ Follow symbolic links, treating them as ordinary files and directories.
.TP
.B \-j
Don't generate sparse filesystem blocks on restoring files.
-By default,
-.I afio
+By default,
+.I afio
creates sparse filesystem blocks (with
.IR lseek (2))
-when possible when restoring files from an archive,
+when possible when restoring files from an archive,
but not if these files were stored in a compressed form. Unless stored in
-a compressed form, sparse files are not archived efficiently:
-they will take space equal to the full file length.
+a compressed form, sparse files are not archived efficiently:
+they will take space equal to the full file length.
(The sparse file handling in
.I afio
does not make much sense except in a historical way.)
@@ -221,9 +221,9 @@ This option is needed to deal with certain types of backup media damage.
It is also useful to support quick
selective restores from multi-volume archives, or
from searchable block devices, if the volume or location of the file to be
-restored is known in advance (see the
+restored is known in advance (see the
.B \-B
-option).
+option).
If, for example, a selective restore is done with
the fourth volume of a multi-volume afio archive,
then the
@@ -278,36 +278,36 @@ falls into this category. When an archive is being read or written, using
causes
.I afio
to prompt for the next volume if the specified volume length is reached.
-The
+The
.B \-s
option will also cause
.I afio
to prompt if there is a premature EOF while reading the input.
The special case
.B \-s 0
-will activate this prompting for the next volume on premature EOF without
-setting a volume length.
-When writing an archive,
+will activate this prompting for the next volume on premature EOF without
+setting a volume length.
+When writing an archive,
.I afio
will prompt for the next volume on end-of-media, even without
.B \-s 0
being supplied, if the device is capable of reporting end-of-media.
If the volume
-.I size
+.I size
specified is not a multiple of the block size set with the
.B \-b
option, then
.I afio(1)
will silently round down the volume size to the nearest multiple of
-the block size. This rounding down can be suppressed using the
+the block size. This rounding down can be suppressed using the
.B \-9
option: if
.B \-9
-is used,
+is used,
.I afio(1)
-will write a small block of data, smaller than the
+will write a small block of data, smaller than the
.B \-b
-size, at the end of the volume to completely fill it to the specified
+size, at the end of the volume to completely fill it to the specified
size. Some devices are not able to handle such small block writes.
.TP
.B \-u
@@ -319,7 +319,7 @@ Verbose. Report pathnames (to stderr) as they are processed. When used with
gives an
.I "ls \-l"
style report (including link information) to stdout instead.
-When used twice
+When used twice
.RB ( \-vv )
with
.BR \-o ,
@@ -351,42 +351,42 @@ With the possible exception of the presence of a leading slash, the
complete file name as appearing in the archive table-of-contents must
match the pattern, for example the file name 'etc/passwd' is matched
by the pattern '*passwd' but NOT by the pattern 'passwd'. See
-.B `man 7 glob'
+.B `man 7 glob'
for more information on shell wildcard pattern matching.
-The only difference with shell wildcard pattern matching is that in
+The only difference with shell wildcard pattern matching is that in
.I afio
the wildcards will also match '/' characters in file
-names. For example the pattern '/usr/src/*' will match the
+names. For example the pattern '/usr/src/*' will match the
file name '/usr/src/linux/Makefile', and any other file name
-starting with '/usr/src'. Unless the
+starting with '/usr/src'. Unless the
.B \-S
option is given, any leading slash in the pattern or the filename is
ignored when matching,
-e.g.
-.I /etc/passwd
+e.g.
+.I /etc/passwd
will match
.IR etc/passwd .
Use
.B \-Y
to supply patterns which are
.I not
-to be processed.
+to be processed.
.B \-Y
overrides
.B \-y
-if a filename matches both.
-See also
+if a filename matches both.
+See also
.BR \-w\ and\ \-W .
-See also the
+See also the
.B \-7
-option, which can be used to modify the meaning of
+option, which can be used to modify the meaning of
.BR \-y ", " \-Y ", " \-w ", and " \-W
when literal matching without wildcard processing is needed.
.B Note:
-if
+if
.I afio
was compiled without using the GNU fnmatch library, then the full
-shell wildcard pattern syntax cannot be used,
+shell wildcard pattern syntax cannot be used,
and matching support is limited to patterns which are a full
literal file name and patterns which end in '*'.
.TP
@@ -401,12 +401,12 @@ but also to the path names read out of an archive during read (install),
verify, and cataloging operations.
.TP
.B \-B
-If the
+If the
.B \-v
option is used, prints the byte offset of the start of each file in
the archive.
If your tape drive can start reading at any position in an
-archive, the output of
+archive, the output of
.B \-B
can be useful for doing quick selective restores.
.TP
@@ -418,12 +418,12 @@ see the section on
below.
.TP
.BI \-E "\ [+]filename" " | \-E CS | \-E CI"
-While creating an archive with compressed files using the
+While creating an archive with compressed files using the
.B \-Z
-option, disable (attempts at) compression for files with
+option, disable (attempts at) compression for files with
particular extensions.
This option can be used to speed up the creation of the archive, by
-making
+making
.I afio
avoid trying to use
.I gzip
@@ -433,10 +433,10 @@ By default, if no specific
option is given, all files with the extensions
'br the two START_ and END_ comments below are used by the makefile to create
'br the compiled-in defaults for the \-E option.
-'br NOTE: the awk script called by in the makefile disregards all
-'br FIRST words on each line below,
+'br NOTE: the awk script called by in the makefile disregards all
+'br FIRST words on each line below,
'br i.e. it disregards the .I typesetting commands and the word and.
-'br so BE CAREFUL TO TAKE THIS INTO ACCOUNT if you edit the text below,
+'br so BE CAREFUL TO TAKE THIS INTO ACCOUNT if you edit the text below,
'br else the awk script might miss some extensions, or take some
'br common words you add as default extensions.
'br START_EXT_LIST
@@ -449,37 +449,37 @@ option is given, all files with the extensions
and
.I .smk
'br END_EXT_LIST
-will not be compressed.
-Also by default, the file extension matching is case-insensitive (to do the
+will not be compressed.
+Also by default, the file extension matching is case-insensitive (to do the
right thing with respect to MS-DOS based filesystems).
-The
+The
.BI \-E "\ filename"
form of this option will replace the default list of file extensions
by reading a new list of file extensions, separated by whitespace, from
-.IR filename .
+.IR filename .
.I filename
-may contain comments preceded by a #. The extensions in
+may contain comments preceded by a #. The extensions in
.I filename
should usually all start with a dot, but they do not need to start with a
dot, for example the extension 'tz' will match the file name 'hertz'.
The
.BI \-E "\ +filename"
form (with a + sign in front of
-.IR filename )
+.IR filename )
can be
-used to specify extensions in addition to the built-in
+used to specify extensions in addition to the built-in
default list, instead of replacing the whole default list.
To make extension matching case-sensitive, add the special option form
.B \-E CS
to the command line. The form
.B \-E CI
invokes the (default) case-insensitive comparison.
-See also the
+See also the
.B \-6
option, which offers an additional way to suppress compression.
.TP
.B \-F
-This is a floppy disk,
+This is a floppy disk,
.B \-s
is required. Causes floppy writing in
.B O_SYNC
@@ -493,54 +493,54 @@ assumes either way you can malloc/shmalloc a chunck of memory
the size of one disk. Examples: 795k: 3.5" (720k drive), 316k (360k drive)
.nf
At the end of each disk this message occurs:
- Ready for disk [#] on [output]
+ Ready for disk [#] on [output]
(remove the disk when the light goes out)
Type "go" (or "GO") when ready to proceed
(or "quit" to abort):
.fi
.TP
.BI \-G "\ factor"
-Specifies the
+Specifies the
.IR gzip (1)
-compression speed factor, used when compressing files with the
+compression speed factor, used when compressing files with the
.B \-Z
option.
Factor 1 is the fastest with least compression, 9 is slowest with best
compression.
-The default value is 6. See also the
+The default value is 6. See also the
.IR gzip (1)
-manual page.
+manual page.
If you have a slow machine or a fast backup medium, you may want to
specify a low value for
.I factor
-to speed up the backup. On large (>200k) files,
+to speed up the backup. On large (>200k) files,
.B \-G 1
-typically zips twice as fast as
+typically zips twice as fast as
.BR "\-G 6" ,
-while still achieving a better result than
+while still achieving a better result than
.IR compress "(1)."
The zip speed for small files is mainly determined by the invocation time
-of
-.I gzip
-(1), see the
+of
+.I gzip
+(1), see the
.B \-T
option.
.TP
.BI "\-H " promptscript
Specify a script to run, in stead of using the normal prompt, before
advancing to the next achive volume. The script will be run with the
-volume number, archive specification, and the reason for changing to
+volume number, archive specification, and the reason for changing to
the next volume as arguments. The script
should exit with 0 for OK and 1 for abort, other exit codes will be
-treated as fatal errors.
+treated as fatal errors.
.I afio
-executes the script by taking the
+executes the script by taking the
.I promptscript
string, appending the arguments, and then calling the shell to execute
the resulting command line. This means that a general-purpose
prompt script can be supplied with additional arguments, via the
.I afio
-command line, by using a
+command line, by using a
.B \-H
option value like
\-H "generic_promptscript additional_arg_1 additional_arg_2".\\
@@ -571,21 +571,21 @@ Specify the name of the file to log errors and the final totals to.
Specifies the maximum amount of memory to use for the temporary storage of
compression results when using the
.B \-Z
-option. The default is
+option. The default is
.B \-M 250m
(250 megabytes). If the compressed version of a file is larger than
-this (or if
-.I afio
-runs out of virtual memory),
+this (or if
+.I afio
+runs out of virtual memory),
.IR gzip (1)
is run twice of the file,
the first time to determine the length of the result, the second time
to get the compressed data itself.
.TP
.BI \-P "\ progname"
-Use the program
+Use the program
.I progname
-instead of the standard
+instead of the standard
.IR gzip (1)
for compression and decompression with the
.B \-Z
@@ -601,18 +601,18 @@ then the
.B \-Q
option can be used to supply the right options.
The compression program used must have the property that, if the output
-file size exceeds the value of the
+file size exceeds the value of the
.B \-M
option,
then when the compression program is run for a second time on the same input,
it must produce an output with exactly the same size. (See also the
.B \-M
-option description.) The GnuPG
+option description.) The GnuPG
.RB ( gpg )
encryption program does not satisfy this lenght-preserving criterion unless
-its built-in compression is disabled (see examples in the afio source script3/
+its built-in compression is disabled (see examples in the afio source script3/
directory).
-See also the
+See also the
.BR \-Q ,
.B \-U
and
@@ -631,7 +631,7 @@ multiple times. If no
flag is present, the standard options are passed. The standard
options are
.B \-c \-6
-when the program is called for compression and
+when the program is called for compression and
.B \-c \-d
when the program is called for decompression. Use the special case
.B \-Q
@@ -647,11 +647,11 @@ You are also prompted for formatting whenever a disk change
is requested.
.TP
.BI \-S
-Do not ignore a leading slash in the pattern or the file name when matching
+Do not ignore a leading slash in the pattern or the file name when matching
.B \-y
and
.B \-Y
-patterns. See also
+patterns. See also
.BR \-A .
.TP
.BI \-T "\ threshold"
@@ -659,18 +659,18 @@ Only compress a file when using the
.B \-Z
option if its length is at least
.IR threshold .
-The default is
+The default is
.BR "\-T 0k" .
This is useful if you have a slow machine or a fast backup medium.
-Specifying
+Specifying
.B "\-T 3k"
typically halves the number of invocations of
.IR gzip (1),
saving some 30% computation time, while creating an archive
-that is only 5% longer. The combination
+that is only 5% longer. The combination
.B \-T 8k \-G 1
typically saves 70% computation time and gives a 20% size increase.
-The latter combination may be a good alternative to not using
+The latter combination may be a good alternative to not using
.B \-Z
at all. These figures of course depend heavily on the kind of files
in the archive and the processor - i/o speed ratio on your machine.
@@ -679,32 +679,32 @@ See also the
option.
.TP
.B \-U
-If used with the
+If used with the
.B \-Z
option, forces compressed versions to be stored of all files, even if
-the compressed versions are bigger than the original versions, and
-disregarding any (default) values of the
+the compressed versions are bigger than the original versions, and
+disregarding any (default) values of the
.B \-T
-and
+and
.B \-2
-options. This is useful when the
+options. This is useful when the
.B \-P
and
.B \-Q
-options are used to replace the compression program
+options are used to replace the compression program
.I gzip
with an encryption program in order to make an archive with encrypted files.
-Due to internal limitations of
+Due to internal limitations of
.IR afio ,
use of this flag forces the writing of file content with each hard
linked file, rather than only once for every set of hard linked files.
.B WARNING:
use of the \-U option
-will also cause compression (or whatever operation the
+will also cause compression (or whatever operation the
.B \-P
option indicates) on files larger than 2 GB, if these
are present in the input. Not all compression programs might handle
-such huge files correctly (recent Linux versions of gzip, bzip2, and
+such huge files correctly (recent Linux versions of gzip, bzip2, and
gpg have all been tested and seem to work OK). If your setup is
obscure, some testing might be warranted.
.TP
@@ -717,11 +717,11 @@ pattern, see
.BR \-Y .
.TP
.BI \-Y "\ pattern"
-Do
-.I not
+Do
+.I not
process files whose names match shell wildcard pattern
.IR pattern .
-See also
+See also
.BR "\-y " and " \-W" .
.TP
.B \-Z
@@ -729,51 +729,51 @@ Compress the files that go into the archive when creating an archive,
or uncompress them again when installing an archive.
.I afio \-Z
will compress each file in the archive individually, while keeping the archive
-headers uncompressed. Compared to
+headers uncompressed. Compared to
.I tar zc
style archives,
.I afio \-Z
-archives are therefore much more fault-tolerant
+archives are therefore much more fault-tolerant
against read errors on the backup medium.
When creating an archive with the
.I \-Z
-option,
+option,
.I afio
will run
.I gzip
on each file encountered, and, if the result is smaller than the original,
-store the compressed version of the file.
-Requires
+store the compressed version of the file.
+Requires
.IR gzip (1)
-to be in your path. Mainly to speed up
+to be in your path. Mainly to speed up
.I afio
-operation, compression is not attempted on a file if:
-1) the file is very small (see the
+operation, compression is not attempted on a file if:
+1) the file is very small (see the
.B \-T
option),
-2) the file is very large (see the
+2) the file is very large (see the
.B \-2
option),
3) the file has a certain extension, so it probably contains
-compressed data already (see the
+compressed data already (see the
.B \-E
option),
-4) the file pathname matches a certain pattern, as set by the
+4) the file pathname matches a certain pattern, as set by the
.B \-6
option,
5) the file has hard links (this due to an internal limitation of afio,
-but this limitation does not apply if the
+but this limitation does not apply if the
.B \-l
option is also used).
-Regardless of the above, if the
+Regardless of the above, if the
.B \-U
-option is used then the compression program is always run, and the
+option is used then the compression program is always run, and the
compressed result is always stored.
When installing an archive with compressed files, the
.B \-Z
option needs to be used in order to make afio automatically uncompress
the files that it compressed earlier.
-The
+The
.B \-P
option can be used to do the (un)compression with programs other than
.IR gzip ,
@@ -789,14 +789,14 @@ See also the
option which provides yet another way to tune the compression process.
.TP
.B \-0
-Use filenames terminated with '\\0' instead
+Use filenames terminated with '\\0' instead
of '\\n'. When used as follows:
.IR "find ... \-print0 | afio \-o \-0 ..." ,
-it ensures that any input filename can be handled,
+it ensures that any input filename can be handled,
even a file name containing newlines. When used as
.IR "afio \-t \-0 ... | ..." ,
-this allows the table of contents output to be parsed unambiguosly
-even if the filenames contain newlines. The
+this allows the table of contents output to be parsed unambiguosly
+even if the filenames contain newlines. The
.B \-0
option also affects the parsing of the files supplied by
.B "\-w file"
@@ -804,12 +804,12 @@ and
.B "\-W file"
options: if the option
.B \-0
-precedes them in the command line then the pattern lines contained in the
+precedes them in the command line then the pattern lines contained in the
.BR file s
-should be terminated with '\\0' in stead of '\\n'. A second use of
+should be terminated with '\\0' in stead of '\\n'. A second use of
.B \-0
-toggles the option. This can be useful when using multiple pattern files
-or when combining with the
+toggles the option. This can be useful when using multiple pattern files
+or when combining with the
.B \-t
option.
.TP
@@ -818,11 +818,11 @@ Control if
.IR afio (1)
should exit with a nonzero code after printing certain warning messages,
and if certain warning messages should be printed at all.
-This option is sometimes useful when calling
+This option is sometimes useful when calling
.IR afio (1)
-from inside a backup script or program.
-.IR afio (1)
-will exit with a nonzero code on encountering
+from inside a backup script or program.
+.IR afio (1)
+will exit with a nonzero code on encountering
various 'hard' errors, and also (with the default value of the
.B \-1
option) when it has printed
@@ -831,31 +831,31 @@ certain warning messages during execution.
is a list of letters which determines the behavior related to warning messages.
The default value for this option is
.BR "\-1 mc" .
-For
-.I afio
+For
+.I afio
versions 2.4.3 and earlier, the default was
.BR "\-1 a" .
-For
-.I afio
+For
+.I afio
versions 2.4.4 and 2.4.5, the default was
.BR "\-1 ''" .
The defined
.I warnings-to-ignore
letters are as follows.
.B a
-is for for ignoring
-.IR a ll
+is for for ignoring
+.IR a ll
possible warnings on exit: if this letter is used,
-the printing of a warning message will
+the printing of a warning message will
never cause a nonzero exit code.
.B m
-is for ignoring in the exit code any warning about
+is for ignoring in the exit code any warning about
.IR m issing
files, which will be printed when, on
creating an archive, a file whose name was read from the standard
-input is not found.
+input is not found.
.B c
-is for ignoring in the exit code the warning that the
+is for ignoring in the exit code the warning that the
archive being created will not be not fully compatible with
.IR c pio
or afio versions 2.4.7 or lower.
@@ -863,18 +863,18 @@ or afio versions 2.4.7 or lower.
is the same as
.IR c ,
but in addition the warning message will not even be printed.
-.B M
+.B M
will suppress the printing of all warning messages asssociated with
.IR M ultivolume
archive handling, messages like "Output limit reached" and
"Continuing".
-.B r
+.B r
is for ignoring certain warnings during the verify (\-r) operation.
-If this letter is used, some verification errors that are
+If this letter is used, some verification errors that are
very probably due to changes in the filesystem, during or after
-the backup was made,
-are ignored in determining the exit code.
-The two verification errors that are ignored are:
+the backup was made,
+are ignored in determining the exit code.
+The two verification errors that are ignored are:
1) a file in the archive is no
longer present on the filesystem, and 2) the file contents in the
archive and on the filesystem are different, but the file lengths
@@ -888,14 +888,14 @@ warnings: it ignores these warnings when they happen after the file has already
been successfully opened. This unusual warning situation can occur
when archiving files on Windows smbfs filesystems -- due to a Windows problem,
smbfs files with non-ASCII characters in their names
-can sometimes be opened but not read. When the
+can sometimes be opened but not read. When the
.B \-Z
option is used, the
.I n
letter function is (currently) only implemented for files with sizes
-smaller than indicated by the
+smaller than indicated by the
.B \-T
-option, so in that case the
+option, so in that case the
.B \-T
option is also needed for this letter to have any effect.
.TP
@@ -904,7 +904,7 @@ Do not compress any files which
are larger than this size when making a compressed archive
with the
.B \-Z
-option. The default value is
+option. The default value is
.BR "\-2 200m"
(200 Megabytes). This maximum size cutoff lowers the risk that a major portion
of a large file
@@ -915,8 +915,8 @@ has stored in a compressed form, then
.I afio
and
.I gzip
-will not be able to restore the entire remainder of that file.
-This is usually an acceptable risk for small files. However for very
+will not be able to restore the entire remainder of that file.
+This is usually an acceptable risk for small files. However for very
large files the risk of loosing a large amount of data because
of this effect will usually be too big. The special case
.B "\-2 0"
@@ -924,14 +924,14 @@ eliminates any maximum size cutoff.
.TP
.BI "\-3 " filedescriptor-nr
Rewind the filedescriptor before invoking the (un)compression program
-if using the
+if using the
.B \-Z
option. This
-is useful when the
+is useful when the
.B \-P
and
.B \-Q
-options are used to replace the compression program
+options are used to replace the compression program
.I gzip
with some types of encryption programs in order to make or read an archive
with encrypted files. The rewinding is needed to interface
@@ -940,9 +940,9 @@ filedescriptor. If the
.B \-P
program name matches 'pgp' or 'gpg', then the
.B \-3
-option
+option
.I must
-be used to avoid
+be used to avoid
.IR afio (1)
reporting an error. Use the special case
.B "\-3 0"
@@ -950,16 +950,16 @@ to supress the error message without rewinding any file descriptor.
The
.B "\-3 0"
option may also be needed to successfully read back encrypted archives
-made with
-.I afio
+made with
+.I afio
version 2.4.5 and older.
.TP
.B \-4
-(Deprecated, the intended effect of this option is now
+(Deprecated, the intended effect of this option is now
achieved by default as long as the
.B \-5
option is not used. This option could still be useful for compatibility
-with machines running an older version of
+with machines running an older version of
.IR afio .)
Write archive with the `extended ASCII' format headers which use 4-byte
inode numbers. Archives using the extended ASCII format headers
@@ -972,21 +972,21 @@ hard links, for example a news spool.
.B \-5
Refuse to create an archive that is incompatible with
.IR cpio (1).
-If this option is used,
+If this option is used,
.I afio
will never write any `large ASCII' file headers that are incompatible with
-.IR cpio (1),
+.IR cpio (1),
but fail with an error code instead.
See the ARCHIVE PORTABILITY section above for more information on the
use of `large ASCII' file headers.
.TP
.B \-6 "\ filename"
-While creating an archive with compressed files using the
+While creating an archive with compressed files using the
.B \-Z
option, disable (attempts at) compression for files that match
particular shell patterns.
This option can be used to speed up the creation of the archive, by
-making
+making
.I afio
avoid trying to use
.I gzip
@@ -1015,20 +1015,20 @@ files in certain subdirectory trees from compression..
.B \-7
Switch between shell wildcard pattern matching and exact name matching (without interpreting any wildcard characters) for the patterns supplied in the
.BR \-y ", " \-Y ", " \-w ", and " \-W
-options. If the
+options. If the
.B \-7
option is used in front of any option
.BR \-y ", " \-Y ", " \-w ", or " \-W ,
-then the patterns supplied in these options are not intrerpreted as
-wildcard patterns, but as character strings that must match exactly
-to the file name, except possibly in leading slashes.
-This option can be useful for handling the exceptional cases where file
-names in the archive, or the names of files to be archived, contain
+then the patterns supplied in these options are not intrerpreted as
+wildcard patterns, but as character strings that must match exactly
+to the file name, except possibly in leading slashes.
+This option can be useful for handling the exceptional cases where file
+names in the archive, or the names of files to be archived, contain
wildcard characters themselves. For example,
.I find /tmp \-print0 | afio \-ov \-Y '*.jpg' \-7 \-Y '/tmp/a[12]*4' \-0 archive
can be used to archive files all files under /tmp, even files with a '\\n' character in the name, except for .jpg files and the file with the exact name
.IR /tmp/a[12]*4 .
-A second use of
+A second use of
.B \-7
toggles the matching for subsequently occuring
.BR \-y ", " \-Y ", " \-w ", and " \-W
@@ -1192,7 +1192,7 @@ and a remote copy of
.B o
A more elaborate case of the above is
.I [user@]host[%rsh][=afio]:file
-where the optional
+where the optional
.I user@
component specifies the user name on the remote host, the optional
.I %rsh
@@ -1216,7 +1216,7 @@ number. This is rather simplistic, but, much like a disassembler,
almost always works.
.PP
Optimizes pathnames with respect to the current and parent
-directories. For example,
+directories. For example,
.I ./src/sh/../misc/afio.c
becomes
.IR src/misc/afio.c .
@@ -1228,7 +1228,7 @@ file has a
.I label
and some
.IR data .
-When
+When
.I afio
encounters a control file in the archive it is reading, it will feed the
.I label
@@ -1239,7 +1239,7 @@ the user. It can perform special actions based on the
.I label
and
.I data
-it receives from
+it receives from
.IR afio .
.PP
.B Control file labels.
@@ -1258,7 +1258,7 @@ form
programname.kindofdata
.fi
.PP
-where
+where
.I programname
is the name of the backup program that generated the control file, and
.I kindofdata
@@ -1288,12 +1288,12 @@ format:
//--sourcename label
.fi
.PP
-Here, the //-- sequence signals that a control file is to be made,
-.I sourcename
+Here, the //-- sequence signals that a control file is to be made,
+.I sourcename
is the path to a file containing the control file data, and
.I label
-is the control file label. The
-.I sourcename
+is the control file label. The
+.I sourcename
must be a regular file or a symlink to a regular file.
.PP
A control file will show up as
@@ -1302,7 +1302,7 @@ A control file will show up as
//--CONTROL_FILE/label
.fi
.PP
-in an archive listing, where
+in an archive listing, where
.I label
is the control file label.
.PP
@@ -1378,18 +1378,18 @@ is the control file label.
.SH BUGS
There are too many options.
.PP
-Restricts pathnames to 1023 characters,
-and 255 meaningful elements (where each element is a pathname
+Restricts pathnames to 1023 characters,
+and 255 meaningful elements (where each element is a pathname
component separated by a /).
.PP
-Does not use the same default block size as
+Does not use the same default block size as
.IR tar (1).
.IR tar (1)
-uses 10 KB,
+uses 10 KB,
.I afio
uses 5 KB by default. Some tape drives only work with a 10 KB block size,
-in that case the
-.I afio
+in that case the
+.I afio
option
.B \-b 10k
is needed to make the tape work.
@@ -1409,9 +1409,9 @@ The
.I afio
code for handling floppies
.RB ( \-F
-and
+and
.BR \-f " and " \-K
-options) has buggy error handling.
+options) has buggy error handling.
.I afio
does not allow one to retry a failed floppy write on a different floppy,
and it cannot recover from a verify error.
@@ -1419,7 +1419,7 @@ If the floppy handling code is used and write or verify errors do occur,
it is best to restart
.I afio
completely.
-Making backups to floppies should really be done with a more specialised
+Making backups to floppies should really be done with a more specialised
backup program that wraps
.IR afio .
.PP
@@ -1427,7 +1427,7 @@ The Linux floppy drivers below kernel version 1.1.54 do not
allow
.I afio
to find out about floppy write errors while writing. If you
-are running a kernel below 1.1.54,
+are running a kernel below 1.1.54,
.I afio
will happily fail to write to
(say) a write protected disk and not report anything wrong! The only
@@ -1443,7 +1443,7 @@ error reporting with remote archives.
.PP
An archive created with a command like
.I "'find /usr/src/linux \-print | afio \-o ...'"
-will not contain the ownership and permissions of the
+will not contain the ownership and permissions of the
.I /usr
and
.I /usr/src
@@ -1451,10 +1451,10 @@ directories. If these directories are missing when restoring the archive,
.I afio
will recreate them with some default ownership and permissions.
.PP
-Afio can not restore time stamps on symlinks. Also,
-on operating systems without an
-.IR lchown (2)
-system call, afio can not restore owner/group
+Afio can not restore time stamps on symlinks. Also,
+on operating systems without an
+.IR lchown (2)
+system call, afio can not restore owner/group
information on symlinks. (Linux has lchown since kernel version 2.1.86.)
.PP
Afio tries to restore modification time stamps of directories in the
@@ -1477,14 +1477,14 @@ system. If it is used in this way, a flag like
.I \-Y /bin/gzip
can often be added to prevent failure.
.PP
-The
+The
.B \-r
-option verifies the file contents of the files in the archive
+option verifies the file contents of the files in the archive
against the files on the filesystem, but does not cross-check details
like permission bits on files, nor does it cross-check that archived
directories or other non-file entities still exist on the filesystem.
.PP
-There are several problems with archiving hard links.
+There are several problems with archiving hard links.
1) Due to internal limitations, files with hard links cannot be stored
in compressed form, unless the
.B \-l
@@ -1495,7 +1495,7 @@ options are used which force each hard linked file to be stored separately.
made with older (pre-2.4.8) versions of
.I afio
or with
-.I cpio
+.I cpio
can not always be correctly unpacked. This is really a problem in the
archives and not in the current version of
.IR afio .
@@ -1505,26 +1505,26 @@ or hard links in the archives is larger.
the first copy of a file with archive-internal hard links, then all
subsequent copies, if selected, will not be correctly restored. 4)
Unless the
-.B \-4
+.B \-4
option is used, the inode number fields in the archive headers for
files with hard links of the archive will sometimes not contain the
actual (least significant 16 bits of) the inode number of the original
-file.
+file.
.PP
Some Linux kernels no not allow one to create a hard link to a symbolic link.
-.I afio
-will try to re-create such hard links when unpacking an archive,
+.I afio
+will try to re-create such hard links when unpacking an archive,
but might fail due to kernel restrictions.
.PP
-Due to internal limitations of
+Due to internal limitations of
.IR afio ,
the use of the
.B \-U
option forces the writing of file content with each hard linked file,
rather than only once for every set of hard linked files.
.PP
-When it is run without super-user priviliges,
-.I afio
+When it is run without super-user priviliges,
+.I afio
is not able to unpack a file into a directory for which it has no write
permissions, even if it just created that directory itself. This can be a
problem when trying to restore directory structures
@@ -1574,24 +1574,24 @@ Extract a single named file from an archive on /dev/tape:
.br
.I "afio \-i \-v \-Z \-y /home/me/thedir/thefile /dev/tape"
.br
-(If these do not exist yet,
-.I afio
-will also create the enclosing directories
-.I "home/me/myfiledir"
+(If these do not exist yet,
+.I afio
+will also create the enclosing directories
+.I "home/me/myfiledir"
under current working directory.)
.PP
Extract files matching a pattern from an archive on /dev/tape:
.br
.I afio \-i \-v \-Z \-y '/home/me/*' /dev/tape
.br
-(If these do not exist yet,
-.I afio
-will also create the enclosing directories
-.I "home/me"
+(If these do not exist yet,
+.I afio
+will also create the enclosing directories
+.I "home/me"
under current working directory.)
.PP
-If your filesystem cannot handle files larger than 2GB, but you want
-to make an archive on that filesystem that is larger than 2GB,
+If your filesystem cannot handle files larger than 2GB, but you want
+to make an archive on that filesystem that is larger than 2GB,
you use the following trick to split the archive into multiple
files of each 1 GB:
.br
@@ -1602,7 +1602,7 @@ the whole archive using:
.br
.I cat archive.* | afio \-i ... \-
.br
-The wildcard expansion by the shell will ensure that
+The wildcard expansion by the shell will ensure that
.I cat
will read the parts in the right (alphabetic) order.
.PP
@@ -1615,22 +1615,22 @@ However, the current
maintainer does post information on alpha, beta, and production releases at
.I http://freecode.com/projects/afio/
.br
-The Debian project maintains a binary distribution package of
+The Debian project maintains a binary distribution package of
.IR afio ,
see
.IR http://packages.debian.org
.br
-Bug reporting on the Debian package can be done to the Debian project,
-bugs with a scope beyond Debian will usually also reach the current afio
+Bug reporting on the Debian package can be done to the Debian project,
+bugs with a scope beyond Debian will usually also reach the current afio
maintainer mentioned below.
.br
-For general bug reporting, patches,
+For general bug reporting, patches,
suggestions and status inquiries, please e-mail
the current afio maintainer.
-Though the maintenance and distribution effort of
+Though the maintenance and distribution effort of
.I afio
is Linux-centered, correspondence with respect to the use of
-.I afio
+.I afio
on other operating systems is also welcome.
.br
When mailing the maintainer, please use the word `afio' somewhere in
@@ -1640,21 +1640,21 @@ accidentally deleted. The current maintainer e-mail address is:
.I koen.holtman@ieee.org
.br
.SH AUTHORS
-Mark Brukhartz
+Mark Brukhartz
.br
-Jeff Buhrt
+Jeff Buhrt
.br
-Dave Gymer
+Dave Gymer
.br
-Andrew Stevens
+Andrew Stevens
.br
-Koen Holtman
+Koen Holtman
.B (current maintainer)
.I koen.holtman@ieee.org
.br
Anders Baekgaard
.br
-Too many other people to list here have contributed code, patches, ideas,
+Too many other people to list here have contributed code, patches, ideas,
and bug reports. Many of these are mentioned in the HISTORY
file that is included with the sources.
.
View
349 afio.c
@@ -4,12 +4,12 @@
* Manipulate archives and files.
*
* This software was written by Mark Brukhartz at Lachman Associates,
- * Inc.. Additional code was written by a large cast of people.
+ * Inc.. Additional code was written by a large cast of people.
*
* Licensing and (re)distribution
* ------------------------------
*
- * THE SUMMARY INFORMATION BELOW WAS WRITTEN FOR THE BENEFIT OF
+ * THE SUMMARY INFORMATION BELOW WAS WRITTEN FOR THE BENEFIT OF
* SOFTWARE DISTRIBUTORS
*
* Because of historical reasons, different parts of this software
@@ -19,7 +19,7 @@
* - The main authors and maintainers all intend afio to be free and
* freely distributable. It has been distributed widely and for
* free since at least 1987, when it was posted to the
- * comp.sources.linux newsgroup.
+ * comp.sources.linux newsgroup.
*
* - The legal risks to re-distributers, coming from the licence, are
* effectively zero.
@@ -41,12 +41,12 @@
*
* END OF SUMMARY INFORMATION
*
- * ------------------------------------------------------------------
+ * ------------------------------------------------------------------
*
* License notice 1, covering part of this software package.
*
* [Covers the original 1985 afio code]
- *
+ *
* Copyright (c) 1985 Lachman Associates, Inc..
*
* This software was written by Mark Brukhartz at Lachman Associates,
@@ -91,16 +91,16 @@
* modify it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Library General Public
* License along with this library; see the file COPYING.LIB. If
* not, write to the Free Software Foundation, Inc., 675 Mass Ave,
- * Cambridge, MA 02139, USA.
+ * Cambridge, MA 02139, USA.
*
* --------
*
@@ -126,7 +126,7 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
- * [End of licensing and redistribution section]
+ * [End of licensing and redistribution section]
*
* ---------------------------------------------------------------------
*
@@ -159,9 +159,6 @@
*
* See the HISTORY file for more revision info. */
-#ifdef LINT
-static char *ident = "$Header: /u/buhrt/src/afio/RCS/afio.c,v 2.3 1991/09/25 20:08:33 buhrt Exp $";
-#endif
#include <stdio.h>
#include <errno.h>
@@ -174,7 +171,7 @@ static char *ident = "$Header: /u/buhrt/src/afio/RCS/afio.c,v 2.3 1991/09/25 20:
#include <sys/wait.h>
#define linux_tstamp 1
#if 0
-/* fix SunOS errno.h not declaring what the manpage says it declares
+/* fix SunOS errno.h not declaring what the manpage says it declares
bogosity. */
extern int sys_nerr;
extern char *sys_errlist[];
@@ -183,7 +180,7 @@ static char *ident = "$Header: /u/buhrt/src/afio/RCS/afio.c,v 2.3 1991/09/25 20:
#ifdef hpux
#if 0
- /* Fix that HPUX dosent have sys_nerr or sys_errlist
+ /* Fix that HPUX dosent have sys_nerr or sys_errlist
Added by Daniel Andersson, daniel.andersson@sto.sema.se
*/
extern int sys_nerr;
@@ -357,7 +354,7 @@ int main (int ac, char **av)
/* All letters have been used as options, now eating into the numbers....
*/
- while ((c = options (ac, av,
+ while ((c = options (ac, av,
"aioprtIOVCb:c:de:fghjklmns:uvxXy:Y:zFKZL:R:qAE:G:M:w:W:T:SBD:P:Q:U4JH:0@:N:3:1:92:56:7"))
)
{
@@ -621,9 +618,9 @@ int main (int ac, char **av)
if (fn == NULL || av[optind] == NULL)
usage ();
- if (extfmt && cpiocompat)
+ if (extfmt && cpiocompat)
{
- warn(av[0], "Options -4 and -5 cannot be specified at the same time.");
+ warn(av[0], "Options -4 and -5 cannot be specified at the same time.");
usage ();
}
@@ -643,7 +640,7 @@ int main (int ac, char **av)
compress_arg_list[0] = compressprog;
if (Fflag)
- {
+ {
if ((buflen = (off_t) aruntil) == 0)
usage ();
}
@@ -661,11 +658,11 @@ int main (int ac, char **av)
if (aruntil && (aruntil < arbsize))
{
-#ifdef hpux
+#ifdef hpux
/* HPUX gcc dosent like the (ulong) fixed by Daniel Andersson
daniel.andersson@sto.sema.se */
fprintf (stderr, "Media size %ld is less than block size %d\n",
- aruntil, arbsize);
+ aruntil, arbsize);
#else
fprintf (stderr, "Media size %ld is less than block size %d\n",
(unsigned long) aruntil, arbsize);
@@ -691,7 +688,7 @@ int main (int ac, char **av)
if ((equal = strchr ((perc ? perc : arspec), '=')))
*equal++ = '\0';
if ((host=strchr(arspec,'@')))
- *host++ = 0;
+ *host++ = 0;
VOID sprintf (arname = remote,
"!%s %s%s %s '%s -%c -b %u -c %u %s'",
perc ? perc : "rsh",
@@ -702,7 +699,7 @@ int main (int ac, char **av)
isoutput ? 'O' : 'I', arbsize,
group, colon);
if( host )
- *--host = '@';
+ *--host = '@';
if (equal)
*--equal = '=';
if (perc)
@@ -747,7 +744,7 @@ int main (int ac, char **av)
to the openin function that it needs to use that string, not
read from stdin */
}
-
+
/*
* open the archive file
*
@@ -780,10 +777,10 @@ int main (int ac, char **av)
}
exitmsg="The operation was successful.";
- if(warnings)
+ if(warnings)
{
exitmsg=malloc(80);
- if(exitmsg==NULL)
+ if(exitmsg==NULL)
exitmsg="The operation HAD WARNINGS ABOUT ERRORS.";
else
sprintf(exitmsg,"The operation HAD %d WARNING%s ABOUT ERRORS.",warnings,warnings==1?"":"S");
@@ -805,7 +802,7 @@ int main (int ac, char **av)
? "written"
: "read",
timedone - timenow - timewait,
- exitmsg);
+ exitmsg);
}
if (logfile != (FILE *) 0)
{
@@ -823,7 +820,7 @@ int main (int ac, char **av)
/* Added to lower chance of race condition (?) in rsh processing
when reading remote files */
- if(fn==copyin) { fflush(stdout); fclose(stdout); sleep(2); }
+ if(fn==copyin) { fflush(stdout); fclose(stdout); sleep(2); }
if (email) mail(email,-1,arspec);
status=0;
@@ -843,7 +840,7 @@ int main (int ac, char **av)
* Sets the next aruntil-value out of the options-list
*/
void update_aruntil()
-{
+{
char *next_aruntil_string = aruntil_string;
if(aruntil_string)
@@ -876,7 +873,7 @@ void mail(char *who,int vol,char *archive)
fprintf(fp,"Subject: %s %s: %s\n\n",hostname,archive,vol<0?"operation complete":"volume change needed");
fprintf(fp,"Hostname: %s\n",hostname);
fprintf(fp,"Archive : %s\n\n",archive);
- if(vol>=0)
+ if(vol>=0)
fprintf(fp,"Need change to volume #%d.\n\n",vol);
else
fprintf(fp,"Operation complete.\n\n");
@@ -898,12 +895,12 @@ copyin (char **av)
if (*av)
fatal (*av, "Extraneous argument");
while (!areof || askfornext)
- {
+ {
VOID infill ();
while ((have = bufend - bufidx))
if ((got = writeall (STDOUT, bufidx, have)) < 0)
fatal ("<stdout>", syserr ());
- else
+ else
{
total+=have;
if (got > 0)
@@ -928,7 +925,7 @@ copyout (char **av)
if (*av)
fatal (*av, "Extraneous argument");
for (;;)
- {
+ {
while ((want = bufend - bufidx) == 0)
outflush (NOTDONE);
if ((got = read (STDIN, bufidx, want)) < 0)
@@ -939,7 +936,7 @@ copyout (char **av)
{
bufidx += got;
total += got; /* actually a bit too early for bytes written count */
- }
+ }
}
outflush (DONE);
if (fflag)
@@ -979,7 +976,7 @@ dirchg (char *name, char *local)
* Make a directory. Returns zero if successful, -1 otherwise.
*/
STATIC int
-dirmake (char *name, Stat *asb)
+dirmake (char *name, Stat *asb)
{
if (mkdir (name, asb->sb_mode & S_IPOPN) < 0)
return (-1);
@@ -1030,7 +1027,7 @@ dirneed (char *name)
* Print fatal message and exit.
*/
STATIC void
-fatal (char *what, char *why)
+fatal (char *what, char *why)
{
/* print position in archive if some data was transferred */
if(total>0)
@@ -1068,7 +1065,7 @@ int writeall(int fd, const char *buf, unsigned int count)
/*
* readall()
*
- * Read, completely filling buf if we can, or return short size or -1.
+ * Read, completely filling buf if we can, or return short size or -1.
* Used to fix invalud assumptions
* about read() elsewhere.
*/
@@ -1081,9 +1078,9 @@ int readall(int fd, char *buf, unsigned int count)
totalgot=0;
while(totalgot<count)
{
- got=read(fd,buf+totalgot,count-totalgot);
+ got=read(fd,buf+totalgot,count-totalgot);
/* if(got!=count) printf("got on %d = %d\n",fd,got); */
- if(got<=0)
+ if(got<=0)
{
if(got==0) return totalgot;
if(got<0) return got;
@@ -1103,7 +1100,7 @@ int readall(int fd, char *buf, unsigned int count)
STATIC
void mayberewind()
{
- if(rewindfd>=1)
+ if(rewindfd>=1)
{
if(lseek(rewindfd,(off_t)0,SEEK_SET)<0)
{
@@ -1194,7 +1191,7 @@ in (av)
if (inskip (sb.sb_size) < 0)
VOID warn (name, "Skipped file data is corrupt");
}
- else
+ else
{
if((sel2 = inentry (name, &sb)) != 0)
VOID warn (name, "unpacking error");
@@ -1204,12 +1201,12 @@ in (av)
/* we cast to double and print as floating point because
%Lu printing is buggy above 4G (at least with my C library). */
if(printbytepos) fprintf(stderr,"%.0f ",(double)bytepos);
-
+
if (*uncompto)
res = fprintf (stderr, "%s -- uncompressed\n", uncompto);
else
res = fprintf (stderr, "%s -- okay\n", name);
-
+
/* check for broken pipe on stderr */
if(res<0) {
if(errno == EPIPE)
@@ -1353,7 +1350,7 @@ inascii (magic, name, asb)
* -1 otherwise. Assumes that the entire magic number
* has been read.
*/
-
+
STATIC int
inascii2 (char *magic, char *name, Stat *asb)
{
@@ -1390,7 +1387,7 @@ inascii2 (char *magic, char *name, Stat *asb)
return (warnarch ("Bad ASCII pathname", (off_t) namelen));
return (0);
}
-
+
/*
* inascii3()
@@ -1399,7 +1396,7 @@ inascii2 (char *magic, char *name, Stat *asb)
* -1 otherwise. Assumes that the entire magic number
* has been read.
*/
-
+
STATIC int
inascii3 (magic, name, asb)
reg char *magic;
@@ -1443,7 +1440,7 @@ inascii3 (magic, name, asb)
return (warnarch ("Corrupt header", (off_t) 0));
return (0);
}
-
+
/*
* inavail()
@@ -1555,7 +1552,7 @@ indata (fd, size, name)
* Check data from an archive. Returns given file descriptor.
*/
STATIC int
-incheckdata (int fd, off_t size, char *name, Stat *asb, int comp)
+incheckdata (int fd, off_t size, char *name, Stat *asb, int comp)
{
reg uint chunk;
reg char *oops;
@@ -1576,7 +1573,7 @@ incheckdata (int fd, off_t size, char *name, Stat *asb, int comp)
to child 2 to be uncompressed
- child 2 writes the uncompressed data to child 1
- child 1 reads from the file in the filesystem and from child 2,
- compares, and exits nonzero if is a discrepancy.
+ compares, and exits nonzero if is a discrepancy.
*/
if (pipe(pfd) < 0) {
@@ -1689,7 +1686,7 @@ incheckdata (int fd, off_t size, char *name, Stat *asb, int comp)
asb->sb_size -= n;
if (n1 < 0 || n2 < 0 || n1 != n)
{
- if(n1!=n)
+ if(n1!=n)
VOID warn_nocount (name, "File in archive has different length than file on filesystem");
corrupt = 1;
}
@@ -1705,7 +1702,7 @@ incheckdata (int fd, off_t size, char *name, Stat *asb, int comp)
}
}
/* See if the file is _longer_ then our backup. */
- if (read(fd, buff1, 1) > 0)
+ if (read(fd, buff1, 1) > 0)
{
VOID warn_nocount (name, "File in archive is shorter than file on filesystem");
corrupt = 1;
@@ -1713,14 +1710,14 @@ incheckdata (int fd, off_t size, char *name, Stat *asb, int comp)
}
close(fd);
if (corrupt) {
- /*
+ /*
file : Stat atime_sb
archive : Stat *asb
*/
if ( (atime_sb.sb_mtime==asb->sb_mtime) &&
(atime_sb.sb_size==asb->sb_size))
{
- /* file has same mod time and length --> should have verified OK,
+ /* file has same mod time and length --> should have verified OK,
so this is very probably a real error in the backup medium.
*/
VOID warn (name, "File data in archive is corrupt");
@@ -1730,14 +1727,14 @@ incheckdata (int fd, off_t size, char *name, Stat *asb, int comp)
{
VOID warn (name, "Archive headers indicate that file on filesystem was modified during or after archive was made");
- if(index(ignorewarnings,(int)'r'))
+ if(index(ignorewarnings,(int)'r'))
{
warn_nocount(name, "Not counting this as a verification error");
warnings--;
}
else
anycorrupt=1;
-
+
}
return -1;
@@ -1829,7 +1826,7 @@ incheckentry (name, asb)
/* do not verify the control file, return success */
return(0);
}
-
+
uncompressrun = 0;
/* The exact logic below here, and inside openincheck and
@@ -1872,21 +1869,21 @@ infill ()
bufend = bufidx = buffer;
if (!failed)
{
- if (areof)
+ if (areof)
{
- if (total == 0)
+ if (total == 0)
{
- fatal (arspec, "No input");
- }
+ fatal (arspec, "No input");
+ }
else
{
- if((aruntil!=0) || askfornext)
+ if((aruntil!=0) || askfornext)
{
next (O_RDONLY, "Input EOF");
- }
- else
+ }
+ else
{
- fatal (arspec, "Premature input EOF");
+ fatal (arspec, "Premature input EOF");
}
}
}
@@ -1895,7 +1892,7 @@ infill ()
#endif
if (aruntil && (arleft == 0))
next (O_RDONLY, "Input limit reached");
-
+
if(aruntil) ullreadsize=arleft; else ullreadsize=buffer + buflen - bufend;
if(ullreadsize>arbsize) ullreadsize=arbsize;
@@ -1974,7 +1971,7 @@ inhead (name, asb)
warn(arspec,"Input does not start with valid archive header.");
warn(arspec,"Use the -k option to start reading in the middle of an archive.");
fatal (arspec, "Unrecognizable archive");
-
+
}
VOID warnarch ("Bad magic number",
(off_t) sizeof (magic));
@@ -2014,13 +2011,13 @@ inhead (name, asb)
{
while ((name[0] = name[1]))
++name;
- }
+ }
else
{
name[0] = '.';
}
}
-
+
asb->sb_atime = asb->sb_ctime = asb->sb_mtime;
return (0);
}
@@ -2151,7 +2148,7 @@ lineget (stream, buf, bufsize)
if ((!flag0 && c == '\n') || (flag0 && c == '\0'))
break;
if(size<bufsize-1)
- *buf++ = c;
+ *buf++ = c;
size++;
}
@@ -2192,7 +2189,7 @@ linkalso (linkp, name)
* structure, or NULL if unsuccessful.
*/
/* In v2.4.4: added some checks which would be redundant if not
- for the fact that the standard archive format only stores the
+ for the fact that the standard archive format only stores the
lower 16 bits of the inode number.
The checks reduce the chance of false matches when, reading archives
produced by older afio versions and by cpio in the old ascii
@@ -2216,7 +2213,7 @@ linkfrom (asb, installing)
for (linkp = *(abase = linkhash (asb->sb_ino)); linkp; linkp = linknext)
{
-
+
if (linkp->l_ino == asb->sb_ino
&& linkp->l_dev == asb->sb_dev
/* check: do mtimes also match? */
@@ -2228,7 +2225,7 @@ linkfrom (asb, installing)
--linkp->l_nlink; /* reference count for -u option */
/* in older versions of afio, if l_nlink drops to 0, then the
- link entry is removed from the hash table.
+ link entry is removed from the hash table.
We don't do this anymore because that would break things
if the same hard linked directory entry was included
multiple times in the archive. Also it allows us to call
@@ -2300,23 +2297,23 @@ linkto (name, asb)
bits of the inode. We need to avoid duplicate ino numbers
for different files in the archive or else the restore can
have all kinds of horrible failure modes */
-
+
/* first, try the inode that is the inode from the fs, truncated */
ino = asb->sb_ino & 0x0ffff;
-
+
/* check if that has been used, if so choose other one */
while(1)
{
ino16=ino&0xffff;
-
+
/* if the bit for ino16 is 0, then this value has not been used yet
in the archive, so we can break out of the loop and use it */
if((ino16bitused[ino16/8]&((unsigned char)(1)<<(ino16&0x7)))==0) break;
-
+
/* choose other one */
ino=freshino++;
- if(freshino>0xffff)
+ if(freshino>0xffff)
{
/* break out of loop, no need to check if has been used */
break;
@@ -2328,11 +2325,11 @@ linkto (name, asb)
{
ino = asb->sb_ino;
}
-
+
/* add this number to the table of used 16-bit inode numbers */
/* this operation is unneccessary in some cases of the control
flow of the above if statements, but it is nice to put it here */
- ino16=ino&0xffff;
+ ino16=ino&0xffff;
ino16bitused[ino16/8]=ino16bitused[ino16/8]|((unsigned char)(1)<<(ino16&0x7));
/* add this inode to table of hard links (under filesystem inode number) */
@@ -2544,12 +2541,12 @@ next (mode, why)
if (email) mail(email,(int)arvolume,arspec);
- if(promptscript)
+ if(promptscript)
{
-
+
/* run info-script with volume number and archive spec,
and reason for calling it as arguments.
- the script should return 0 for ok and 1 for abort, other
+ the script should return 0 for ok and 1 for abort, other
return codes will be treated as errors. */
/* connect prompt script to /dev/tty if it can be opened, else
@@ -2568,7 +2565,7 @@ next (mode, why)
for (;;)
{
auto int result;
-
+
result=system(msg);
if (result==1)
fatal(arspec,"Aborted");
@@ -2577,7 +2574,7 @@ next (mode, why)
if (nextopen(mode)==0)
break;
}
-
+
}
else
{
@@ -2601,7 +2598,7 @@ next (mode, why)
arspec,
myname);
}
-
+
for (;;)
{
nextask (msg, answer, sizeof (answer));
@@ -2622,7 +2619,7 @@ next (mode, why)
}
else break;
}
-
+
if (nextopen (mode) == 0)
break;
}
@@ -2748,7 +2745,7 @@ nextopen (mode)
#ifdef linux
/* Do O_SYNC writing to the floppy drive */
- if(Fflag && mode)
+ if(Fflag && mode)
arfd = open (arname, mode | O_CREAT | O_TRUNC | O_SYNC, 0666 & ~mask);
else
arfd = mode ? creat (arname, (mode_t)(0666 & ~mask)) : open (arname, mode);
@@ -2805,7 +2802,7 @@ openin (name, fsname, asb, cratio)
if(strncmp(name,"//--",4)==0)
{
strcpy(local,&name[4]);
-
+
label=index(local,(int)' ');
if(label!=NULL)
{
@@ -2849,7 +2846,7 @@ openin (name, fsname, asb, cratio)
if ((fd = open (local, O_RDONLY)) >= 0)
return (fd);
VOID warn (local, syserr ());
- continue;
+ continue;
}
/* not a control file, make a normal archive entry */
@@ -2875,7 +2872,7 @@ openin (name, fsname, asb, cratio)
call, this gives an EOVERFLOW on Linux. We do not want
to count this case as a missing file, so print extra
warning so that warnings counter gets increased properly. */
- if(errno==EOVERFLOW)
+ if(errno==EOVERFLOW)
VOID warn (name, "Can't archive file with size >= 2GB");
#endif
continue;
@@ -2889,7 +2886,7 @@ openin (name, fsname, asb, cratio)
{
case S_IFDIR:
asb->sb_nlink = 1;
- asb->sb_size = 0;
+ asb->sb_size = 0;
return (0);
#ifdef S_IFLNK
case S_IFLNK:
@@ -2906,7 +2903,7 @@ openin (name, fsname, asb, cratio)
if (asb->sb_size == 0)
{
/* indicate that file is not suitable for compression */
- asb->sb_rdev |= RDEV_NOTCOMPR;
+ asb->sb_rdev |= RDEV_NOTCOMPR;
return (0);
}
@@ -2914,7 +2911,7 @@ openin (name, fsname, asb, cratio)
{
/* >=2GB file. Can't handle this and remain cpio compatible */
VOID fatal (name, "Archiving file with size >= 2GB not allowed by -5 option");
- continue;
+ continue;
}
if ((fd = open (local, O_RDONLY)) >= 0)
@@ -2989,15 +2986,15 @@ openincheck (name, asb, comp, dozflag)
strcpy(archlink,asb->sb_link);
- if ((asb->sb_size =
+ if ((asb->sb_size =
readlink (local, asb->sb_link, sizeof (asb->sb_link) - 1)) < 0)
{
VOID warn (name, syserr ());
- asb->sb_size = 0;
+ asb->sb_size = 0;
return 0;
}
asb->sb_link[asb->sb_size] = '\0';
-
+
if(strcmp(archlink,asb->sb_link)!=0)
VOID warn (name, "Difference in symlink destination filename");
@@ -3019,7 +3016,7 @@ openincheck (name, asb, comp, dozflag)
else
{
atime_sb_valid=1;
- }
+ }
}
if ((fd = open (local, O_RDONLY)) >= 0)
@@ -3072,8 +3069,8 @@ opencontrolscript (char *name)
label=index(name,(int)'/');
if(label==NULL) label=NOLABEL; else label++;
-
- if (pipe (pfd) < 0)
+
+ if (pipe (pfd) < 0)
{
warn("Control script",syserr());
return -1;
@@ -3089,16 +3086,16 @@ opencontrolscript (char *name)
VOID close (fileno (stdin));
VOID dup (pfd[0]);
VOID close (pfd[0]);
-
+
execlp (controlscript, controlscript, label, NULL);
- warnarch("Problems running control script:",(off_t)0);
+ warnarch("Problems running control script:",(off_t)0);
warn(controlscript,syserr());
exit (1);
}
/*parent*/
-
+
if (comppid < 0)
{
warn("Control script",syserr());
@@ -3147,7 +3144,7 @@ openotty (name, asb, linkp, ispass, dozflag)
if(ISCONTROL(asb))
return opencontrolscript(name);
-
+
*uncompto = '\0';