Bug 110320 - [security/vpnc] rc script returns 0 on failure
Summary: [security/vpnc] rc script returns 0 on failure
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-15 07:20 UTC by Dominic Fandrey
Modified: 2007-09-23 13:48 UTC (History)
0 users

See Also:


Attachments
file.diff (505 bytes, patch)
2007-03-15 07:20 UTC, Dominic Fandrey
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Fandrey 2007-03-15 07:20:04 UTC
In managed mode the script does not return the proper value

		# Start vpnc.
		if ! $command $current $vpnc_flags; then
			status=$?
			echo "Running 'vpnc $current $vpnc_flags' failed."
			return $status
		fi

$? is already unset by the if command and thus always 0, so that the script returns 0 instead of the return status of the failed vpnc call.

How-To-Repeat: You can start the script with a broken configuration (i.e. wrong password) in managed mode (don't use default config file).
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-03-15 07:20:11 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Dominic Fandrey 2007-03-16 08:52:48 UTC
I forgot to write: the "--local-port 0" is also necessary,
because vpnc doesn't automatically use a different port (any more),
when port 500 is already in use.

This causes all but the first instance of vpnc to fail.
Comment 3 Rong-En Fan freebsd_committer freebsd_triage 2007-09-23 13:47:58 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!