Message ID | ed6d04a8d0fe2ccc3751422e3364acede8869483.1375952089.git.ydroneaud@opteya.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
diff --git a/src/init.c b/src/init.c index ce9e1c0..e67469e 100644 --- a/src/init.c +++ b/src/init.c @@ -309,6 +309,9 @@ static void read_config(void) if (dent->d_name[0] == '.') continue; + if (dent->d_name[0] == '\0' || dent->d_name[strlen(dent->d_name) - 1] == '~') + continue; + if (asprintf(&path, "%s/%s", IBV_CONFIG_DIR, dent->d_name) < 0) { fprintf(stderr, PFX "Warning: couldn't read config file %s/%s.\n", IBV_CONFIG_DIR, dent->d_name);
Files ending with a tilde '~' are likely backup files so they should not be considered as valid configuration files. This patch makes read_config() skip backup files in order to protect libibverbs from using hand modified configuration files. Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> --- src/init.c | 3 +++ 1 file changed, 3 insertions(+)