Updater now uses correct "gid" instead of "uid" for change ownership of files (Fix for #213 ) -> update should now working if user id differs from groupid
This commit is contained in:
parent
2177810556
commit
f446e29276
|
@ -455,11 +455,13 @@ class Updater(threading.Thread):
|
||||||
logging.getLogger('cps.web').debug('Move File '+src_file+' to '+dst_dir)
|
logging.getLogger('cps.web').debug('Move File '+src_file+' to '+dst_dir)
|
||||||
if change_permissions:
|
if change_permissions:
|
||||||
try:
|
try:
|
||||||
os.chown(dst_file, permission.st_uid, permission.st_uid)
|
os.chown(dst_file, permission.st_uid, permission.st_gid)
|
||||||
# print('Permissions: User '+str(new_permissions.st_uid)+' Group '+str(new_permissions.st_uid))
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
e = sys.exc_info()
|
e = sys.exc_info()
|
||||||
logging.getLogger('cps.web').debug('Fail '+str(dst_file)+' error: '+str(e))
|
old_permissions = os.stat(dst_file)
|
||||||
|
logging.getLogger('cps.web').debug('Fail change permissions of ' + str(dst_file) + '. Before: '
|
||||||
|
+ str(old_permissions.st_uid) + ':' + str(old_permissions.st_gid) + ' After: '
|
||||||
|
+ str(permission.st_uid) + ':' + str(permission.st_gid) + ' error: '+str(e))
|
||||||
return
|
return
|
||||||
|
|
||||||
def update_source(self, source, destination):
|
def update_source(self, source, destination):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user