[libdazzle] file-transfer: add some runtime warnings
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] file-transfer: add some runtime warnings
- Date: Sun, 3 Dec 2017 12:04:07 +0000 (UTC)
commit e3f03a8d0e03f9ee20719d1827ac621bf17e9d86
Author: Christian Hergert <chergert redhat com>
Date: Sun Dec 3 04:01:33 2017 -0800
file-transfer: add some runtime warnings
src/files/dzl-file-transfer.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/files/dzl-file-transfer.c b/src/files/dzl-file-transfer.c
index fb5c1df..1c67ee8 100644
--- a/src/files/dzl-file-transfer.c
+++ b/src/files/dzl-file-transfer.c
@@ -201,6 +201,18 @@ dzl_file_transfer_add (DzlFileTransfer *self,
DZL_EXIT;
}
+ if (g_file_equal (src, dst))
+ {
+ g_warning ("Source and destination cannot be the same");
+ DZL_EXIT;
+ }
+
+ if (g_file_has_prefix (dst, src))
+ {
+ g_warning ("Destination cannot be within source");
+ DZL_EXIT;
+ }
+
oper = g_slice_new0 (Oper);
oper->src = g_object_ref (src);
oper->dst = g_object_ref (dst);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]