summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-06-26 11:14:08 +0200
committerThomas Haller <thaller@redhat.com>2018-06-26 11:15:17 +0200
commita0ca6f506f6a2ecfde9e49e7d9239b26327b5d8a (patch)
treea346f8b5e3a3d0cf10723dc337058cbfbf9d54dd
parent631daec1badd045e34b0f6c3159ea7ca4da4e546 (diff)
downloadnetwork-manager-applet-th/c-e-relabel.tar.gz
c-e: change static string array "certcon" to #define of string literalth/c-e-relabel
We usually don't use static string arrays to represent (what essentially are) string literals. Also, it's constant and thus should be upper-case.
-rw-r--r--src/connection-editor/nm-connection-editor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index b40a45c7..60472e7a 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -183,7 +183,7 @@ update_sensitivity (NMConnectionEditor *editor)
#if WITH_SELINUX
/* This is what the files in ~/.cert would get. */
-static const char certcon[] = "unconfined_u:object_r:home_cert_t:s0";
+#define CERTCON "unconfined_u:object_r:home_cert_t:s0"
static void
update_relabel_list_filename (GtkListStore *relabel_list, char *filename)
@@ -213,7 +213,7 @@ update_relabel_list_filename (GtkListStore *relabel_list, char *filename)
return;
}
- if (g_strcmp0 (certcon, tcon) == 0)
+ if (g_strcmp0 (CERTCON, tcon) == 0)
return;
writable = (access (filename, W_OK) == 0);
@@ -304,7 +304,7 @@ relabel_button_clicked_cb (GtkWidget *widget, gpointer user_data)
2, &filename,
-1);
if (relabel) {
- if (setfilecon (filename, certcon) == -1) {
+ if (setfilecon (filename, CERTCON) == -1) {
int errsv = errno;
g_warning ("setfilecon: failed for \"%s\" with %s\n", filename, g_strerror (errsv));