utils: use common code for apply_rules and apply_cipso
authorRafal Krypa <r.krypa@samsung.com>
Wed, 4 Dec 2013 15:58:53 +0000 (16:58 +0100)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Thu, 5 Dec 2013 18:40:21 +0000 (20:40 +0200)
commit68e38ff3936597a3189d29f57a68dae5ac08db1e
tree7af2cd9444a9ed7b011f70fb90d08567ff2a7071
parentd6f8c52011013f536b7171c2d1f3e9c5ecfaf2f9
utils: use common code for apply_rules and apply_cipso

Code for apply_rules() has been rewritten to use opendir() and readdir(),
but apply_cipso() remained implemented with nftw().
This patch implements both applying functions with opendir() and readdir()
using a common internal function apply_dir().
The resulting code is 45 lines shorter and keeps directory traversal logic
in single place.

Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
utils/common.c
utils/common.h
utils/smackcipso.c