From c1dd530798301be08197a390516a44c423bfc029 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 1 Jun 2011 13:26:25 -0500 Subject: [PATCH] keyfile: ignore .pem and .der file changes Since the keyfile plugin only stores the paths of these files, we don't really care about what's in them. We also don't want to attempt to read them as keyfiles, which produces warnings in the logs. --- src/settings/plugins/keyfile/common.h | 3 --- src/settings/plugins/keyfile/utils.c | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/settings/plugins/keyfile/common.h b/src/settings/plugins/keyfile/common.h index 6c8f9cebb8..7d94a7053e 100644 --- a/src/settings/plugins/keyfile/common.h +++ b/src/settings/plugins/keyfile/common.h @@ -23,9 +23,6 @@ #include -#define SWP_TAG ".swp" -#define SWPX_TAG ".swpx" - #define KEYFILE_PLUGIN_NAME "keyfile" #define KEYFILE_PLUGIN_INFO "(c) 2007 - 2010 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." diff --git a/src/settings/plugins/keyfile/utils.c b/src/settings/plugins/keyfile/utils.c index 7b93a245d5..f353117221 100644 --- a/src/settings/plugins/keyfile/utils.c +++ b/src/settings/plugins/keyfile/utils.c @@ -74,6 +74,11 @@ check_suffix (const char *base, const char *tag) return FALSE; } +#define SWP_TAG ".swp" +#define SWPX_TAG ".swpx" +#define PEM_TAG ".pem" +#define DER_TAG ".der" + gboolean nm_keyfile_plugin_utils_should_ignore_file (const char *filename) { @@ -88,6 +93,8 @@ nm_keyfile_plugin_utils_should_ignore_file (const char *filename) /* Ignore files with certain patterns */ if ( (check_prefix (base, ".") && check_suffix (base, SWP_TAG)) /* vim temporary files: .filename.swp */ || (check_prefix (base, ".") && check_suffix (base, SWPX_TAG)) /* vim temporary files: .filename.swpx */ + || check_suffix (base, PEM_TAG) /* 802.1x certificates and keys */ + || check_suffix (base, DER_TAG) /* 802.1x certificates and keys */ || check_mkstemp_suffix (base) /* temporary files created by mkstemp() */ || base[strlen (base) - 1] == '~') ignore = TRUE;