develop
asamoukin 16 years ago
parent 9941fe19b9
commit 297894c126

@ -2020,20 +2020,22 @@ class profile(_file, _terms):
flagForce = False flagForce = False
# Если есть указатель на файл профиля (link) # Если есть указатель на файл профиля (link)
if objHeadNew.params.has_key("link"): if objHeadNew.params.has_key("link"):
#prevOldFile = oldFile
profileFile = objHeadNew.params['link'] profileFile = objHeadNew.params['link']
FO = self.openNewFile(profileFile) foundProfileFile = os.path.exists(profileFile)
buff = FO.read() if foundProfileFile:
FO.close() FO = self.openNewFile(profileFile)
buff = FO.read()
FO.close()
if os.path.exists(oldFile): if os.path.exists(oldFile):
os.remove(oldFile) os.remove(oldFile)
fd = os.open(oldFile, os.O_CREAT) if foundProfileFile:
os.close(fd) fd = os.open(oldFile, os.O_CREAT)
os.chmod(oldFile, self._mode) os.close(fd)
os.chown(oldFile, self._uid, self._gid) os.chmod(oldFile, self._mode)
FON = open (oldFile, "r+") os.chown(oldFile, self._uid, self._gid)
FON.write(buff) FON = open (oldFile, "r+")
FON.close() FON.write(buff)
FON.close()
# Если символическая ссылка # Если символическая ссылка
if objHeadNew.params.has_key("symbolic"): if objHeadNew.params.has_key("symbolic"):

Loading…
Cancel
Save