Hello,
When encrypting a file with openssl(1),
it exits cleanly when there is not enough disk space:
<operator@palm:~ 0>$ df /altroot
Filesystem Size Used Avail Capacity Mounted on
/dev/wd1a 100M 52.5M 42.7M 55% /altroot
<operator@palm:~ 0>$ while cp /bsd /altroot/tmp/bsd.${RANDOM}
> do
> df /altroot
> done
Filesystem Size Used Avail Capacity Mounted on
/dev/wd1a 100M 62.9M 32.3M 66% /altroot
Filesystem Size Used Avail Capacity Mounted on
/dev/wd1a 100M 73.3M 21.9M 77% /altroot
Filesystem Size Used Avail Capacity Mounted on
/dev/wd1a 100M 83.7M 11.5M 88% /altroot
Filesystem Size Used Avail Capacity Mounted on
/dev/wd1a 100M 94.0M 1.1M 99% /altroot
/altroot: write failed, file system is full
cp: /altroot/tmp/bsd.25298: No space left on device
<operator@palm:~ 0>$ df /altroot
Filesystem Size Used Avail Capacity Mounted on
/dev/wd1a 100M 95.1M 36.0K 100% /altroot
<operator@palm:~ 0>$ ls -lh /altroot/tmp/
total 87328
-rw-r----- 1 operator wheel 10.4M Apr 10 12:22 bsd.16165
-rw-r----- 1 operator wheel 10.4M Apr 10 12:21 bsd.16877
-rw-r----- 1 operator wheel 1.1M Apr 10 12:22 bsd.25298
-rw-r----- 1 operator wheel 10.4M Apr 10 12:22 bsd.728
-rw-r----- 1 operator wheel 10.4M Apr 10 12:22 bsd.7450
<operator@palm:~ 0>$ rm /altroot/tmp/bsd.25298
remove /altroot/tmp/bsd.25298? y
<operator@palm:~ 0>$ cp /bsd /altroot/tmp/bsd.25298
/altroot: write failed, file system is full
cp: /altroot/tmp/bsd.25298: No space left on device
<operator@palm:~ 0>$ print $?
1
<operator@palm:~ 0>$ rm /altroot/tmp/bsd.25298
remove /altroot/tmp/bsd.25298? y
<operator@palm:~ 0>$ df /altroot
Filesystem Size Used Avail Capacity Mounted on
/dev/wd1a 100M 94.0M 1.1M 99% /altroot
<operator@palm:~ 0>$ openssl enc -bf -salt \
-pass file:/etc/myname -in /bsd \
-out /altroot/tmp/bsd.crypto
/altroot: write failed, file system is full
<operator@palm:~ 0>$ print $?
0
<operator@palm:~ 0>$ ls -lh /altroot/tmp/
total 87424
-rw-r----- 1 operator wheel 10.4M Apr 10 12:22 bsd.16165
-rw-r----- 1 operator wheel 10.4M Apr 10 12:21 bsd.16877
-rw-r----- 1 operator wheel 10.4M Apr 10 12:22 bsd.728
-rw-r----- 1 operator wheel 10.4M Apr 10 12:22 bsd.7450
-rw-r----- 1 operator wheel 1.1M Apr 10 12:26 bsd.crypto
Bug?
--
Craig Skinner | http://linkd.in/yGqkv7