Please find attached a debdiff implementing this.
Thank you.
diff -Nru vpnc-0.4.0/debian/changelog vpnc-0.4.0/debian/changelog
--- vpnc-0.4.0/debian/changelog 2007-03-11 21:51:08.000000000 +0100
+++ vpnc-0.4.0/debian/changelog 2007-03-11 21:51:09.000000000 +0100
@@ -1,3 +1,9 @@
+vpnc (0.4.0-2) unstable; urgency=low
+
+ * Exit with return code 2 when authentication fails.
+
+ -- Luca Falavigna <[EMAIL PROTECTED]> Sun, 11 Mar 2007 21:49:25 +0100
+
vpnc (0.4.0-1) unstable; urgency=low
* New upstream release
diff -Nru vpnc-0.4.0/debian/patches/00list vpnc-0.4.0/debian/patches/00list
--- vpnc-0.4.0/debian/patches/00list 2007-03-11 21:51:08.000000000 +0100
+++ vpnc-0.4.0/debian/patches/00list 2007-03-11 21:51:09.000000000 +0100
@@ -2,3 +2,4 @@
04_debianitis
05_vpnc.conf
#08_keepalive_and_rekeying
+09_auth_failed_return_code
diff -Nru vpnc-0.4.0/debian/patches/09_auth_failed_return_code.dpatch
vpnc-0.4.0/debian/patches/09_auth_failed_return_code.dpatch
--- vpnc-0.4.0/debian/patches/09_auth_failed_return_code.dpatch 1970-01-01
01:00:00.000000000 +0100
+++ vpnc-0.4.0/debian/patches/09_auth_failed_return_code.dpatch 2007-03-11
21:51:09.000000000 +0100
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## debian/patches/11_auth_failed_return_code.dpatch by Soren Hansen <[EMAIL
PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
[EMAIL PROTECTED]@
+diff -u vpnc-0.3.3+SVN20051028/vpnc.c vpnc-0.3.3+SVN20051028/vpnc.c
+--- vpnc-0.3.3+SVN20051028/vpnc.c
++++ vpnc-0.3.3+SVN20051028/vpnc.c
+@@ -1078,7 +1078,7 @@
+ expected_hash = gcry_md_read(hm, 0);
+
+ if (memcmp(expected_hash, hash->u.hash.data, s->md_len)
!= 0) {
+- error(1, 0, "hash comparison failed:
%s(%d)\ncheck group password!",
++ error(2, 0, "hash comparison failed:
%s(%d)\ncheck group password!",
+
val_to_string(ISAKMP_N_AUTHENTICATION_FAILED, isakmp_notify_enum_array),
+ ISAKMP_N_AUTHENTICATION_FAILED);
+ }