diff options
author | Ermal LUÇI <eri@pfsense.org> | 2014-11-24 21:54:00 +0100 |
---|---|---|
committer | Ermal LUÇI <eri@pfsense.org> | 2014-11-24 21:54:00 +0100 |
commit | f07008f559059d5f3da9bc702d19a9c8aa7c18f7 (patch) | |
tree | 042b88392cf3331acbc8461c9a4b4c12274194c7 /usr/local/www/diag_ipsec_sad.php | |
parent | ec5753e7563c31e843a503d17f78487a2d156c78 (diff) | |
download | pfsense-f07008f559059d5f3da9bc702d19a9c8aa7c18f7.zip pfsense-f07008f559059d5f3da9bc702d19a9c8aa7c18f7.tar.gz |
Fixes #4037
Revert "Do not let the user mess with SAs from this page. The daemon and primary status page handles tat"
This reverts commit bb55330aca91eb556df4ab7a21fe42d1d7899f8e.
Diffstat (limited to 'usr/local/www/diag_ipsec_sad.php')
-rw-r--r-- | usr/local/www/diag_ipsec_sad.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/usr/local/www/diag_ipsec_sad.php b/usr/local/www/diag_ipsec_sad.php index 77a72fc..2628f64 100644 --- a/usr/local/www/diag_ipsec_sad.php +++ b/usr/local/www/diag_ipsec_sad.php @@ -53,6 +53,16 @@ include("head.inc"); $sad = ipsec_dump_sad(); +/* delete any SA? */ +if ($_GET['act'] == "del") { + $fd = @popen("/sbin/setkey -c > /dev/null 2>&1", "w"); + if ($fd) { + fwrite($fd, "delete {$_GET['src']} {$_GET['dst']} {$_GET['proto']} {$_GET['spi']} ;\n"); + pclose($fd); + sleep(1); + } +} + ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> @@ -96,6 +106,15 @@ $sad = ipsec_dump_sad(); <td class="listr"><?=htmlspecialchars($sa['aalgo']);?></td> <td class="listr"><?=htmlspecialchars($sa['data']);?></td> <td class="list nowrap"> + <?php + $args = "src=" . rawurlencode($sa['src']); + $args .= "&dst=" . rawurlencode($sa['dst']); + $args .= "&proto=" . rawurlencode($sa['proto']); + $args .= "&spi=" . rawurlencode("0x" . $sa['spi']); + ?> + <a href="diag_ipsec_sad.php?act=del&<?=$args;?>" onclick="return confirm('<?=gettext("Do you really want to delete this security association?"); ?>')"> + <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /> + </a> </td> </tr> <?php endforeach; ?> |