]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools: cgconfig/cgrulesengd - skip parsing non .conf files
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Thu, 13 Jul 2023 07:44:41 +0000 (07:44 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 17 Jul 2023 17:19:32 +0000 (11:19 -0600)
commitcdc44db7191bc045945f451cd7c33eb6095c4f5b
tree55618492da98fa15b344200433c8bb77283b2792
parent487b23439e681a764e8ec6f45b89e7847f3832f4
tools: cgconfig/cgrulesengd - skip parsing non .conf files

Currently, the list of files to be parsed is constructed by reading the
directories passed with '-L' command line option or by cgrulesend from
'/etc/cgconfig.d'.  The directories might also host non-configuration
files, parsing them will result in failure.

Consider the following example:

 # ls /etc/cgconfig.d
 cgconfig-oradb.conf  cgconfig-oradb.conf.rpmsave test .conf e

 # /usr/sbin/cgconfigparser -l /etc/cgconfig.conf -L /etc/cgconfig.d -s 1664
 /usr/sbin/cgconfigparser; error loading /etc/cgconfig.d/cgconfig-oradb.conf.rpmsave:
 Cgroup, the requested group parameter does not exist

fix it by skipping files with non .conf extensions, while building the
list of files to be parsed for cgroup configurations.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/tools-common.c