srm-devel Mailing List for secure rm
srm is a command-line program to delete files securely.
Brought to you by:
doj
You can subscribe to this list here.
2002 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
(18) |
Aug
|
Sep
|
Oct
|
Nov
(18) |
Dec
(7) |
2009 |
Jan
|
Feb
(5) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(20) |
Sep
(10) |
Oct
(2) |
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(21) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(14) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(6) |
2014 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dirk J. <do...@cu...> - 2014-03-08 02:03:21
|
Hello Mr. Holmes, thank you for reporting this issue. It looks like I appended the resource fork pseudo filename in the wrong order. I'm just not an OsX expert. I'll test and commit your changes soon and will release an updated version of srm. > srm v1.2.12 (and possibly earlier) fails badly in its treatment of > resource forks in the Mac OSX environment, and does so in a way that > can corrupt the underlying file system (corruption of volume header > information). I've appended my patch file which corrects the > (several) problems in 'sunlink.c'; please let me know if additional > problem description is required. -- ---> Dirk Jagdmann ----> http://cubic.org/~doj -----> http://llg.cubic.org |
From: <sh...@co...> - 2014-03-06 20:02:41
|
srm v1.2.12 (and possibly earlier) fails badly in its treatment of resource forks in the Mac OSX environment, and does so in a way that can corrupt the underlying file system (corruption of volume header information). I've appended my patch file which corrects the (several) problems in 'sunlink.c'; please let me know if additional problem description is required. And forgive me if this is "spamming" the list: I'm a complete newbie to the sourceforge community (though not to programming), and saw no other way to submit a bug report. Given the severity of the problem, I thought it important to bring this to someone's attention. Comments and constructive criticism would be welcome. Cheers... /srh ---------------------- patch begins ------------------------ This patch corrects errors in srm v1.2.12 when run in the Mac OSX environment which (1) cause it to fail to locate file resource forks when present, (2) cause unpredictable behavior if resource fork deletion is attempted and (3) emit an error message ("could not access ressource fork") for every file being removed which does NOT have a resource fork. This misbehavior can cause problems in the underlying file system (corruption of the volume header info) when srm 1.2.12 is used to delete files which *do* have a resource fork. To use this patch, create a "src/patch/" directory, copy this file into the new patch directory, then run these commands from the src/ directory for a successful build: patch -p1 <patches/rmrsrc.diff ./configure (optional if already run) make diff -u a/sunlink.c b/sunlink.c --- a/sunlink.c 2014-01-13 15:45:59.000000000 -0500 +++ b/sunlink.c 2014-03-06 13:28:13.000000000 -0500 @@ -905,6 +905,7 @@ struct srm_target rsrc; rsrc.buffer = srm.buffer; rsrc.buffer_size = srm.buffer_size; + rsrc.options = srm.options; rsrc.file_name = (char *)alloca(strlen(srm.file_name) + sizeof (_PATH_RSRCFORKSPEC) + 1); if (rsrc.file_name == NULL) { @@ -912,7 +913,7 @@ goto rsrc_fork_failed; } - if (snprintf((char*)rsrc.file_name, MAXPATHLEN, _PATH_RSRCFORKSPEC "%s", srm.file_name) > MAXPATHLEN - 1) + if (snprintf( (char*)rsrc.file_name, MAXPATHLEN, "%s%s", srm.file_name, _PATH_RSRCFORKSPEC) > MAXPATHLEN - 1) { errno = ENAMETOOLONG; goto rsrc_fork_failed; @@ -945,17 +946,17 @@ if(overwrite_selector(&rsrc) < 0) { if (rsrc.options & SRM_OPT_V) - errorp("could not overwrite ressource fork %s", rsrc.file_name); + errorp("could not overwrite resource fork %s", rsrc.file_name); } ftruncate(rsrc.fd, 0); close(rsrc.fd); - goto rsrc_fork_done; } + goto rsrc_fork_done; rsrc_fork_failed: if (rsrc.options & SRM_OPT_V) - errorp("could not access ressource fork %s", srm.file_name); + errorp("could not access resource fork %s", srm.file_name); rsrc_fork_done: ; } |
From: Dirk J. <do...@us...> - 2014-01-10 06:22:32
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6035 Modified Files: test.sh Log Message: fix variable Index: test.sh =================================================================== RCS file: /cvsroot/srm/srm/test.sh,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test.sh 10 Jan 2014 06:17:06 -0000 1.14 +++ test.sh 10 Jan 2014 06:22:28 -0000 1.15 @@ -135,7 +135,7 @@ fi # test return code if remove fails -if [ $USER = doj -a $HOST = cubicle.cubic.org ] ; then +if [ "$USER" = doj -a "$HOST" = cubicle.cubic.org ] ; then cp -f /etc/fstab "/tmp/$USER.fstab" if $SRM -f /etc/fstab ; then echo "removing /etc/fstab as user should not work" |
From: Dirk J. <do...@us...> - 2014-01-10 06:17:08
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5770 Modified Files: test.sh Log Message: fix dangerous test to only run on my workstation Index: test.sh =================================================================== RCS file: /cvsroot/srm/srm/test.sh,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- test.sh 10 Jan 2014 05:58:11 -0000 1.13 +++ test.sh 10 Jan 2014 06:17:06 -0000 1.14 @@ -135,7 +135,7 @@ fi # test return code if remove fails -if [ $(whoami) != root ] ; then +if [ $USER = doj -a $HOST = cubicle.cubic.org ] ; then cp -f /etc/fstab "/tmp/$USER.fstab" if $SRM -f /etc/fstab ; then echo "removing /etc/fstab as user should not work" |
From: Dirk J. <do...@us...> - 2014-01-10 06:13:47
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5509 Added Files: configure.ac Removed Files: configure.in Log Message: update autotools stuff --- NEW FILE: configure.ac --- dnl Process this file with autoconf to produce a configure script. AC_INIT(srm, 1.2.12) AC_CONFIG_SRCDIR([src/rename_unlink.c]) AM_INIT_AUTOMAKE AC_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB dnl enable 64bit file ops AC_SYS_LARGEFILE dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h varargs.h stdarg.h linux/ext2_fs.h linux/ext3_fs.h attr/xattr.h sys/extattr.h sys/xattr.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_BLKSIZE: your code should no longer depend upon `HAVE_ST_BLKSIZE', but `HAVE_STRUCT_STAT_ST_BLKSIZE'. Remove this warning and the `AC_DEFINE' when you adjust the code.]) AC_CHECK_MEMBERS([struct stat.st_blksize],[AC_DEFINE(HAVE_ST_BLKSIZE, 1, [Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use `HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])]) dnl Checks for library functions. AC_CHECK_FUNCS(fts_open nftw fdatasync chflags snprintf vsnprintf lrand48) dnl Check if we have enable debug support. AC_MSG_CHECKING(whether to enable debugging) debug_default="no" AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging [default=$debug_default]],, enable_debug=$debug_default) if test "x$enable_debug" = "xyes"; then CFLAGS="$CFLAGS -g" AC_MSG_RESULT(yes) else CFLAGS="$CFLAGS -DNDEBUG" AC_MSG_RESULT(no) fi AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile lib/Makefile win/Makefile srm.spec]) AC_OUTPUT --- configure.in DELETED --- |
From: Dirk J. <do...@us...> - 2014-01-10 05:58:14
|
Update of /cvsroot/srm/srm/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4055/src Modified Files: error.c main.c sunlink.c tree_walker.c Log Message: update verbose and error prints. fix exit code of multiple hard links. Index: error.c =================================================================== RCS file: /cvsroot/srm/srm/src/error.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- error.c 25 Nov 2010 22:45:05 -0000 1.7 +++ error.c 10 Jan 2014 05:58:11 -0000 1.8 @@ -9,23 +9,30 @@ #include "impl.h" +/** + * print msg and its printf parameters to STDERR, prefixed by the program name. + */ void error(char *msg, ...) { va_list ap; - char buff[100]; + char buff[1024]; va_start(ap, msg); - vsnprintf(buff, 100, msg, ap); + vsnprintf(buff, sizeof(buff), msg, ap); fprintf(stderr, "%s: %s\n", program_name, buff); va_end(ap); } +/** + * print msg and its printf parameters to STDERR, prefixed by the program name. + * msg is followed by the description of errno. + */ void errorp(char *msg, ...) { va_list ap; - char buff[100], buff2[120]; - + char buff[1024], buff2[1224]; + va_start(ap, msg); - vsnprintf(buff, 100, msg, ap); - snprintf(buff2, 120, "%s: %s", program_name, buff); + vsnprintf(buff, sizeof(buff), msg, ap); + snprintf(buff2, sizeof(buff2), "%s: %s", program_name, buff); perror(buff2); va_end(ap); } Index: sunlink.c =================================================================== RCS file: /cvsroot/srm/srm/src/sunlink.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- sunlink.c 24 Dec 2013 19:11:51 -0000 1.44 +++ sunlink.c 10 Jan 2014 05:58:11 -0000 1.45 @@ -214,7 +214,7 @@ if (len < 0 && errno == ERANGE) { list_size *= 2; if (list_size > 1024*1024) { - printf("file has very large extended attribute list, giving up.\n"); + error("file has very large extended attribute list, giving up."); break; } continue; @@ -259,7 +259,7 @@ #if defined(HAVE_SYS_EXTATTR_H) extattr_namespace_to_string(attrnamespace, &namespace); #endif - printf("found extended attribute %s %s of %i bytes\n", namespace, key, (int)val_len); + error("found extended attribute %s %s of %i bytes", namespace, key, (int)val_len); } if (val_len > value_size) { value_size = val_len; @@ -278,7 +278,7 @@ ret = extattr_set_fd(srm->fd, attrnamespace, key, value, val_len); #endif if (ret < 0) { - printf("could not overwrite extended attribute %s: %s\n", key, strerror(errno)); + errorp("could not overwrite extended attribute %s", key); } } return 0; @@ -430,7 +430,7 @@ if(srm->options & SRM_MODE_DOD) { if((srm->options&SRM_OPT_V) > 1) - printf("US DoD mode\n"); + error("US DoD mode"); if(overwrite_byte(srm, 1, 0xF6) < 0) return -1; if(overwrite_byte(srm, 2, 0x00) < 0) return -1; if(overwrite_byte(srm, 3, 0xFF) < 0) return -1; @@ -442,14 +442,14 @@ else if(srm->options & SRM_MODE_DOE) { if((srm->options&SRM_OPT_V) > 1) - printf("US DoE mode\n"); + error("US DoE mode"); if(overwrite_random(srm, 1, 2) < 0) return -1; if(overwrite_bytes(srm, 3, 'D', 'o', 'E') < 0) return -1; } else if(srm->options & SRM_MODE_OPENBSD) { if((srm->options&SRM_OPT_V) > 1) - printf("OpenBSD mode\n"); + error("OpenBSD mode"); if(overwrite_byte(srm, 1, 0xFF) < 0) return -1; if(overwrite_byte(srm, 2, 0x00) < 0) return -1; if(overwrite_byte(srm, 3, 0xFF) < 0) return -1; @@ -457,15 +457,15 @@ else if(srm->options & SRM_MODE_SIMPLE) { if((srm->options&SRM_OPT_V) > 1) - printf("Simple mode\n"); + error("Simple mode"); if(overwrite_byte(srm, 1, 0x00) < 0) return -1; } else { if(! (srm->options & SRM_MODE_35)) - fprintf(stderr, "something is strange, did not have mode_35 bit\n"); + error("something is strange, did not have mode_35 bit"); if((srm->options&SRM_OPT_V) > 1) - printf("Full 35-pass mode (Gutmann method)\n"); + error("Full 35-pass mode (Gutmann method)"); if(overwrite_random(srm, 1, 4) < 0) return -1; if(overwrite_byte(srm, 5, 0x55) < 0) return -1; if(overwrite_byte(srm, 6, 0xAA) < 0) return -1; @@ -498,10 +498,10 @@ /* if you want to backup your partition or shrink your vmware image having the file zero-ed gives best compression results. */ if(overwrite_byte(srm, 36, 0x00) < 0) return -1; } - +#if 0 if((srm->options & SRM_OPT_V) > 1) printf("\n"); - +#endif return 0; } @@ -532,7 +532,7 @@ if(srm.buffer_size < 16) srm.buffer_size = 512; if((srm.options & SRM_OPT_V) > 2) - printf("buffer_size=%u\n", srm.buffer_size); + error("buffer_size=%u", srm.buffer_size); #ifdef __linux__ if(S_ISBLK(statbuf.st_mode)) @@ -550,7 +550,7 @@ return 1; } if((options&SRM_OPT_V) > 2) - printf("sector size %i bytes\n", secsize); + error("sector size %i bytes", secsize); if(ioctl(srm.fd, BLKGETSIZE, &blocks) < 0) { @@ -558,7 +558,7 @@ return 1; } if((options&SRM_OPT_V) > 2) - printf("BLKGETSIZE %i blocks\n", (int)blocks); + error("BLKGETSIZE %i blocks", (int)blocks); if(ioctl(srm.fd, BLKGETSIZE64, &u) < 0) { @@ -566,11 +566,11 @@ return 1; } if((options&SRM_OPT_V) > 2) - printf("BLKGETSIZE64 %llu bytes\n", (unsigned long long)u); + error("BLKGETSIZE64 %llu bytes", (unsigned long long)u); u_=((uint64_t)blocks)*secsize; if(u_ != u) - printf("!Warning! sectorsize*blocks:%llu != bytes:%llu\n", (long long unsigned) u_, (long long unsigned) u); + error("!Warning! sectorsize*blocks:%llu != bytes:%llu", (long long unsigned) u_, (long long unsigned) u); srm.file_size = u; srm.buffer_size = secsize; @@ -579,19 +579,19 @@ { close(srm.fd); if (srm.options & SRM_OPT_V) - fprintf(stderr, "could not determine block device %s filesize\n", srm.file_name); + error("could not determine block device %s filesize", srm.file_name); errno = EIO; return -1; } if((options&SRM_OPT_V) > 1) - printf("block device %s size: %llu bytes\n", srm.file_name, (unsigned long long)u); + error("block device %s size: %llu bytes", srm.file_name, (unsigned long long)u); if(overwrite_selector(&srm) < 0) { int e=errno; if (srm.options & SRM_OPT_V) - fprintf(stderr, "could not overwrite device %s: %s\n", srm.file_name, strerror(errno)); + errorp("could not overwrite device %s", srm.file_name); close(srm.fd); errno=e; return -1; @@ -641,7 +641,7 @@ #error Please define your platform. #endif if((srm.options & SRM_OPT_V) > 2) - printf("buffer_size=%u\n", srm.buffer_size); + error("buffer_size=%u", srm.buffer_size); #if defined(HAVE_LINUX_EXT2_FS_H) || defined(HAVE_LINUX_EXT3_FS_H) if (fs_stats.f_type == EXT2_SUPER_MAGIC ) /* EXT2_SUPER_MAGIC and EXT3_SUPER_MAGIC are the same */ @@ -711,7 +711,7 @@ { int e=errno; if (srm.options & SRM_OPT_V) - fprintf(stderr, "could not overwrite file %s: %s\n", srm.file_name, strerror(errno)); + errorp("could not overwrite file %s", srm.file_name); close(srm.fd); errno=e; return -1; @@ -772,12 +772,12 @@ } if (rsrc.options & SRM_OPT_V) - printf("removing %s\n", rsrc.file_name); + error("removing %s", rsrc.file_name); if(overwrite_selector(&rsrc) < 0) { if (rsrc.options & SRM_OPT_V) - fprintf(stderr, "could not overwrite ressource fork %s: %s\n", rsrc.file_name, strerror(errno)); + errorp("could not overwrite ressource fork %s", rsrc.file_name); } ftruncate(rsrc.fd, 0); @@ -787,7 +787,7 @@ rsrc_fork_failed: if (rsrc.options & SRM_OPT_V) - fprintf(stderr, "could not access ressource fork %s: %s\n", srm.file_name, strerror(errno)); + errorp("could not access ressource fork %s", srm.file_name); rsrc_fork_done: ; } Index: main.c =================================================================== RCS file: /cvsroot/srm/srm/src/main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- main.c 9 Jun 2011 18:04:26 -0000 1.16 +++ main.c 10 Jan 2014 05:58:11 -0000 1.17 @@ -114,8 +114,8 @@ } if (optind == argc) { - printf("%s: too few arguments\n", program_name); - printf("Try `%s --help' for more information.\n", program_name); + fprintf(stderr, "%s: too few arguments\n", program_name); + fprintf(stderr, "Try `%s --help' for more information.\n", program_name); exit(EXIT_FAILURE); } Index: tree_walker.c =================================================================== RCS file: /cvsroot/srm/srm/src/tree_walker.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- tree_walker.c 24 Dec 2013 20:14:06 -0000 1.32 +++ tree_walker.c 10 Jan 2014 05:58:11 -0000 1.33 @@ -102,7 +102,7 @@ if (options & SRM_OPT_F) { if (options & SRM_OPT_V) - printf("removing %s\n", path); + error("removing %s", path); return check_perms(path); } @@ -127,7 +127,7 @@ } if ((options & SRM_OPT_V) && return_value) - printf("removing %s\n", path); + error("removing %s", path); if(fd >= 0) close(fd); /* close if open succeeded, or silently fail */ @@ -229,8 +229,10 @@ } if (sunlink(path, options) < 0) { if (errno == EMLINK) { - error("%s has multiple links, this one has been removed but not overwritten", path); - return 0; + if (options & SRM_OPT_V) { + error("%s has multiple links, this one has been unlinked but not overwritten", path); + } + return 1; } errorp("unable to remove %s", path); return 0; |
From: Dirk J. <do...@us...> - 2014-01-10 05:58:13
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4055 Modified Files: test.sh Log Message: update verbose and error prints. fix exit code of multiple hard links. Index: test.sh =================================================================== RCS file: /cvsroot/srm/srm/test.sh,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- test.sh 24 Dec 2013 20:14:06 -0000 1.12 +++ test.sh 10 Jan 2014 05:58:11 -0000 1.13 @@ -18,6 +18,7 @@ fi } +# symlink echo "TEST" > test.file if [ ! -f test.file ] ; then echo could not create test file @@ -31,10 +32,12 @@ fi testremove test.symlink +# attributes echo "TEST" > test.file2 chmod 000 test.file2 testremove test.file2 +# recursing into directories rm -rf test.dir mkdir test.dir if [ ! -d test.dir ] ; then @@ -53,8 +56,8 @@ testremove test.dir +# device nodes I=`whoami` - if [ "$I" = root ] ; then mkdir test.dir2 @@ -79,6 +82,7 @@ fi +# FIFO special file mkfifo test.fifo if [ ! -p test.fifo ] ; then echo could not create fifo @@ -86,6 +90,29 @@ fi testremove test.fifo +# hard links +echo "the hard link" > test.file +cp -f test.file test2.file +ln test.file test3.file +if ! cmp test.file test3.file ; then + echo "compare of test.file and test3.file failed on hard link test" + exit 1 +fi +testremove test3.file +if ! cmp test.file test2.file ; then + echo "compare of test.file and test2.file failed on hard link test" + exit 1 +fi +testremove test2.file +if [ -f test2.file ] ; then + echo "could not remove test2.file on hard link test" + exit 1 +fi +if [ -f test3.file ] ; then + echo "could not remove test3.file on hard link test" + exit 1 +fi + testremove test.file if [ -f test.file ] ; then echo could not remove test file @@ -116,6 +143,26 @@ fi fi +# test extended attributes +DIR=test.test +mkdir -p $DIR +chmod +t $DIR +FN=$DIR/test.atr +echo "TEST" > $FN +OS=$(uname -s) +if [ "$OS" = Linux ] ; then + setfattr -n user.a1 -v "The value of extended attribute number 1" $FN + setfattr -n user.num2 -v "A second attribute." $FN +elif [ "$OS" = FreeBSD ] ; then + setextattr user a1 "The value of extended attribute number 1" $FN + setextattr user num2 "A second attribute." $FN +elif [ "$OS" = Darwin ] ; then + xattr -w a1 "The value of extended attribute number 1" $FN + xattr -w num2 "A second attribute." $FN +fi +$SRM $FN +rmdir $DIR + # test file sizes SRM="$SRM -s" @@ -156,25 +203,5 @@ testsrm done -# test extended attributes -DIR=test.test -mkdir -p $DIR -chmod +t $DIR -FN=$DIR/test.atr -echo "TEST" > $FN -OS=$(uname -s) -if [ "$OS" = Linux ] ; then - setfattr -n user.a1 -v "The value of extended attribute number 1" $FN - setfattr -n user.num2 -v "A second attribute." $FN -elif [ "$OS" = FreeBSD ] ; then - setextattr user a1 "The value of extended attribute number 1" $FN - setextattr user num2 "A second attribute." $FN -elif [ "$OS" = Darwin ] ; then - xattr -w a1 "The value of extended attribute number 1" $FN - xattr -w num2 "A second attribute." $FN -fi -$SRM $FN -rmdir $DIR - echo all tests successful exit 0 |
From: Dirk J. <do...@us...> - 2013-12-24 20:14:09
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10972 Modified Files: NEWS test.sh Log Message: exit status 1 if remove fails Index: test.sh =================================================================== RCS file: /cvsroot/srm/srm/test.sh,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- test.sh 24 Dec 2013 06:13:23 -0000 1.11 +++ test.sh 24 Dec 2013 20:14:06 -0000 1.12 @@ -107,6 +107,15 @@ exit 1 fi +# test return code if remove fails +if [ $(whoami) != root ] ; then + cp -f /etc/fstab "/tmp/$USER.fstab" + if $SRM -f /etc/fstab ; then + echo "removing /etc/fstab as user should not work" + exit 1 + fi +fi + # test file sizes SRM="$SRM -s" Index: NEWS =================================================================== RCS file: /cvsroot/srm/srm/NEWS,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- NEWS 24 Dec 2013 04:16:04 -0000 1.16 +++ NEWS 24 Dec 2013 20:14:06 -0000 1.17 @@ -4,6 +4,7 @@ small updates to autotools build files. support Haiku operating system. overwrite POSIX extended attributes. + srm has exit code != 0 if removing any file or directory failed. release-1_2_11 Win32 command line wildcard expansion |
From: Dirk J. <do...@us...> - 2013-12-24 19:11:54
|
Update of /cvsroot/srm/srm/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7579/src Modified Files: sunlink.c Log Message: fiddle with header includes and defines Index: sunlink.c =================================================================== RCS file: /cvsroot/srm/srm/src/sunlink.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- sunlink.c 24 Dec 2013 06:13:23 -0000 1.43 +++ sunlink.c 24 Dec 2013 19:11:51 -0000 1.44 @@ -25,6 +25,7 @@ #if defined(__APPLE__) #include <sys/disk.h> +#include <sys/paths.h> #endif #if defined(HAVE_SYS_PARAM_H) && defined(HAVE_SYS_MOUNT_H) @@ -54,8 +55,11 @@ #if defined(HAVE_ATTR_XATTR_H) #include <attr/xattr.h> +#undef HAVE_SYS_XATTR_H +#undef HAVE_SYS_EXTATTR_H #elif defined(HAVE_SYS_XATTR_H) #include <sys/xattr.h> +#undef HAVE_SYS_EXTATTR_H #elif defined(HAVE_SYS_EXTATTR_H) #include <sys/extattr.h> #include <libutil.h> @@ -68,8 +72,6 @@ #define O_SYNC 0 #endif -#define NO_UNLINK 0 - #define KiB 1024 #define MiB (KiB*KiB) #define GiB (KiB*KiB*KiB) @@ -206,7 +208,7 @@ #if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_XATTR_H) #if defined(HAVE_ATTR_XATTR_H) len = flistxattr(srm->fd, list, list_size); -#elif defined(HAVE_SYS_XATTR_H) +#elif defined(HAVE_SYS_XATTR_H) && defined(__APPLE__) len = flistxattr(srm->fd, list, list_size, 0); #endif if (len < 0 && errno == ERANGE) { @@ -241,7 +243,7 @@ key_len = strlen(key); #if defined(HAVE_ATTR_XATTR_H) val_len = fgetxattr(srm->fd, key, NULL, 0); -#elif defined(HAVE_SYS_XATTR_H) +#elif defined(HAVE_SYS_XATTR_H) && defined(__APPLE__) val_len = fgetxattr(srm->fd, key, NULL, 0, 0, 0); #endif #elif defined(HAVE_SYS_EXTATTR_H) @@ -270,7 +272,7 @@ } #if defined(HAVE_ATTR_XATTR_H) ret = fsetxattr(srm->fd, key, value, val_len, XATTR_REPLACE); -#elif defined(HAVE_SYS_XATTR_H) +#elif defined(HAVE_SYS_XATTR_H) && defined(__APPLE__) ret = fsetxattr(srm->fd, key, value, val_len, 0, XATTR_REPLACE); #elif defined(HAVE_SYS_EXTATTR_H) ret = extattr_set_fd(srm->fd, attrnamespace, key, value, val_len); @@ -568,7 +570,7 @@ u_=((uint64_t)blocks)*secsize; if(u_ != u) - printf("!Warning! sectorsize*blocks:%llu != bytes:%llu\n", u_, u); + printf("!Warning! sectorsize*blocks:%llu != bytes:%llu\n", (long long unsigned) u_, (long long unsigned) u); srm.file_size = u; srm.buffer_size = secsize; @@ -719,14 +721,12 @@ ioctl(srm.fd, EXT2_IOC_SETFLAGS, EXT2_SECRM_FL); #endif -#if !NO_UNLINK if (ftruncate(srm.fd, 0) < 0) { int e=errno; close(srm.fd); errno=e; return -1; } -#endif close(srm.fd); srm.fd = -1; @@ -734,18 +734,17 @@ #ifdef __APPLE__ /* Also overwrite the file's resource fork, if present. */ { -#define RSRCFORKSPEC "/..namedfork/rsrc" struct srm_target rsrc; rsrc.buffer = srm.buffer; rsrc.buffer_size = srm.buffer_size; - rsrc.file_name = (char *)alloca(strlen(srm.file_name) + sizeof(RSRCFORKSPEC) + 1); + rsrc.file_name = (char *)alloca(strlen(srm.file_name) + sizeof(_PATH_RSRCFORKSPEC) + 1); if (rsrc.file_name == NULL) { errno = ENOMEM; goto rsrc_fork_failed; } - if (snprintf((char*)rsrc.file_name, MAXPATHLEN, RSRCFORKSPEC "%s", srm.file_name) > MAXPATHLEN - 1) + if (snprintf((char*)rsrc.file_name, MAXPATHLEN, _PATH_RSRCFORKSPEC "%s", srm.file_name) > MAXPATHLEN - 1) { errno = ENAMETOOLONG; goto rsrc_fork_failed; @@ -794,9 +793,5 @@ } #endif /* __APPLE__ */ -#if NO_UNLINK - return 0; -#else return rename_unlink(srm.file_name); -#endif } |
From: Dirk J. <do...@us...> - 2013-12-24 06:13:26
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18703 Modified Files: aclocal.m4 configure.in test.sh Log Message: add OsX extended attributes Index: test.sh =================================================================== RCS file: /cvsroot/srm/srm/test.sh,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- test.sh 24 Dec 2013 05:32:22 -0000 1.10 +++ test.sh 24 Dec 2013 06:13:23 -0000 1.11 @@ -140,7 +140,8 @@ testsrm # test until ~5GiB -for i in 1 22 333 4444 55555 666666 7777777 44444444 ; do +for i in 1 22 333 4444 55555 666666 7777777 44444444 +do F="$i.tst" dd if=$SRC of=$F bs=$BS count=$i 2> /dev/null testsrm @@ -159,6 +160,9 @@ elif [ "$OS" = FreeBSD ] ; then setextattr user a1 "The value of extended attribute number 1" $FN setextattr user num2 "A second attribute." $FN +elif [ "$OS" = Darwin ] ; then + xattr -w a1 "The value of extended attribute number 1" $FN + xattr -w num2 "A second attribute." $FN fi $SRM $FN rmdir $DIR Index: aclocal.m4 =================================================================== RCS file: /cvsroot/srm/srm/aclocal.m4,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- aclocal.m4 24 Dec 2013 05:32:22 -0000 1.13 +++ aclocal.m4 24 Dec 2013 06:13:23 -0000 1.14 @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) Index: configure.in =================================================================== RCS file: /cvsroot/srm/srm/configure.in,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- configure.in 24 Dec 2013 05:32:22 -0000 1.42 +++ configure.in 24 Dec 2013 06:13:23 -0000 1.43 @@ -15,7 +15,7 @@ dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h varargs.h stdarg.h linux/ext2_fs.h linux/ext3_fs.h attr/xattr.h sys/extattr.h) +AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h varargs.h stdarg.h linux/ext2_fs.h linux/ext3_fs.h attr/xattr.h sys/extattr.h sys/xattr.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST |
From: Dirk J. <do...@us...> - 2013-12-24 05:32:24
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16006 Modified Files: aclocal.m4 configure.in test.sh Log Message: support FreeBSD extended attributes Index: test.sh =================================================================== RCS file: /cvsroot/srm/srm/test.sh,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- test.sh 24 Dec 2013 04:16:04 -0000 1.9 +++ test.sh 24 Dec 2013 05:32:22 -0000 1.10 @@ -148,12 +148,18 @@ # test extended attributes DIR=test.test -mkdir $DIR +mkdir -p $DIR chmod +t $DIR FN=$DIR/test.atr echo "TEST" > $FN -setfattr -n user.a1 -v "The value of extended attribute number 1" $FN -setfattr -n user.num2 -v "A second attribute." $FN +OS=$(uname -s) +if [ "$OS" = Linux ] ; then + setfattr -n user.a1 -v "The value of extended attribute number 1" $FN + setfattr -n user.num2 -v "A second attribute." $FN +elif [ "$OS" = FreeBSD ] ; then + setextattr user a1 "The value of extended attribute number 1" $FN + setextattr user num2 "A second attribute." $FN +fi $SRM $FN rmdir $DIR Index: aclocal.m4 =================================================================== RCS file: /cvsroot/srm/srm/aclocal.m4,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- aclocal.m4 24 Dec 2013 03:07:09 -0000 1.12 +++ aclocal.m4 24 Dec 2013 05:32:22 -0000 1.13 @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, -[m4_warning([this file was generated for autoconf 2.67. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) Index: configure.in =================================================================== RCS file: /cvsroot/srm/srm/configure.in,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- configure.in 24 Dec 2013 04:16:04 -0000 1.41 +++ configure.in 24 Dec 2013 05:32:22 -0000 1.42 @@ -15,7 +15,7 @@ dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h varargs.h stdarg.h linux/ext2_fs.h linux/ext3_fs.h attr/xattr.h) +AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h varargs.h stdarg.h linux/ext2_fs.h linux/ext3_fs.h attr/xattr.h sys/extattr.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST |
From: Dirk J. <do...@us...> - 2013-12-24 04:16:06
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11631 Modified Files: NEWS TODO configure.in test.sh Log Message: overwrite POSIX attributes on Linux Index: test.sh =================================================================== RCS file: /cvsroot/srm/srm/test.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- test.sh 14 Jul 2011 07:02:27 -0000 1.8 +++ test.sh 24 Dec 2013 04:16:04 -0000 1.9 @@ -1,7 +1,9 @@ #!/bin/sh # test script for srm -make || exit 1 +set -e # exit if any commands fail + +make SRM="src/srm -vvvvvvv" @@ -107,7 +109,7 @@ # test file sizes -SRM="$SRM -E" +SRM="$SRM -s" BS=123 SRC=/dev/zero # /dev/urandom @@ -144,5 +146,16 @@ testsrm done -echo all tests successfull +# test extended attributes +DIR=test.test +mkdir $DIR +chmod +t $DIR +FN=$DIR/test.atr +echo "TEST" > $FN +setfattr -n user.a1 -v "The value of extended attribute number 1" $FN +setfattr -n user.num2 -v "A second attribute." $FN +$SRM $FN +rmdir $DIR + +echo all tests successful exit 0 Index: NEWS =================================================================== RCS file: /cvsroot/srm/srm/NEWS,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- NEWS 24 Dec 2013 03:07:09 -0000 1.15 +++ NEWS 24 Dec 2013 04:16:04 -0000 1.16 @@ -3,6 +3,7 @@ release-1_2_12 small updates to autotools build files. support Haiku operating system. + overwrite POSIX extended attributes. release-1_2_11 Win32 command line wildcard expansion Index: TODO =================================================================== RCS file: /cvsroot/srm/srm/TODO,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- TODO 24 Dec 2013 03:07:09 -0000 1.33 +++ TODO 24 Dec 2013 04:16:04 -0000 1.34 @@ -1,14 +1,12 @@ -- for srm 1.2.12 - + check ext2 special flags, unremovable, immutable, appendonly - + FreeBSD test, check st_flags in sunlink.c - + check with ext4 (http://ext4.wiki.kernel.org/index.php/Main_Page), jfs, xfs, reiserfs +- check ext2 special flags, unremovable, immutable, appendonly +- FreeBSD test, check st_flags in sunlink.c +- check with ext4 (http://ext4.wiki.kernel.org/index.php/Main_Page), jfs, xfs, reiserfs - make a library from sunlink.c so other programs can use the function - use only code in lib/ on platforms which don't have these functions - check for OS in configure.in - only compile files in lib/ depending on platform -- overwrite POSIX extended attributes: attr(5), listxattr, ... - handle NTFS alternate data streams http://www.flexhex.com/docs/articles/alternate-streams.phtml - overwrite raw devices by using their /dev/ device node @@ -28,6 +26,8 @@ completely and use srm instead, but problem is that only root can write to /proc filesystem. +- research if special erase commands for SSD are available to userspace + - HPux test - Solaris test - AIX test Index: configure.in =================================================================== RCS file: /cvsroot/srm/srm/configure.in,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- configure.in 24 Dec 2013 03:07:09 -0000 1.40 +++ configure.in 24 Dec 2013 04:16:04 -0000 1.41 @@ -15,7 +15,7 @@ dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h varargs.h stdarg.h linux/ext2_fs.h linux/ext3_fs.h) +AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h varargs.h stdarg.h linux/ext2_fs.h linux/ext3_fs.h attr/xattr.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST |
From: Dirk J. <do...@us...> - 2013-12-24 03:07:11
|
Update of /cvsroot/srm/srm/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6697/src Modified Files: impl.h Log Message: add check for Haiku Index: impl.h =================================================================== RCS file: /cvsroot/srm/srm/src/impl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- impl.h 6 Jun 2010 16:21:45 -0000 1.2 +++ impl.h 24 Dec 2013 03:07:09 -0000 1.3 @@ -26,7 +26,7 @@ #define FTS_NS 66666 #endif -#if defined(__unix__) || defined(__APPLE__) +#if defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__) #define SRM_DIRSEP '/' #elif defined(_WIN32) #define SRM_DIRSEP '\\' |
From: Dirk J. <do...@us...> - 2013-09-03 07:38:34
|
Update of /cvsroot/srm/srm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27452 Modified Files: TODO Log Message: updates Index: TODO =================================================================== RCS file: /cvsroot/srm/srm/TODO,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- TODO 9 Jun 2011 18:04:26 -0000 1.31 +++ TODO 3 Sep 2013 07:38:32 -0000 1.32 @@ -18,6 +18,15 @@ the file without O_DIRECT and if that does not work, abort handling that file. +- Did you think about adding to code automatic cache clear because + even if program do its work when you get access to space on drive + you are still able to get data from it. In my situation I have to do + cache clear at the and (sync; echo 1 > + /proc/sys/vm/drop_caches;sleep 1; echo 0 > + /proc/sys/vm/drop_caches). I would like to get rid off standard rm + completely and use srm instead, but problem is that only root can + write to /proc filesystem. + - HPux test - Solaris test - AIX test |
From: SourceForge.net <no...@so...> - 2011-12-16 00:53:46
|
Feature Requests item #3459561, was opened at 2011-12-14 09:28 Message generated for change (Comment added) made by doj You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=353297&aid=3459561&group_id=3297 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Priority: 5 Private: No Submitted By: Ken (kwiniec) Assigned to: Nobody/Anonymous (nobody) Summary: zeroing-only option for SSDs Initial Comment: Solid-state drives (SSDs) work best when unused space is zeroed, which I think would also meet most security needs, but srm only offers the 2-pass -sz which takes longer and subjects RAM cells to more wear. So I'd like to see an option to zero blocks with no other overwriting passes. ---------------------------------------------------------------------- >Comment By: Dirk Jagdmann (doj) Date: 2011-12-15 16:53 Message: the version of srm hosted here on SourceForge has the "-s" option which overwrites with 0 bytes in a single pass. So that should suffice your needs. Or are you talking about accessing SSD blocks on the SATA/SAS protocol level directly? I know drives may feature a "secure delete" mode/command, but those are beyond what a user-space unix program can do. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=353297&aid=3459561&group_id=3297 |
From: SourceForge.net <no...@so...> - 2011-12-14 17:28:39
|
Feature Requests item #3459561, was opened at 2011-12-14 09:28 Message generated for change (Tracker Item Submitted) made by kwiniec You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=353297&aid=3459561&group_id=3297 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Priority: 5 Private: No Submitted By: Ken (kwiniec) Assigned to: Nobody/Anonymous (nobody) Summary: zeroing-only option for SSDs Initial Comment: Solid-state drives (SSDs) work best when unused space is zeroed, which I think would also meet most security needs, but srm only offers the 2-pass -sz which takes longer and subjects RAM cells to more wear. So I'd like to see an option to zero blocks with no other overwriting passes. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=353297&aid=3459561&group_id=3297 |
From: SourceForge.net <no...@so...> - 2011-07-14 07:05:24
|
Bugs item #3366103, was opened at 2011-07-13 07:14 Message generated for change (Comment added) made by doj You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3366103&group_id=3297 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Keith Watson (ikawnoclast) >Assigned to: Dirk Jagdmann (doj) Summary: block device test failure due to typo Initial Comment: I noticed that there is a typo in the test.sh file that prevents the test suite from correctly testing the block special device functionality. The option to test for the existence of the block special device file should be '-b' but is '-c'. I have attached a patch to correct the typo. The test suite is now working on Mac OS X 10.6. ---------------------------------------------------------------------- >Comment By: Dirk Jagdmann (doj) Date: 2011-07-14 00:05 Message: fixed for the 1.2.12 release. That you for reporting this issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3366103&group_id=3297 |
From: Dirk J. <do...@us...> - 2011-07-14 07:02:30
|
Update of /cvsroot/srm/srm In directory vz-cvs-3.sog:/tmp/cvs-serv11648 Modified Files: test.sh Log Message: fixed block device test Index: test.sh =================================================================== RCS file: /cvsroot/srm/srm/test.sh,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- test.sh 6 Jun 2010 16:37:52 -0000 1.7 +++ test.sh 14 Jul 2011 07:02:27 -0000 1.8 @@ -69,7 +69,7 @@ testremove test.char mknod test.block b 1 1 - if [ ! -c test.block ] ; then + if [ ! -b test.block ] ; then echo could not mknod test.block exit 1 fi |
From: SourceForge.net <no...@so...> - 2011-07-13 14:14:36
|
Bugs item #3366103, was opened at 2011-07-13 10:14 Message generated for change (Tracker Item Submitted) made by ikawnoclast You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3366103&group_id=3297 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Keith Watson (ikawnoclast) Assigned to: Nobody/Anonymous (nobody) Summary: block device test failure due to typo Initial Comment: I noticed that there is a typo in the test.sh file that prevents the test suite from correctly testing the block special device functionality. The option to test for the existence of the block special device file should be '-b' but is '-c'. I have attached a patch to correct the typo. The test suite is now working on Mac OS X 10.6. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3366103&group_id=3297 |
From: Dirk J. <do...@us...> - 2011-06-30 06:06:06
|
Update of /cvsroot/srm/srm/src In directory vz-cvs-3.sog:/tmp/cvs-serv4037/src Modified Files: random.c tree_walker.c Log Message: fixed compilation with -pedantic Index: random.c =================================================================== RCS file: /cvsroot/srm/srm/src/random.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- random.c 25 Nov 2010 22:45:05 -0000 1.9 +++ random.c 30 Jun 2011 06:06:04 -0000 1.10 @@ -40,7 +40,7 @@ } #ifdef _MSC_VER -// I don't know why, but Microsoft does not like our readn() function below +/* I don't know why, but Microsoft does not like our readn() function below */ #define readn read #else /** @@ -59,11 +59,11 @@ static ssize_t readn(int fd, void *buf, const size_t count) { /*lint --e{1924}*/ + char *ptr = (char*)buf; + size_t nleft = count; if(fd<0 || !buf) return -1; - char *ptr=(char*)buf; - size_t nleft=count; while(nleft > 0) { ssize_t nread; Index: tree_walker.c =================================================================== RCS file: /cvsroot/srm/srm/src/tree_walker.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- tree_walker.c 30 Jun 2011 06:03:02 -0000 1.30 +++ tree_walker.c 30 Jun 2011 06:06:04 -0000 1.31 @@ -3,7 +3,7 @@ #include "config.h" -#if defined(__linux__) && 1 +#if defined(__linux__) /* Three kludges for the price of one; glibc's fts package doesn't support LFS, so fall back to nftw. Do it here, before the headers define _BSD_SOURCE and set the prefer BSD behavior, preventing us @@ -29,7 +29,7 @@ #undef _LARGE_FILES #define LARGE_FILES_ARE_ENABLED 1 #endif -#endif // 0 +#endif #include <errno.h> #include <fcntl.h> |
From: Dirk J. <do...@us...> - 2011-06-30 06:03:05
|
Update of /cvsroot/srm/srm/src In directory vz-cvs-3.sog:/tmp/cvs-serv3720/src Modified Files: tree_walker.c Log Message: fix compilation with -Wextra Index: tree_walker.c =================================================================== RCS file: /cvsroot/srm/srm/src/tree_walker.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- tree_walker.c 6 Jun 2010 17:44:03 -0000 1.29 +++ tree_walker.c 30 Jun 2011 06:03:02 -0000 1.30 @@ -47,14 +47,12 @@ #include "srm.h" #include "impl.h" -static int prompt_user(const char *string) +static int prompt_user(const char *msg, const char *arg) { char inbuf[8]; - if(!string) return 0; - - printf("%s", string); fflush(stdout); - fgets(inbuf, 4, stdin); - return strncmp(inbuf, "y", 1) == 0; + printf(msg, arg); fflush(stdout); + if(fgets(inbuf, sizeof(inbuf), stdin) == 0) return 0; + return inbuf[0]=='y' || inbuf[0]=='Y'; } static int check_perms(const char *path) @@ -84,14 +82,10 @@ static int prompt_file(const char *path, const int options) { int fd=-1, return_value=1; - size_t bufsize; - char *buf=0; struct stat statbuf; if(!path) return -1; - bufsize = strlen(path) + 80; - if (options & SRM_OPT_F) { if (options & SRM_OPT_V) @@ -105,27 +99,18 @@ return 0; } - if ( (buf = (char *)alloca(bufsize)) == NULL ) - { - errorp("Out of memory at line %d in prompt_file()", __LINE__); - return 0; - } - if ( S_ISREG(statbuf.st_mode) && ((fd = open(path, O_WRONLY)) < 0) && (errno == EACCES) ) { /* Not a symlink, not writable */ - snprintf(buf, bufsize, "Remove write protected file %s? ", path); - if ( (return_value = prompt_user(buf)) == 1 ) + return_value = prompt_user("Remove write protected file %s? (y/n) ", path); + if(return_value == 1) return_value = check_perms(path); } else { /* Writable file or symlink */ if (options & SRM_OPT_I) - { - snprintf(buf, bufsize, "Remove %s? ", path); - return_value = prompt_user(buf); - } + return_value = prompt_user("Remove %s? (y/n) ", path); } if ((options & SRM_OPT_V) && return_value) @@ -274,11 +259,14 @@ static int options; -static int ftw_process_path(const char *opath, const struct stat *statbuf, int flag, struct FTW *dummy) +static int ftw_process_path(const char *opath, const struct stat* statbuf, int flag, struct FTW* dummy) { size_t path_size; char *path; + (void)statbuf; + (void)dummy; + if(!opath) return -1; path_size = strlen(opath) + 1; |
From: SourceForge.net <no...@so...> - 2011-06-30 06:01:26
|
Bugs item #3326273, was opened at 2011-06-23 20:59 Message generated for change (Comment added) made by doj You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3326273&group_id=3297 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 3 Private: No Submitted By: Jeffrey Walton () Assigned to: Nobody/Anonymous (nobody) Summary: Make &-Wall -Wextra: warning due to ignoring fgets return Initial Comment: In tree_walk.c, the following would clear the warning: static int prompt_user(const char *string) { char inbuf[8]; if(!string) return 0; printf("%s", string); fflush(stdout); const char* s = fgets(inbuf, 4, stdin); if(!s) return 0; return strncmp(inbuf, "y", 1) == 0 || strncmp(inbuf, "Y", 1) == 0; } ---------------------------------------------------------------------- >Comment By: Dirk Jagdmann (doj) Date: 2011-06-29 23:01 Message: fixed compilation with -Wextra in the srm 1.2.12 release. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3326273&group_id=3297 |
From: Dirk J. <do...@us...> - 2011-06-30 05:46:32
|
Update of /cvsroot/srm/srm In directory vz-cvs-3.sog:/tmp/cvs-serv1574 Modified Files: NEWS configure.in Log Message: minor build update Index: NEWS =================================================================== RCS file: /cvsroot/srm/srm/NEWS,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- NEWS 25 Nov 2010 23:09:56 -0000 1.13 +++ NEWS 30 Jun 2011 05:46:30 -0000 1.14 @@ -1,6 +1,7 @@ This is a summary of user visible changes in srm. release-1_2_12 + small updates to autotools build files. release-1_2_11 Win32 command line wildcard expansion @@ -17,7 +18,6 @@ Win32 fixes release-1_2_9 - fix deletion of 0 byte files fix handling of files <4096 bytes fix handling of files >2GiB on 32bit @@ -27,70 +27,56 @@ Win32 version release-1_2_8 - Documentation updates. release-1_2_7 - Minor bugfixes. Correctly handle symlinks. Build with most recent versions of automake. release-1_2_6 - BSD variant fixes. Display verbose messages when -f and -v are both specified. release-1_2_5 - Updated README coverage. Fixed a rare deadlock. release-1_2_4 - Build on tru64 and Solaris. release-1_2_3 - None. However, a file descriptor leak is plugged. release-1_2_2 - -f now really does ignore nonexistant files. release-1_2_1 - srm will now try and chmod() files without write permission if the user answers yes at the "Remove write-protected file?" prompt or when -f is specified. Note that chmod() will fail unless you own the file, however. release-1_2_0 - Fixed .spec for rpm 4. release-1_1_0 - A massive restructuring to allow automake support (no more bad dependancies), cleaner integration of third-party modules (no more phony snprintf on Irix, a cleaner tree_walker coming soon), and an rpm distribution due to popular demand. release-1_0_0 - Use sprintf()/vsprintf() when snprintf()/vsnprintf() are absent. This allows building on Irix 3.5. release-0_9_2 - Dynamically search for /dev/urandom rather than at build time, to allow cross-compiling. Generic random module should allow use on systems without kernel entropy devices. release-0_9_1 - Misc build patches for Solaris 2.7 from Gael Roualland. release-0_9_0 - Added a new option, -s --simple, which only overwrites the file once, which is much faster than the default behavior. On BSD, check for immutable, append, and nounlink flags before @@ -99,12 +85,10 @@ building on more platforms. release-0_8_3 - Added a missing overwrite pass. (Thanks to Gael Roualland for sharp proofreading) release-0_8_2 - Fixed a bug which was truncating some error messages. Special files, and links are now renamed before removal. Fixed a bug which made it unable to remove files from filesystems other @@ -112,12 +96,10 @@ these three bugs) Added a Credits file. release-0_8_1 - Fixed a bug where some writes were cached and not sent to disk. release-0_8_0 - Use random, 14 character alphanumeric sequence to mask the file name rather than a name based on the original. Fixed some minor resource leaks which may have been apparant over @@ -125,41 +107,32 @@ added this list of changes. release-0_7_0 - Improved ext2 support, srm will not attempt to shred files which have the undeletable, immutable, or append-only attributes set. Ext2 support is always enabled on Linux now, even if the ext2 development libraries are not installed. release-0_6_0 - Improved file locking, srm now tries to lock the file before overwriting, avoiding trashing locked files. release-0_5_0 - Improved hard link handling, srm will now only overwrite files when removing the last link. release-0_4_0 - Improved error handling. Removed a bug where some recursive runs would fail. release-0_3_0 - Added a configure script and ported to BSD. release-0_2_0 - Added man page. release-0_1_1 - Fixed bug which caused srm to fail when removing files on different file systems. release-0_1_0 - First working version. - Index: configure.in =================================================================== RCS file: /cvsroot/srm/srm/configure.in,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- configure.in 30 Jun 2011 05:36:24 -0000 1.38 +++ configure.in 30 Jun 2011 05:46:30 -0000 1.39 @@ -40,7 +40,7 @@ CFLAGS="$CFLAGS -g" AC_MSG_RESULT(yes) else - CFLAGS="$CFLAGS -O2 -DNDEBUG" + CFLAGS="$CFLAGS -DNDEBUG" AC_MSG_RESULT(no) fi |
From: SourceForge.net <no...@so...> - 2011-06-30 05:44:05
|
Bugs item #3326296, was opened at 2011-06-23 21:06 Message generated for change (Comment added) made by doj You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3326296&group_id=3297 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Invalid Priority: 3 Private: No Submitted By: Jeffrey Walton () Assigned to: Nobody/Anonymous (nobody) Summary: Configure/Makefile ignores --prefix Initial Comment: $ ./configure --prefix=/bin $ make ... $ sudo make install ... $ ls -al /bin/srm ls: cannot access /bin/srm: No such file or directory ---------------------------------------------------------------------- >Comment By: Dirk Jagdmann (doj) Date: 2011-06-29 22:44 Message: The --prefix to configure works, but if you want to install into the root hierarchy you need to use ./configure --prefix=/ In your case you should find the following files: /bin/bin/srm /bin/share/man/man1/srm.1 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3326296&group_id=3297 |
From: SourceForge.net <no...@so...> - 2011-06-30 05:37:57
|
Bugs item #3326264, was opened at 2011-06-23 20:56 Message generated for change (Comment added) made by doj You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3326264&group_id=3297 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 3 Private: No Submitted By: Jeffrey Walton () Assigned to: Nobody/Anonymous (nobody) Summary: Configure/Makefile ignore CFLAGS Initial Comment: ./configure CFLAGS="-Wall -Wextra -g -O2 -DNDEBUG -m64 -mtune=core2" was ignored in the resulting makefiles. Perhaps the following would be more appropriate (from Makefile, line 174): CFLAGS += -O2 -DNDEBUG rather than: CFLAG = -O2 -DNDEBUG ---------------------------------------------------------------------- >Comment By: Dirk Jagdmann (doj) Date: 2011-06-29 22:37 Message: fixed and will work in srm 1.2.12 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103297&aid=3326264&group_id=3297 |