On 1/4/08, Jon <[EMAIL PROTECTED]> wrote:
> rm -P wont work... I looking to clean up deleted data ... not securely
> delete a file.

i was curious how they do this, but it's nothing fancier than creating
a big file and filling it up.  i notice that they are using the magic
guttman incantation.  i am inherently distrusting of anyone who does,
because it means they didn't really pay attention.  nobody uses MFM or
RLL disks.

i was also curious how they claimed to clear inodes.  so i looked at
the code, and technique is pretty weak.  and the code is a complete
clusterfuck.  regardless of whether it (mostly) works or not, i firmly
believe that such juvenile code should not be allowed near any secure
data.

void sdel_wipe_inodes(char *loc, char **array) {
    char *template = malloc(strlen(loc) + 16);
    int i = 0;
    int fail = 0;
    int fd;

    if (verbose)
        printf("Wiping inodes ...");

    array = malloc(MAXINODEWIPE * sizeof(template));
    strcpy(template, loc);
    if (loc[strlen(loc) - 1] != '/')
        strcat(template, "/");
    strcat(template, "xxxxxxxx.xxx");

    while(i < MAXINODEWIPE && fail < 5) {
        __sdel_random_filename(template);
        if (open(template, O_CREAT | O_EXCL | O_WRONLY, 0600) < 0)
            fail++;
        else {
            array[i] = malloc(strlen(template));
            strcpy(array[i], template);
            i++;
        }
    }
    FLUSH;

    if (fail < 5) {
        fprintf(stderr, "Warning: could not wipe all inodes!\n");
    }

    array[i] = NULL;
    fd = 0;
    while(fd < i) {
        unlink(array[fd]);
        free(array[fd]);
        fd++;
    }
    free(array);
    array = NULL;
    FLUSH;
    if (verbose)
        printf(" Done ... ");
}

Reply via email to