tjohansen14 / diskscrub

Automatically exported from code.google.com/p/diskscrub
GNU General Public License v2.0
0 stars 0 forks source link

AIX 6.1 gcc compile : built scrub binary does not process input options correctly #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. compile on aix 6.1 with gcc 4.2.0
2. attempt to run scrub with --options or any combination

What is the expected output? What do you see instead?
i would expect to see scrub run with the options provided, but instead it 
errors out

scrub-2.5.2# src/scrub -X /tmp
scrub: using NNSA NAP-14.1-C patterns
scrub: -X directory already exists
scrub-2.5.2# src/scrub --freespace /tmp
src/scrub: illegal option -- -
Usage: scrub [OPTIONS] file
  -v, --version           display scrub version and exit
  -p, --pattern pat       select scrub pattern sequence
  -b, --blocksize size    set I/O buffer size (default 4m)
  -s, --device-size size  set device size manually
  -X, --freespace dir     create dir+files, fill until ENOSPC, then scrub
  -D, --dirent newname    after scrubbing file, scrub dir entry, rename
  -f, --force             scrub despite signature from previous scrub
  -S, --no-signature      do not write scrub signature after scrub
  -r, --remove            remove file after scrub
  -L, --no-link           do not scrub link target
  -R, --no-hwrand         do not use a hardware random number generator
  -t, --no-threads        do not compute random data in a parallel thread
  -h, --help              display this help message

/scrub -X  -p dod -r /tmp/scrub
scrub: using DoD 5220.22-M patterns
scrub: -X directory already exists

/scrub -p dod -r -X /tmp/scrub
scrub: using DoD 5220.22-M patterns
scrub: -X directory already exists

What version of the product are you using? On what operating system?
AIX 6.1
 oslevel
6.1.0.0 Maint Level 6100-08_

Please provide any additional information below.
scrub-2.5.2# gcc -v
Using built-in specs.
Target: powerpc-ibm-aix6.1.0.0
Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld 
--enable-languages=c,c++,java --prefix=/opt/freeware --enable-threads 
--enable-version-specific-runtime-libs --host=powerpc-ibm-aix6.1.0.0 
--target=powerpc-ibm-aix6.1.0.0 --build=powerpc-ibm-aix6.1.0.0 
--disable-libjava-multilib
Thread model: aix
gcc version 4.2.0
root@bismark:~/scrub-2.5.2#

attached config.log

Original issue reported on code.google.com by sancho...@gmail.com on 11 Feb 2014 at 9:04

Attachments:

GoogleCodeExporter commented 8 years ago
From the scrub manual:

      -X, --freespace
              Create  specified  directory  and fill it with files until write
              returns ENOSPC (file system  full),  then  scrub  the  files  as
              usual.   The  size of each file can be set with -s, otherwise it
              will be the maximum file size creatable given  the  user's  file
              size limit or 1g if unlimited.

You might try scrub -X /tmp/scrubdir or something like that.

Original comment by garlick....@gmail.com on 12 Feb 2014 at 2:52

GoogleCodeExporter commented 8 years ago
It works with just -X:
root@bismark:~/scrub-2.5.2# ./src/scrub  -X /tmp/scrub
scrub: using NNSA NAP-14.1-C patterns
scrub: created directory /tmp/scrub
scrub: scrubbing /tmp/scrub/scrub.000 1073741824 bytes (~1024MB)
scrub: random  |............

but if you specify a pattern to use:

root@bismark:~/scrub-2.5.2# ./src/scrub --pattern dod  -X /tmp/scrub
./src/scrub: illegal option -- -
Usage: scrub [OPTIONS] file
  -v, --version           display scrub version and exit
  -p, --pattern pat       select scrub pattern sequence
  -b, --blocksize size    set I/O buffer size (default 4m)
  -s, --device-size size  set device size manually
  -X, --freespace dir     create dir+files, fill until ENOSPC, then scrub
  -D, --dirent newname    after scrubbing file, scrub dir entry, rename
  -f, --force             scrub despite signature from previous scrub
  -S, --no-signature      do not write scrub signature after scrub
  -r, --remove            remove file after scrub
  -L, --no-link           do not scrub link target
  -R, --no-hwrand         do not use a hardware random number generator
  -t, --no-threads        do not compute random data in a parallel thread
  -h, --help              display this help message
Available patterns are:
  nnsa          3-pass   NNSA NAP-14.1-C
  dod           3-pass   DoD 5220.22-M
  bsi           9-pass   BSI
  usarmy        3-pass   US Army AR380-19
  random        1-pass   One Random Pass
  random2       2-pass   Two Random Passes

root@bismark:~/scrub-2.5.2# ./src/scrub -p dod  -X /tmp/scrub
scrub: using DoD 5220.22-M patterns
scrub: -X directory already exists
root@bismark:~/scrub-2.5.2#

Original comment by sancho...@gmail.com on 12 Feb 2014 at 5:45

GoogleCodeExporter commented 8 years ago
Oh sorry, I latched on to the "directory already exists" problem.  Sounds like 
scrub was built without getopt_long().  If you can use the short options 
(single hypen) you should be ok. 

Original comment by garlick....@gmail.com on 13 Feb 2014 at 4:31

GoogleCodeExporter commented 8 years ago
verified it works with short options:
root@bismark:~/scrub-2.5.2# src/scrub -p dod -b 1048576  -R  -f 
/tmp/tmp09081085801468397046.jar
scrub: using DoD 5220.22-M patterns
scrub: scrubbing /tmp/tmp09081085801468397046.jar 57344 bytes (~56KB)
scrub: random  |................................................|
scrub: 0x00    |................................................|
scrub: 0xff    |................................................|
scrub: verify  |................................................|
root@bismark:~/scrub-2.5.2#

getoptlong was not defined:
configure:5702: checking for getopt_long
configure:5758: gcc -o conftest -g -O2   conftest.c  >&5
ld: 0711-317 ERROR: Undefined symbol: .getopt_long
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
configure:5765: $? = 1
configure: failed program was:

Thanks for the 411.

Original comment by sancho...@gmail.com on 13 Feb 2014 at 5:59