Windows: vm_helper.get_udf_path_name may be replacing slashes wrongly

Bug #807216 reported by Natalia Bidart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Fix Released
Medium
Natalia Bidart

Bug Description

Right now we have this comment in the method:

     61 # the head has to be a canonical path that uses / as the separator
     62 # because is information used by the server side to create the file it
     63 # it correct location.
     64 head = head.replace('/', '\\')
     65 return head, tail

On one hand, I think we need to do the opposite replace. On the other hand, by looking how the volume_manager uses this functionality, we should not be replacing the slashes at all. We need to define 2 methods, one that calculate the suggested path (canonical form for the server) from any path, and another that computes the udf real (native) path and udf name:

(edit to see proper spacing)

   1204 try:
   1205 udf_path, udf_name = get_udf_path_name(path)
   1206 except ValueError, e:
   1207 self.m.event_q.push('VM_UDF_CREATE_ERROR', path=path,
   1208 error="INVALID_PATH: %s" % (e,))
   1209 else:
   1210 try:
   1211 marker = MDMarker(path)
   ...
   1217 udf = UDF(None, None,
   1218 # suggested_path is always unicode, because the
   1219 # suggested path is a server side metadata we will
   1220 # always use the unix path separator /
   1221 (udf_path + '/' + udf_name).decode('utf-8'),
   1222 # always subscribed since it's a local request
   1223 path, subscribed=True)
   1224 self.marker_udf_map[marker] = udf
   1225 self.m.action_q.create_udf(udf_path.decode('utf-8'),
   1226 udf_name.decode('utf-8'), marker)
   1227 except Exception, e:
   1228 self.m.event_q.push('VM_UDF_CREATE_ERROR', path=path,
   1229 error="UNKNOWN_ERROR: %s" % (e,))

Changed in ubuntuone-client:
assignee: nobody → Natalia Bidart (nataliabidart)
importance: Undecided → Critical
status: New → Triaged
description: updated
description: updated
tags: added: u1-zomg-windows
Changed in ubuntuone-client:
importance: Critical → High
assignee: Natalia Bidart (nataliabidart) → Manuel de la Pena (mandel)
Changed in ubuntuone-client:
assignee: Manuel de la Pena (mandel) → Natalia Bidart (nataliabidart)
importance: High → Medium
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

This bug is definitely fix and released in trunk.

Changed in ubuntuone-client:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.