[gnome-commander] Secured usage of connection URIs in gnome commander, finally fixing bgo#653573
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Secured usage of connection URIs in gnome commander, finally fixing bgo#653573
- Date: Wed, 13 May 2015 20:11:39 +0000 (UTC)
commit 91fdb72784c01cba121996f601806c1f385248e9
Author: Uwe Scholz <uwescholz src gnome org>
Date: Wed May 13 22:10:41 2015 +0200
Secured usage of connection URIs in gnome commander, finally fixing bgo#653573
plugins/fileroller/file-roller-plugin.cc | 6 +++---
src/dialogs/gnome-cmd-file-props-dialog.cc | 2 +-
src/dialogs/gnome-cmd-mkdir-dialog.cc | 4 ++--
src/dirlist.cc | 2 +-
src/gnome-cmd-con-device.cc | 2 +-
src/gnome-cmd-con-remote.cc | 2 +-
src/gnome-cmd-con-smb.cc | 2 +-
src/gnome-cmd-dir.cc | 14 +++++++-------
src/gnome-cmd-file-selector.cc | 4 ++--
src/gnome-cmd-file.h | 4 ++--
src/gnome-cmd-plain-path.cc | 2 +-
src/gnome-cmd-smb-path.cc | 2 +-
src/gnome-cmd-user-actions.cc | 2 +-
src/gnome-cmd-xfer.cc | 6 +++---
src/utils.cc | 2 +-
15 files changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/plugins/fileroller/file-roller-plugin.cc b/plugins/fileroller/file-roller-plugin.cc
index 5efc7a1..9e15a52 100644
--- a/plugins/fileroller/file-roller-plugin.cc
+++ b/plugins/fileroller/file-roller-plugin.cc
@@ -92,7 +92,7 @@ static GnomeCmdPluginClass *parent_class = NULL;
static void on_extract_cwd (GtkMenuItem *item, GnomeVFSURI *uri)
{
gchar *target_arg, *archive_arg;
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
gchar *local_path = gnome_vfs_get_local_path_from_uri (uri_str);
gchar *target_name = (gchar *) g_object_get_data (G_OBJECT (item), "target_name");
gchar *target_dir = (gchar *) g_object_get_data (G_OBJECT (item), "target_dir");
@@ -143,7 +143,7 @@ inline void do_add_to_archive (const gchar *name, GnomeCmdState *state)
for (files = state->active_dir_selected_files; files; files = files->next)
{
GnomeVFSURI *uri = GNOME_CMD_FILE_INFO (files->data)->uri;
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
gchar *path = gnome_vfs_get_local_path_from_uri (uri_str);
gchar *tmp = cmd;
gchar *arg = g_shell_quote (path);
@@ -155,7 +155,7 @@ inline void do_add_to_archive (const gchar *name, GnomeCmdState *state)
}
g_printerr ("add: %s\n", cmd);
- uri_str = gnome_vfs_uri_to_string (state->active_dir_uri, GNOME_VFS_URI_HIDE_NONE);
+ uri_str = gnome_vfs_uri_to_string (state->active_dir_uri, GNOME_VFS_URI_HIDE_PASSWORD);
active_dir_path = gnome_vfs_get_local_path_from_uri (uri_str);
g_shell_parse_argv (cmd, &argc, &argv, NULL);
g_spawn_async (active_dir_path, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
diff --git a/src/dialogs/gnome-cmd-file-props-dialog.cc b/src/dialogs/gnome-cmd-file-props-dialog.cc
index 682adb3..94399b3 100644
--- a/src/dialogs/gnome-cmd-file-props-dialog.cc
+++ b/src/dialogs/gnome-cmd-file-props-dialog.cc
@@ -76,7 +76,7 @@ static void calc_tree_size_r (GnomeCmdFilePropsDialogPrivate *data, GnomeVFSURI
g_thread_exit (NULL);
if (!uri) return;
- uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
if (!uri_str) return;
GnomeVFSResult result = gnome_vfs_directory_list_load (&list, uri_str, GNOME_VFS_FILE_INFO_DEFAULT);
diff --git a/src/dialogs/gnome-cmd-mkdir-dialog.cc b/src/dialogs/gnome-cmd-mkdir-dialog.cc
index 6a220ed..5de077b 100644
--- a/src/dialogs/gnome-cmd-mkdir-dialog.cc
+++ b/src/dialogs/gnome-cmd-mkdir-dialog.cc
@@ -48,7 +48,7 @@ inline GSList *make_uri_list (GnomeCmdDir *dir, string filename)
if (strcmp (gnome_vfs_uri_get_scheme (dir_uri), "smb")==0 && g_path_is_absolute (filename.c_str()))
{
- string mime_type = stringify (gnome_vfs_get_mime_type (gnome_vfs_uri_to_string (dir_uri,
GNOME_VFS_URI_HIDE_NONE)));
+ string mime_type = stringify (gnome_vfs_get_mime_type (gnome_vfs_uri_to_string (dir_uri,
GNOME_VFS_URI_HIDE_PASSWORD)));
if (mime_type=="x-directory/normal" && !gnome_vfs_uri_has_parent (dir_uri))
filename.erase(0,1);
@@ -124,7 +124,7 @@ static void response_callback (GtkDialog *dialog, int response_id, GnomeCmdDir *
if (gnome_vfs_uri_equal (gnome_vfs_uri_get_parent (mkdir_uri), dir_uri) == 1 &&
!new_dir_focused)
{
string focus_filename = stringify (gnome_vfs_uri_extract_short_name (mkdir_uri));
- string mkdir_uri_str = stringify (gnome_vfs_uri_to_string (mkdir_uri,
GNOME_VFS_URI_HIDE_NONE));
+ string mkdir_uri_str = stringify (gnome_vfs_uri_to_string (mkdir_uri,
GNOME_VFS_URI_HIDE_PASSWORD));
gnome_cmd_dir_file_created (dir, mkdir_uri_str.c_str());
main_win->fs(ACTIVE)->file_list()->focus_file(focus_filename.c_str(), TRUE);
diff --git a/src/dirlist.cc b/src/dirlist.cc
index 7100854..02b6a9e 100644
--- a/src/dirlist.cc
+++ b/src/dirlist.cc
@@ -93,7 +93,7 @@ inline void visprog_list (GnomeCmdDir *dir)
GnomeVFSFileInfoOptions infoOpts = (GnomeVFSFileInfoOptions) (GNOME_VFS_FILE_INFO_FOLLOW_LINKS |
GNOME_VFS_FILE_INFO_GET_MIME_TYPE);
GnomeVFSURI *uri = GNOME_CMD_FILE (dir)->get_uri();
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
DEBUG('l', "visprog_list: %s\n", uri_str);
diff --git a/src/gnome-cmd-con-device.cc b/src/gnome-cmd-con-device.cc
index 6a05a05..905d739 100644
--- a/src/gnome-cmd-con-device.cc
+++ b/src/gnome-cmd-con-device.cc
@@ -148,7 +148,7 @@ static void do_mount_thread_func (GnomeCmdCon *con)
if (!uri)
return;
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
con->base_info = gnome_vfs_file_info_new ();
GnomeVFSResult result = gnome_vfs_get_file_info_uri (uri, con->base_info, infoOpts);
diff --git a/src/gnome-cmd-con-remote.cc b/src/gnome-cmd-con-remote.cc
index 3d7e08c..cf14e72 100644
--- a/src/gnome-cmd-con-remote.cc
+++ b/src/gnome-cmd-con-remote.cc
@@ -40,7 +40,7 @@ static void get_file_info_func (GnomeCmdCon *con)
GnomeVFSFileInfoOptions infoOpts = (GnomeVFSFileInfoOptions) (GNOME_VFS_FILE_INFO_FOLLOW_LINKS |
GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FORCE_FAST_MIME_TYPE);
- DEBUG('m', "Connecting to %s\n", gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE));
+ DEBUG('m', "Connecting to %s\n", gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD));
con->base_info = gnome_vfs_file_info_new ();
diff --git a/src/gnome-cmd-con-smb.cc b/src/gnome-cmd-con-smb.cc
index 3d2e595..489f459 100644
--- a/src/gnome-cmd-con-smb.cc
+++ b/src/gnome-cmd-con-smb.cc
@@ -97,7 +97,7 @@ static void smb_open (GnomeCmdCon *con)
return;
}
- DEBUG('l', "Connecting to %s\n", gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE));
+ DEBUG('l', "Connecting to %s\n", gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD));
GList *uri_list = g_list_append (NULL, uri);
con->state = GnomeCmdCon::STATE_OPENING;
diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc
index ce67b31..9be04b7 100644
--- a/src/gnome-cmd-dir.cc
+++ b/src/gnome-cmd-dir.cc
@@ -242,7 +242,7 @@ GnomeCmdDir *gnome_cmd_dir_new_from_info (GnomeVFSFileInfo *info, GnomeCmdDir *p
GnomeCmdPath *path = gnome_cmd_dir_get_path (parent)->get_child(info->name);
GnomeVFSURI *uri = gnome_cmd_con_create_uri (con, path);
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
GnomeCmdDir *dir = gnome_cmd_con_cache_lookup (gnome_cmd_dir_get_connection (parent), uri_str);
g_free (uri_str);
@@ -274,7 +274,7 @@ GnomeCmdDir *gnome_cmd_dir_new_with_con (GnomeCmdCon *con)
g_return_val_if_fail (con->base_info != NULL, NULL);
GnomeVFSURI *uri = gnome_cmd_con_create_uri (con, con->base_path);
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
GnomeCmdDir *dir = gnome_cmd_con_cache_lookup (con, uri_str);
if (dir)
@@ -306,7 +306,7 @@ GnomeCmdDir *gnome_cmd_dir_new (GnomeCmdCon *con, GnomeCmdPath *path)
GnomeVFSURI *uri = gnome_cmd_con_create_uri (con, path);
if (!uri) return NULL;
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
GnomeCmdDir *dir = gnome_cmd_con_cache_lookup (con, uri_str);
if (dir)
@@ -610,7 +610,7 @@ gchar *gnome_cmd_dir_get_uri_str (GnomeCmdDir *dir)
g_return_val_if_fail (GNOME_CMD_IS_DIR (dir), NULL);
GnomeVFSURI *uri = gnome_cmd_dir_get_uri (dir);
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
gnome_vfs_uri_unref (uri);
return uri_str;
@@ -634,7 +634,7 @@ gchar *gnome_cmd_dir_get_child_uri_str (GnomeCmdDir *dir, const gchar *filename)
g_return_val_if_fail (GNOME_CMD_IS_DIR (dir), NULL);
GnomeVFSURI *uri = gnome_cmd_dir_get_child_uri (dir, filename);
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
gnome_vfs_uri_unref (uri);
return uri_str;
@@ -651,7 +651,7 @@ GnomeVFSURI *gnome_cmd_dir_get_absolute_path_uri (GnomeCmdDir *dir, string absol
if (strcmp (gnome_vfs_uri_get_scheme (dir_uri), "smb") == 0)
{
- gchar *mime_type = gnome_vfs_get_mime_type (gnome_vfs_uri_to_string (dir_uri,
GNOME_VFS_URI_HIDE_NONE));
+ gchar *mime_type = gnome_vfs_get_mime_type (gnome_vfs_uri_to_string (dir_uri,
GNOME_VFS_URI_HIDE_PASSWORD));
while (strcmp (mime_type, "x-directory/normal") == 0)
{
g_free (mime_type);
@@ -659,7 +659,7 @@ GnomeVFSURI *gnome_cmd_dir_get_absolute_path_uri (GnomeCmdDir *dir, string absol
GnomeVFSURI *tmp_dir_uri = gnome_vfs_uri_get_parent (dir_uri);
gnome_vfs_uri_unref (dir_uri);
dir_uri = gnome_vfs_uri_dup (tmp_dir_uri);
- mime_type = gnome_vfs_get_mime_type (gnome_vfs_uri_to_string (dir_uri, GNOME_VFS_URI_HIDE_NONE));
+ mime_type = gnome_vfs_get_mime_type (gnome_vfs_uri_to_string (dir_uri,
GNOME_VFS_URI_HIDE_PASSWORD));
}
g_free (mime_type);
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 8317449..3d4be23 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -1112,7 +1112,7 @@ static gboolean on_create_symlink_ok (GnomeCmdStringDialog *string_dialog, const
if (result == GNOME_VFS_OK)
{
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
gnome_cmd_dir_file_created (fs->get_directory(), uri_str);
g_free (uri_str);
gnome_vfs_uri_unref (uri);
@@ -1312,7 +1312,7 @@ void gnome_cmd_file_selector_create_symlinks (GnomeCmdFileSelector *fs, GList *f
if (result == GNOME_VFS_OK)
{
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
gnome_cmd_dir_file_created (fs->get_directory(), uri_str);
g_free (uri_str);
}
diff --git a/src/gnome-cmd-file.h b/src/gnome-cmd-file.h
index a6ea418..07c7a07 100644
--- a/src/gnome-cmd-file.h
+++ b/src/gnome-cmd-file.h
@@ -64,7 +64,7 @@ struct GnomeCmdFile
gchar *get_dirname();
gchar *get_unescaped_dirname();
GnomeVFSURI *get_uri(const gchar *name=NULL);
- gchar *get_uri_str(GnomeVFSURIHideOptions hide_options=GNOME_VFS_URI_HIDE_NONE);
+ gchar *get_uri_str(GnomeVFSURIHideOptions hide_options=GNOME_VFS_URI_HIDE_PASSWORD);
char *get_collation_fname() const { return collate_key ? collate_key : info->name; }
@@ -160,7 +160,7 @@ inline gchar *gnome_cmd_file_get_quoted_real_path (GnomeCmdFile *f)
return f->get_quoted_real_path();
}
-inline gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *f, GnomeVFSURIHideOptions
hide_options=GNOME_VFS_URI_HIDE_NONE)
+inline gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *f, GnomeVFSURIHideOptions
hide_options=GNOME_VFS_URI_HIDE_PASSWORD)
{
g_return_val_if_fail (f != NULL, NULL);
return f->get_uri_str(hide_options);
diff --git a/src/gnome-cmd-plain-path.cc b/src/gnome-cmd-plain-path.cc
index c216dcf..a299c09 100644
--- a/src/gnome-cmd-plain-path.cc
+++ b/src/gnome-cmd-plain-path.cc
@@ -38,7 +38,7 @@ GnomeCmdPath *GnomeCmdPlainPath::get_parent()
if (!u2) return NULL;
- gchar *s = gnome_vfs_uri_to_string (u2, GNOME_VFS_URI_HIDE_NONE);
+ gchar *s = gnome_vfs_uri_to_string (u2, GNOME_VFS_URI_HIDE_PASSWORD);
gnome_vfs_uri_unref (u2);
GnomeCmdPath *parent_path = new GnomeCmdPlainPath (gnome_vfs_get_local_path_from_uri (s));
diff --git a/src/gnome-cmd-smb-path.cc b/src/gnome-cmd-smb-path.cc
index dec6d9a..4231906 100644
--- a/src/gnome-cmd-smb-path.cc
+++ b/src/gnome-cmd-smb-path.cc
@@ -73,7 +73,7 @@ GnomeCmdPath *GnomeCmdSmbPath::get_parent()
GnomeVFSURI *u2 = gnome_vfs_uri_get_parent (u1);
g_return_val_if_fail (u2 != NULL, NULL);
- gchar *s = gnome_vfs_uri_to_string (u2, GNOME_VFS_URI_HIDE_NONE);
+ gchar *s = gnome_vfs_uri_to_string (u2, GNOME_VFS_URI_HIDE_PASSWORD);
gnome_vfs_uri_unref (u2);
c = gnome_vfs_get_local_path_from_uri (s);
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 35f2154..107181e 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -2210,7 +2210,7 @@ int parse_command(string *cmd, gchar *command)
case 'u': // %u fully qualified URI for the file (or list for multiple selections)
if (uri.empty())
- get_file_list (uri, sfl, gnome_cmd_file_get_uri_str, GNOME_VFS_URI_HIDE_NONE);
+ get_file_list (uri, sfl, gnome_cmd_file_get_uri_str, GNOME_VFS_URI_HIDE_PASSWORD);
if (cmdcap < cmdlen + uri.length())
{
cmd->reserve(cmdlen + uri.length());
diff --git a/src/gnome-cmd-xfer.cc b/src/gnome-cmd-xfer.cc
index 6dfdbbb..f2748fd 100644
--- a/src/gnome-cmd-xfer.cc
+++ b/src/gnome-cmd-xfer.cc
@@ -359,8 +359,8 @@ inline gboolean uri_is_parent_to_dir_or_equal (GnomeVFSURI *uri, GnomeCmdDir *di
gboolean is_parent = gnome_vfs_uri_is_parent (uri, dir_uri, TRUE);
- gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
- gchar *dir_uri_str = gnome_vfs_uri_to_string (dir_uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
+ gchar *dir_uri_str = gnome_vfs_uri_to_string (dir_uri, GNOME_VFS_URI_HIDE_PASSWORD);
gboolean is_equal = gnome_vfs_uris_match (uri_str, dir_uri_str);
g_free (uri_str);
@@ -388,7 +388,7 @@ inline gchar *remove_basename (gchar *in)
inline gboolean file_is_already_in_dir (GnomeVFSURI *uri, GnomeCmdDir *dir)
{
- gchar *tmp = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *tmp = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD);
gchar *uri_str = remove_basename (tmp);
gchar *dir_uri_str = GNOME_CMD_FILE (dir)->get_uri_str();
diff --git a/src/utils.cc b/src/utils.cc
index 35625c4..6e26ab5 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -759,7 +759,7 @@ GnomeVFSFileSize calc_tree_size (const GnomeVFSURI *dir_uri, gulong *count)
if (!dir_uri)
return -1;
- gchar *dir_uri_str = gnome_vfs_uri_to_string (dir_uri, GNOME_VFS_URI_HIDE_NONE);
+ gchar *dir_uri_str = gnome_vfs_uri_to_string (dir_uri, GNOME_VFS_URI_HIDE_PASSWORD);
g_return_val_if_fail (dir_uri_str != NULL, -1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]