summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2010-08-03 15:26:58 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2010-08-03 15:26:58 -0400
commit30f0968b9a7f544d1afc8908888dc403be6112b8 (patch)
tree727d2950584cb69eba40aa3cd72ecaef070f2c0e
parent7b9212fa6aff55420c58f2cacd0a941762920337 (diff)
Only load seat files with a .seat extension
-rw-r--r--src/ck-manager.c10
-rw-r--r--src/ck-seat.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/ck-manager.c b/src/ck-manager.c
index cce4e0f..ae399e8 100644
--- a/src/ck-manager.c
+++ b/src/ck-manager.c
@@ -2660,10 +2660,12 @@ load_seats_from_dir (CkManager *manager)
}
while ((file = g_dir_read_name (d)) != NULL) {
- char *path;
- path = g_build_filename (CK_SEAT_DIR, file, NULL);
- add_seat_for_file (manager, path);
- g_free (path);
+ if (g_str_has_suffix (file, ".seat")) {
+ char *path;
+ path = g_build_filename (CK_SEAT_DIR, file, NULL);
+ add_seat_for_file (manager, path);
+ g_free (path);
+ }
}
g_dir_close (d);
diff --git a/src/ck-seat.c b/src/ck-seat.c
index af7db59..2e48963 100644
--- a/src/ck-seat.c
+++ b/src/ck-seat.c
@@ -770,6 +770,8 @@ ck_seat_register (CkSeat *seat)
{
GError *error = NULL;
+ g_return_val_if_fail (CK_IS_SEAT (seat), FALSE);
+
error = NULL;
seat->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (seat->priv->connection == NULL) {