~ubuntu-branches/ubuntu/karmic/gnupg2/karmic-security

« back to all changes in this revision

Viewing changes to keyserver/gpg2keys_mailto.in

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2009-08-04 12:27:49 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20090804122749-q0j52zp6xmzvyall
Tags: 2.0.12-0ubuntu1
* New upstream release.
* Add 01-scd-pw2.patch, 03-opgp-writekey.patch, and 06-opgp-sign3072.patch
  from https://bugs.g10code.com/gnupg/issue1094 to make OpenPGP 2.0
  smartcards work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    open(STDIN,$ARGV[0]) || die "Can't open input file $ARGV[0]\n";
53
53
}
54
54
 
55
 
($login,$name)=(getpwuid($<))[0,6];
56
 
 
57
 
$from="$name <$login>";
58
 
 
59
55
while(<STDIN>)
60
56
{
61
57
    last if($_ eq "\n");
85
81
        {
86
82
            $verbose--;
87
83
        }
 
84
        elsif($1=~/^mail-from=(.+)$/i)
 
85
        {
 
86
            $from=$1;
 
87
        }
 
88
        elsif($1=~/^no-mail-from$/i)
 
89
        {
 
90
            undef $from;
 
91
        }
 
92
 
88
93
    }
89
94
}
90
95
 
 
96
if(!defined($from))
 
97
{
 
98
    ($login,$name)=(getpwuid($<))[0,6];
 
99
    $from="$name <$login>";
 
100
}
 
101
 
91
102
$program="(unknown)" if(!defined($program));
92
103
 
93
104
if(!defined($address))
96
107
    exit(1);
97
108
}
98
109
 
99
 
# decode $address
100
 
 
101
 
($address,$args)=split(/\?/,$address);
102
 
 
103
 
if(defined($args))
104
 
{
105
 
    @pairs = split(/&/, $args);
106
 
    foreach $pair (@pairs)
107
 
    {
108
 
        ($hdr, $val) = split(/=/, $pair);
109
 
        $hdr =~ tr/+/ /;
110
 
        $hdr =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
111
 
        $val =~ tr/+/ /;
112
 
        $val =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
113
 
# we only handle "from" right now
114
 
        if($hdr=~/^from$/i)
115
 
        {
116
 
            $from=$val;
117
 
            last;
118
 
        }
119
 
    }
120
 
}
121
 
 
122
110
while(<STDIN>)
123
111
{
124
112
    last if($_ eq "\n");