PacketFence - BTS - PacketFence
View Issue Details
0001493PacketFenceerror-handlingpublic2012-07-22 04:252012-10-19 10:18
Moshe_Levi 
 
lowminoralways
resolvedfixed 
3.4.1 
3.6.0devel 
f451796f7b61f01e150e4c3c68acd389efb41d37
0001493: pfcmd_vlan return code always success even on error
I 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
No tags attached.
patch pfcmd_vlan.patch (1,760) 2012-08-07 03:37
https://www.packetfence.org/bugs/file_download.php?file_id=150&type=bug
patch pfcmd_vlan-deauth-exit-code-fix-1493-v2.patch (10,110) 2012-08-08 10:56
https://www.packetfence.org/bugs/file_download.php?file_id=152&type=bug
Issue History
2012-07-22 04:25Moshe_LeviNew Issue
2012-08-06 16:46obilodeauNote Added: 0002888
2012-08-06 16:47obilodeauAssigned To => obilodeau
2012-08-06 16:47obilodeauPrioritynormal => low
2012-08-06 16:47obilodeauStatusnew => confirmed
2012-08-06 16:47obilodeauTarget Version => +2
2012-08-07 03:37Moshe_LeviFile Added: pfcmd_vlan.patch
2012-08-07 03:40Moshe_LeviNote Added: 0002890
2012-08-07 14:09obilodeauNote Added: 0002904
2012-08-07 14:26obilodeauNote Added: 0002905
2012-08-07 14:39obilodeauNote Added: 0002906
2012-08-07 14:40obilodeauFile Added: pfcmd_vlan-deauth-exit-code-fix-1493.patch
2012-08-07 14:40obilodeauStatusconfirmed => assigned
2012-08-07 14:41obilodeauNote Edited: 0002906
2012-08-08 03:29Moshe_LeviNote Added: 0002916
2012-08-08 10:56obilodeauFile Added: pfcmd_vlan-deauth-exit-code-fix-1493-v2.patch
2012-08-08 10:56obilodeauFile Deleted: pfcmd_vlan-deauth-exit-code-fix-1493.patch
2012-08-08 10:57obilodeauNote Added: 0002921
2012-08-08 10:59obilodeauNote Edited: 0002921
2012-10-04 16:05fgaudreaultgit revision => f451796f7b61f01e150e4c3c68acd389efb41d37
2012-10-04 16:05fgaudreaultNote Added: 0003114
2012-10-04 16:05fgaudreaultStatusassigned => resolved
2012-10-04 16:05fgaudreaultResolutionopen => fixed
2012-10-19 10:18fgaudreaultAssigned Toobilodeau =>
2012-10-19 10:18fgaudreaultFixed in Version => devel
2012-10-19 10:18fgaudreaultTarget Version+2 => 3.6.0

Notes
(0002888)
obilodeau   
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   
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   
2012-08-07 14:09   
the patch doesn't separate arguments to pod2usage with a comma
(0002905)
obilodeau   
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   
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   
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   
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   
2012-10-04 16:05   
Merged in Devel.