use File::Find;
use File::Copy;
+use Fcntl qw/:mode/;
use IO::File;
use IO::Handle;
use Getopt::Long;
### skip all links, zero size files, all hidden
### files (includes the .gnupg directory), etc.
- return if -d $file;
-
unless ($force_mode) {
if ($file =~ m|/\.|) {
print "[-] Skipping file: $file\n"
}
}
+ if (-d $file) {
+ ### skip all directories but only after we have verified
+ ### whether they are writable
+ unless ((stat($file))[2] & S_IWUSR) {
+ die "[*] Directory: '$file' is not writable by the current user.";
+ }
+ return;
+ }
+
if (-e $file and not -l $file and -s $file != 0
and $file !~ m|\.gpgdir\.pid| and $file !~ m|\.gnupg|) {
if ($encrypt_mode or $signing_mode) {