Ticket #1688: 1688.patch

File 1688.patch, 1.7 KB (added by alsroot, 13 years ago)
  • src/jarabe/journal/model.py

    From c4c48163381da03d374ce4da56292cd4c9f3bbfc Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Mon, 25 Jan 2010 20:14:26 +0000
    Subject: Do not transfer ownership while copying objects #1688
    
    
    diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
    index b512fb6..d7785ec 100644
    a b def copy(metadata, mount_point): 
    491491    metadata['mountpoint'] = mount_point
    492492    del metadata['uid']
    493493
    494     return write(metadata, file_path)
     494    return write(metadata, file_path, transfer_ownership=False)
    495495
    496 def write(metadata, file_path='', update_mtime=True):
     496def write(metadata, file_path='', update_mtime=True, transfer_ownership=True):
    497497    """Creates or updates an entry for that id
    498498    """
    499499    logging.debug('model.write %r %r %r', metadata.get('uid', ''), file_path,
    def write(metadata, file_path='', update_mtime=True): 
    507507            object_id = _get_datastore().update(metadata['uid'],
    508508                                                 dbus.Dictionary(metadata),
    509509                                                 file_path,
    510                                                  True)
     510                                                 transfer_ownership)
    511511        else:
    512512            object_id = _get_datastore().create(dbus.Dictionary(metadata),
    513513                                                 file_path,
    514                                                  True)
     514                                                 transfer_ownership)
    515515    else:
    516516        if not os.path.exists(file_path):
    517517            raise ValueError('Entries without a file cannot be copied to '