Kill mksyntax.c - no longer possible to get the 'wrong sort of chars'.
/bin/sh now has no helper binaries.
syntax.c uses C99 initialisers, run time initialisation could be used
for systems where the compiler doesn't support them.
I've used some #defines to help make this possible - but writing the code
starts making it rather messy.
Use CHAR_MIN (from limits.h) to determine whether target char are signed
or unsigned - the syntax tables will not be indexed properly.
Rip out all the stuff from mksyntax.c that wrote syntax.h.
syntax.c can stiff be generated incorrectly...
Build mksyntax directly from mksyntax.c so that the -DTARGET_CHAR=xxx
is applied when it is build.
OTOH mksyntax is broken as it tries to determine properties of the
target system by running code on the build system.
standard. This change inspired by Apple's "Secure Empty Trash" functionality
in MacOS 10.3. However, it is important to understand that this change
does not -- and can not -- actually achieve conformance to the current
revision of the standard. To quote the manual page:
The -P option attempts to conform to U.S. DoD 5220-22.M, "National Indus-
trial Security Program Operating Manual" ("NISPOM") as updated by Change
2 and the July 23, 2003 "Clearing & Sanitization Matrix". However,
unlike earlier revisions of NISPOM, the 2003 matrix imposes requirements
which make it clear that the standard does not and can not apply to the
erasure of individual files, in particular requirements relating to spare
sector management for an entire magnetic disk. Because these
requirements are not met, the -P option does not conform to the standard.
This also makes the -P option a *lot* more expensive than it used to be.
It used to overwrite with 0xff, overwrite with 0x00, overwrite with 0xff,
with an fsync after each write. Now it overwrites with a random character,
overwrites with 0xff, overwrites with 0x00, reads to validate the 0x00
overwrite, then overwrites with random data -- calling sync() after every
operation in an attempt to force seeks that will clear the data from the
cache of disks that lie about whether data has been committed to the
platters. Also, the file's opened with O_SYNC|O_RSYNC to cause metadata
updates on every read/write, which should cause still more seeks.
This is better than it used to be, but it's by no means adequate if you
have data you really don't want read by an adversary who can pull the
disk apart.
(like executing "pax -Z" by itself), this caused a shr of 32 bits, which is
undefined behavior (C99) if the variable is 32 bits wide, too. Also solves
a problem where the flgch array could be indexed out of bounds.
Thanks to uwe@ and lha@ for their suggestions... I just found the bug :p
run out of inodes. df -i was saying, however, that such file systems
had 100% of their inodes in use, which would do things like trigger
alarms in scripts looking for file systems that have run out.
Instead, say 0% are in use, which although not strictly true is at
least less wrong, fixes scripts and is less worrying in nightly reports.