Factor out capability parsing logic
Factor out capability parsing logic

Currently, setup_caps and dropcaps_except both use the same parsing
logic for parsing capabilities (try to identify by name, but allow
numerical specification). Since this is a common routine, separate it
out to improve maintainability and reuseability.

Signed-off-by: Christian Seiler <2314b2e3a4a1f7db165be2aafbf1efd78f28cc97@iwakd.de>
Signed-off-by: Serge Hallyn <3df611b026e4639bee8aef7a4beb2e39fcebb313@ubuntu.com>

JohnPeacockMessageSystems/lxc,christiaan/lxc,ysbnim/lxc,QingweiPeterLan/cs188-lxc,DarknessBeforeDawn/lxc,Pelagicore/lxc,efiop/lxc,Distrotech/lxc,christiaan/lxc,LynxChaus/lxc,regit/lxc,akshaykarle/lxc,federicobriata/lxc,szaszg/lxc,aeris/lxc,weizhenwei/lxc,cjwatson/lxc,bostjan/lxc,lisongmin/lxc,caglar10ur/lxc,armcc/lxc,ss1h2a3tw/lxc,virajs/lxc,bmoar/lxc,rldleblanc/lxc,lazy404/lxc,rldleblanc/lxc,major/lxc,virajs/lxc,aeris/lxc,raspberrypython/lxc,thmo/lxc,szaszg/lxc,lisongmin/lxc,raspberrypython/lxc,codebauss/lxc,rowhit/lxc,ioops/lxc,ysbnim/lxc,ksperis/lxc,virajs/lxc,caglar10ur/lxc,cjwatson/lxc,Ponce/lxc,hkjolhede/lxc,efiop/lxc,aeris/lxc,yubo/lxc,LynxChaus/lxc,regit/lxc,tych0/lxc,hkjolhede/lxc,codebauss/lxc,akshaykarle/lxc,armcc/lxc,yubo/lxc,QingweiPeterLan/cs188-lxc,fwilson42/lxc,hallyn/lxc,szaszg/lxc,hallyn/lxc,yubo/lxc,armcc/lxc,ecarrara/lxc,jirislaby/lxc,thmo/lxc,christiaan/lxc,ss1h2a3tw/lxc,bmoar/lxc,federicobriata/lxc,cjwatson/lxc,DarknessBeforeDawn/lxc,ioops/lxc,sapun/lxc,hallyn/lxc,codebauss/lxc,hkjolhede/lxc,fwilson42/lxc,akshaykarle/lxc,hfuCN/lxc,weizhenwei/lxc,GreatFruitOmsk/lxc,jirislaby/lxc,ss1h2a3tw/lxc,rldleblanc/lxc,Ponce/lxc,tych0/lxc,major/lxc,Pelagicore/lxc,caglar10ur/lxc,weizhenwei/lxc,ioops/lxc,major/lxc,ecarrara/lxc,QingweiPeterLan/cs188-lxc,Distrotech/lxc,hfuCN/lxc,lazy404/lxc,efiop/lxc,LynxChaus/lxc,Pelagicore/lxc,lisongmin/lxc,regit/lxc,thmo/lxc,rowhit/lxc,GreatFruitOmsk/lxc,jirislaby/lxc,JohnPeacockMessageSystems/lxc,hfuCN/lxc,sapun/lxc,bostjan/lxc,lazy404/lxc,fwilson42/lxc,terceiro/lxc,sapun/lxc,ecarrara/lxc,ysbnim/lxc,federicobriata/lxc,rowhit/lxc,DarknessBeforeDawn/lxc,ksperis/lxc,raspberrypython/lxc,bmoar/lxc,bostjan/lxc,terceiro/lxc,Ponce/lxc,Distrotech/lxc,terceiro/lxc,ksperis/lxc,GreatFruitOmsk/lxc,JohnPeacockMessageSystems/lxc,tych0/lxc