Package: nautilus-open-terminal Version: 0.9-5 Severity: important Tags: patch User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu karmic ubuntu-patch
Hi, An Ubuntu user reported a crasher when accessing certain shares using n-o-t. I'm forwarding the patch that he developed to fix this for your consideration, as it seems you are possibly the upstream author too. Could you offer an opinion? Iain [0] https://bugs.launchpad.net/ubuntu/+source/nautilus-open-terminal/+bug/333462 -- System Information: Debian Release: 5.0 APT prefers jaunty-updates APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 'jaunty-proposed'), (500, 'jaunty-backports'), (500, 'jaunty') Architecture: i386 (i686) Kernel: Linux 2.6.28-12-generic (SMP w/2 CPU cores) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
diff -u nautilus-open-terminal-0.9/debian/changelog nautilus-open-terminal-0.9/debian/changelog diff -u nautilus-open-terminal-0.9/debian/control nautilus-open-terminal-0.9/debian/control diff -u nautilus-open-terminal-0.9/debian/patches/gio-port.diff nautilus-open-terminal-0.9/debian/patches/gio-port.diff --- nautilus-open-terminal-0.9/debian/patches/gio-port.diff +++ nautilus-open-terminal-0.9/debian/patches/gio-port.diff @@ -1,6 +1,6 @@ -diff -uri nautilus-open-terminal-0.9/src/nautilus-open-terminal.c nautilus-open-terminal-0.9-gio/src/nautilus-open-terminal.c ---- nautilus-open-terminal-0.9/src/nautilus-open-terminal.c 2008-02-28 00:03:34.000000000 +0100 -+++ nautilus-open-terminal-0.9-gio/src/nautilus-open-terminal.c 2008-04-14 00:32:12.000000000 +0200 +diff -uri nautilus-open-terminal-0.9/src/nautilus-open-terminal.c nautilus-open-terminal-0.9.modified/src/nautilus-open-terminal.c +--- nautilus-open-terminal-0.9/src/nautilus-open-terminal.c 2008-02-28 01:03:34.000000000 +0200 ++++ nautilus-open-terminal-0.9.modified/src/nautilus-open-terminal.c 2009-04-27 22:23:57.164870670 +0300 @@ -35,12 +35,13 @@ #include <gtk/gtkmain.h> #include <gconf/gconf-client.h> @@ -27,60 +27,60 @@ *p = 0; } -@@ -143,31 +145,75 @@ +@@ -142,32 +144,75 @@ + #define get_desktop_dir() g_build_filename (g_get_home_dir (), "Desktop", NULL) #endif - static void ++ ++ ++#define SFTP_PREFIX "sftp://" ++static void +parse_sftp_uri (GFile *file, char **host, guint *port, char **user, + char **path) +{ ++ char *tmp, *save; + char *uri = g_file_get_uri (file); -+ char *u, *h, *s, *p; -+ char *h_end; -+ + g_assert (uri != NULL); ++ save = uri; + -+ u = strchr(uri, ':'); -+ g_assert (u != NULL); -+ u+=2; -+ -+ p = strchr (u, '/'); -+ -+ h = strchr(u, '@'); -+ -+ if (h && (p == NULL || h < p)) { -+ *h='\0'; -+ h++; -+ } else { -+ h = u; -+ u = NULL; ++ *path = NULL; ++ *user = NULL; ++ *host = NULL; ++ *port = 0; ++ ++ /* skip intial 'sftp:// prefix */ ++ g_assert (!strncmp(uri, SFTP_PREFIX, strlen(SFTP_PREFIX))); ++ uri += strlen(SFTP_PREFIX); ++ ++ ++ /* cut out the path */ ++ tmp = strchr (uri, '/'); ++ if (tmp) { ++ *path = g_uri_unescape_string(tmp, "/"); ++ *tmp = '\0'; + } + -+ s = strchr(h, ':'); -+ -+ if (s && (p == NULL || s < p)) { -+ h_end = s-1; -+ *s = '\0'; -+ s++; -+ } else { -+ h_end = p; -+ s = NULL; ++ /* read the username - it ends with @ */ ++ tmp = strchr(uri, '@'); ++ if (tmp) { ++ *tmp++ = '\0'; ++ *user = strdup(uri); ++ uri = tmp; + } + -+ if (h_end == NULL) { -+ h_end = h + strlen(h); ++ /* now read the port, starts with : */ ++ tmp = strchr(uri, ':'); ++ if (tmp) { ++ *tmp++ = '\0'; ++ *port=atoi(tmp); /*FIXME: getservbyname*/ + } + -+ *user = strdup(u); -+ *port = s == NULL ? 0 : atoi(s); /* FIXME: getservbyname ? */ -+ *path = g_uri_unescape_string (p, "/"); -+ *h_end = '\0'; -+ *host = strdup(h); -+ -+ g_free (uri); ++ /* what is left is the host */ ++ *host = strdup(uri); ++ g_free (save); +} + -+static void + static void append_sftp_info (char **terminal_exec, NautilusFileInfo *file_info) { @@ -118,7 +118,7 @@ if (host_port == 0) { host_port = SSH_DEFAULT_PORT; -@@ -179,7 +225,7 @@ +@@ -179,7 +224,7 @@ user_host = g_strdup (host_name); } @@ -127,7 +127,7 @@ quoted_cmd = g_shell_quote (cmd); g_free (cmd); -@@ -187,11 +233,13 @@ +@@ -187,11 +232,13 @@ strcpy (*terminal_exec + strlen (*terminal_exec), " -e "); strcpy (*terminal_exec + strlen (*terminal_exec), quoted_cmd);