PacketFence - BTS - PacketFence
View Issue Details
0001210PacketFenceerror-handlingpublic2011-04-21 08:422014-04-24 11:58
jamest 
 
normalminoralways
confirmedopen 
2.1.0 
3.6.1 
0001210: Can't add/edit person with pfcmd if firstname or lastname have spaces in them
If you try and add a person with pfcmd person add pid and have an assignment of firstname or surname with the add, this will fail with grammar test failed if the name has a space in it. The same thing happens with edit.
There's nothing I could see in the admin guide saying that names with spaces in are invalid, they can be added directly into the database with no apparent ill effect.
I would suggest that either pfcmd is fixed to allow these names (as people do have them in real life), or the restriction is documented and pfcmd gives a more meaningful error message.
Some example output:
./pfcmd person add test5 firstname="space in the middle"
Command not understood. (pfcmd grammar test failed at line 223.)
Usage: pfcmd person <add|view|edit|delete> pid [assignments]

manipulate person entries

examples:
  pfcmd person view all
  pfcmd person add bjenkins notes="Bob Jenkins"
  pfcmd person delete bjenkins

./pfcmd person add test5 surname="space in the middle"
Command not understood. (pfcmd grammar test failed at line 223.)
Usage: pfcmd person <add|view|edit|delete> pid [assignments]

manipulate person entries

examples:
  pfcmd person view all
  pfcmd person add bjenkins notes="Bob Jenkins"
  pfcmd person delete bjenkins

./pfcmd person add test5 firstname="underscore_in_the_middle"
No tags attached.
Issue History
2011-04-21 08:42jamestNew Issue
2012-08-31 10:32obilodeauStatusnew => assigned
2012-08-31 10:32obilodeauAssigned To => obilodeau
2012-08-31 10:34obilodeauNote Added: 0003000
2012-08-31 10:48obilodeauNote Added: 0003002
2012-08-31 10:58obilodeauNote Added: 0003003
2012-08-31 15:13obilodeauNote Added: 0003007
2012-10-19 13:48fgaudreaultAssigned Toobilodeau =>
2012-10-19 13:48fgaudreaultTarget Version => investigate
2012-10-19 13:48fgaudreaultNote Added: 0003175
2012-10-24 10:04fgaudreaultNote Added: 0003237
2012-10-24 10:04fgaudreaultStatusassigned => confirmed
2012-10-24 10:04fgaudreaultTarget Versioninvestigate => 3.6.1

Notes
(0003000)
obilodeau   
2012-08-31 10:34   
This should be fixed now. I'll try to reproduce later in the lab and let you know.
(0003002)
obilodeau   
2012-08-31 10:48   
In stable this isn't fixed now but 0001523 should fix it. Let me check that.
(0003003)
obilodeau   
2012-08-31 10:58   
No it's not :(
(0003007)
obilodeau   
2012-08-31 15:13   
Debugging the parser, I don't really understand what's going on here..

I was able to make it work with:
pfcmd 'person add bjenkins notes="Bob Jenkins"'

I'll have to compare the parser debug results but this implies that it works from the Web Admin since it always single quotes all arguments together.
(0003175)
fgaudreault   
2012-10-19 13:48   
Need to see if it's fixed or not.
(0003237)
fgaudreault   
2012-10-24 10:04   
Still an issue. Tested on 3.6.0-devel.

[root@pf-3-centos6 pf]# ./bin/pfcmd person add test5 firstname="space in the middle"
Command not understood. (pfcmd grammar test failed at line 210.)
Usage: pfcmd person <add|view|edit|delete> pid [assignments]