+ my $mailcontentselect = '<select name="mailcontentinspection">'
+ . '<option value="blackhole"'
+ . ($data{mailcontentinspectionaction} eq 'blackhole' ? ' selected' : '')
+ . '>blackhole'
+ . '<option value="markup"'
+ . ($data{mailcontentinspectionaction} eq 'markup' ? ' selected' : '')
+ . '>markup'
+ . '<option value="reject"'
+ . ($data{mailcontentinspectionaction} eq 'reject' ? ' selected' : '')
+ . '>reject';
+
+ my $confirmstring = '';
+ my $sudopassword = '';
+ for my $e(@{$entry->{'sudopassword'}}) {
+ my ($uuid, $status, $hosts, $crypted) = ($e =~ /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) (confirmed:[0-9a-f]{40}|unconfirmed) ([a-z0-9.,*]+) ([^ ]+)$/);
+ unless (defined $uuid) {
+ $sudopassword .= "<tr><td>Unparseable line!</td></tr>\n";
+ next;
+ }
+ if ($status =~ /^confirmed:/) {
+ my $data = join(':', 'password-is-confirmed', 'sudo', $data{'uid'}, $uuid, $hosts, $crypted);
+ my $hmac = hmac_sha1_hex( $data, $hmac_key);
+ if ($status eq "confirmed:$hmac") {
+ $status = 'confirmed';
+ } else {
+ $status = 'INVALID';
+ }
+ }
+ my $e = "<tr><td>".CGI::escapeHTML($hosts)."</td>
+ <td>".CGI::escapeHTML($status)."</td>
+ <td><small>not shown</small></td>
+ <!--<td><small><code>".CGI::escapeHTML($uuid)."</code></small></td>-->
+ <td><input name=\"sudopassword-delete-".CGI::escapeHTML($uuid)."\" type=\"checkbox\" value=\"delete\"> (delete)</td></tr>\n";
+ $sudopassword .= $e;
+ if ($status eq 'unconfirmed') {
+ my $data = join(':', 'confirm-new-password', 'sudo', $data{'uid'}, $uuid, $hosts, $crypted);
+ my $hmac = hmac_sha1_hex( $data, $hmac_key);
+ $confirmstring .= CGI::escapeHTML("confirm sudopassword $uuid $hosts $hmac\n");
+ }
+ };
+ if ($confirmstring ne '') {
+ $confirmstring = "<br>To confirm your new sudo passwords send signed mail to changes\@db.debian.org with a signed body containing these lines:<br><pre>$confirmstring</pre>";
+ }
+
+ my $sudopasswordhosts = '<select name="newsudopass-host"> <option value="*">ALL';
+ for my $dn (sort {$host_entries->{$a}->{host}->[0] cmp $host_entries->{$b}->{host}->[0]} keys(%$host_entries)) {
+ my $data = $host_entries->{$dn};
+ my $host = $data->{'host'}->[0];
+ my $hostname = $data->{'hostname'}->[0];
+ $sudopasswordhosts .= "<option value=\"$hostname\">$host\n";
+ };
+ $sudopasswordhosts .= '</select>';