Changeset 246

Show
Ignore:
Timestamp:
02/18/08 09:29:16 (9 months ago)
Author:
mbr
Message:

- Bugfix to ensure that encrypted directories and actually be decrypted.
- Updated to use the ".asc" extension for encrypted files in --Plain-ascii

mode.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gpgdir/trunk/gpgdir

    r241 r246  
    1111# Author: Michael Rash (mbr@cipherdyne.com) 
    1212# 
    13 # Version: 1.6 
     13# Version: 1.7 
    1414# 
    1515# Copyright (C) 2002-2007 Michael Rash (mbr@cipherdyne.org) 
     
    4444 
    4545### set the current gpgdir version and file revision numbers 
    46 my $version = '1.6'; 
     46my $version = '1.7'; 
    4747my $revision_svn = '$Revision$'; 
    4848my $rev_num = '1'; 
     
    603603            } 
    604604 
     605            if ($ascii_armor_mode) { 
     606                $encrypt_filename = "$filename.asc"; 
     607            } 
     608 
    605609            if (-e $encrypt_filename and not $overwrite_encrypted) { 
    606610                print "[-] Encrypted file $dir/$encrypt_filename already ", 
     
    657661 
    658662            ### allow filenames with spaces 
    659             my ($decrypt_filename) = ($filename =~ /^(.+)\.gpg$/); 
     663            my $decrypt_filename = ''; 
     664            if ($filename =~ /^(.+)\.gpg$/) { 
     665                $decrypt_filename = $1; 
     666            } elsif ($filename =~ /^(.+)\.asc$/) { 
     667                $decrypt_filename = $1; 
     668            } 
    660669 
    661670            if ($obfuscate_mode) { 
     
    979988    if (-e $file and not -l $file and -s $file != 0 
    980989            and $file !~ m|/\.|) { 
    981         if ($file =~ m|\.gpg| or $file =~ m|\.asc|) { 
    982             if ($encrypt_mode) { 
     990        if ($encrypt_mode) { 
     991            if ($file =~ m|\.gpg| or $file =~ m|\.asc|) { 
    983992                print "[-] Skipping encrypted file: $file\n" unless $quiet; 
    984             } else { 
     993                return; 
     994            } 
     995        } else { 
     996            unless ($file =~ m|\.gpg| or $file =~ m|\.asc|) { 
    985997                print "[-] Skipping unencrypted file: $file\n" unless $quiet; 
    986             } 
    987             return; 
    988         }  
     998                return; 
     999            } 
     1000        } 
    9891001        my ($atime, $mtime) = (stat($file))[8,9]; 
    9901002        $files{$file}{'atime'} = $atime; 
     
    11671179    -T, --Trial-run             - Show what filesystem actions would take 
    11681180                                  place without actually doing them. 
     1181    -P, --Plain-ascii           - Ascii armor mode (creates non-binary 
     1182                                  encrypted files). 
    11691183    --Interactive               - Query the user before encrypting, 
    11701184                                  decrypting, or deleting any files.