PacketFence
Bug Tracking System

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001493PacketFenceerror-handlingpublic2012-07-22 04:252012-10-19 10:18
ReporterMoshe_Levi 
Assigned To 
PrioritylowSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.4.1 
Target Version3.6.0Fixed in Versiondevel 
Summary0001493: pfcmd_vlan return code always success even on error
DescriptionI using pfcmd_vlan to do deauthenticateDot1x command.
even the mac is not exist in the AP the exit code of pfcmd_vlan is 0.

It is because the is no check in the $switch->deauthenticateMac($mac, 1); ( line 506.
I think you should add the correct exit code to all pfcmd_vlan commands
TagsNo tags attached.
fixed in git revisionf451796f7b61f01e150e4c3c68acd389efb41d37
fixed in mtn revision
Attached Filespatch file icon pfcmd_vlan.patch [^] (1,760 bytes) 2012-08-07 03:37 [Show Content]
patch file icon pfcmd_vlan-deauth-exit-code-fix-1493-v2.patch [^] (10,110 bytes) 2012-08-08 10:56 [Show Content]

- Relationships

-  Notes
(0002888)
obilodeau (reporter)
2012-08-06 16:46

Unfortunately, no care was given to pfcmd_vlan's exit codes during it's development... nor to much of the pf::SNMP subsystem for that matter..

Unfortunately this also isn't a priority but patches are accepted and would be quickly merged if we don't see adverse effects on other callers.
(0002890)
Moshe_Levi (reporter)
2012-08-07 03:40

I add a patch to fix the exit codes for the deauthenticateDot1x operation.
we are using this command in freeradius and need the return code.
I would appreciate if you can merge it to packetfence.
(0002904)
obilodeau (reporter)
2012-08-07 14:09

the patch doesn't separate arguments to pod2usage with a comma
(0002905)
obilodeau (reporter)
2012-08-07 14:26

Also the != $TRUE forces numeric context and I think it would issue a warning if undef was returned instead of 0 ($FALSE).
(0002906)
obilodeau (reporter)
2012-08-07 14:39
edited on: 2012-08-07 14:41

I created the following branch with an updated version of the fix: https://github.com/inverse-inc/packetfence/tree/fix/1493-pfcmd_vlan-deauth-exit-code-fix [^]

Here's a copy of a warning I added in the code and in the commit message:

    Warning: several (if not all) implementations of deauthenticateMac are
    *not* trying to have coherent return codes. An extensive review was *not*
    performed. Please test before relying on that behavior.
    
    Patches to fix relevant implementations will be merged in priority and
    should be contributed back.


I attached a patch to the ticket also. Please confirm that it works for your environment w/o problems and then I'll merge it for our next release.

(0002916)
Moshe_Levi (reporter)
2012-08-08 03:29

you are missing ; in line 155 (my $result = $switch->deauthenticateMac($mac, $TRUE)) in the patch. other then that it is works for me.

thank you.
(0002921)
obilodeau (reporter)
2012-08-08 10:57
edited on: 2012-08-08 10:59

Updated the patch and the github branch. Opening pull request to include fix in next release.

(0003114)
fgaudreault (viewer)
2012-10-04 16:05

Merged in Devel.

- Issue History
Date Modified Username Field Change
2012-07-22 04:25 Moshe_Levi New Issue
2012-08-06 16:46 obilodeau Note Added: 0002888
2012-08-06 16:47 obilodeau Assigned To => obilodeau
2012-08-06 16:47 obilodeau Priority normal => low
2012-08-06 16:47 obilodeau Status new => confirmed
2012-08-06 16:47 obilodeau Target Version => +2
2012-08-07 03:37 Moshe_Levi File Added: pfcmd_vlan.patch
2012-08-07 03:40 Moshe_Levi Note Added: 0002890
2012-08-07 14:09 obilodeau Note Added: 0002904
2012-08-07 14:26 obilodeau Note Added: 0002905
2012-08-07 14:39 obilodeau Note Added: 0002906
2012-08-07 14:40 obilodeau File Added: pfcmd_vlan-deauth-exit-code-fix-1493.patch
2012-08-07 14:40 obilodeau Status confirmed => assigned
2012-08-07 14:41 obilodeau Note Edited: 0002906
2012-08-08 03:29 Moshe_Levi Note Added: 0002916
2012-08-08 10:56 obilodeau File Added: pfcmd_vlan-deauth-exit-code-fix-1493-v2.patch
2012-08-08 10:56 obilodeau File Deleted: pfcmd_vlan-deauth-exit-code-fix-1493.patch
2012-08-08 10:57 obilodeau Note Added: 0002921
2012-08-08 10:59 obilodeau Note Edited: 0002921
2012-10-04 16:05 fgaudreault git revision => f451796f7b61f01e150e4c3c68acd389efb41d37
2012-10-04 16:05 fgaudreault Note Added: 0003114
2012-10-04 16:05 fgaudreault Status assigned => resolved
2012-10-04 16:05 fgaudreault Resolution open => fixed
2012-10-19 10:18 fgaudreault Assigned To obilodeau =>
2012-10-19 10:18 fgaudreault Fixed in Version => devel
2012-10-19 10:18 fgaudreault Target Version +2 => 3.6.0


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker