ryzom / ryzomcore

Ryzom Core is the open-source project related to the Ryzom game. This community repository is synchronized with the Ryzom Forge repository, based on the Core branch.
https://wiki.ryzom.dev
GNU Affero General Public License v3.0
333 stars 90 forks source link

Ryzom break hardlinks & change right of files #276

Closed ryzom-pipeline closed 8 years ago

ryzom-pipeline commented 8 years ago

Original report by Lennaïck (Bitbucket: lennaick, GitHub: lennaick).


All my char have the same config keys, when I log one of my char ingame the config keys works but don't share any change if you have logged with that char more than once.

When log out, My char keys_pseudo.xml have right (664) but inode have change and all hardlink turn to (777) for an unknow raison.

~/.local/share/Ryzom/save$ ll -i keys*
7222804 -rw-rw-r--  1 lennaick lennaick 36087 juil.  1 04:23 keys_one.xml
7209405 -rwxrwxrwx 19 lennaick lennaick 36087 juil.  1 03:51 keys_two.xml*
7209405 -rwxrwxrwx 19 lennaick lennaick 36087 juil.  1 03:51 keys_tree.xml*
7209405 -rwxrwxrwx 19 lennaick lennaick 36087 juil.  1 03:51 keys.xml*
ryzom-pipeline commented 8 years ago

Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).


keys and icfg are using temp file and then rename when saving. This is the reason inode changes.

Before deleting old file, its attributes are set to r/w in CFile::deleteFile function, so thats why hard links attributes change.

ryzom-pipeline commented 8 years ago

Original comment by Lennaïck (Bitbucket: lennaick, GitHub: lennaick).


I see, but I still not understand why all hardlink change from 664 to 777 when one file is deleted by Ryzom.

ryzom-pipeline commented 8 years ago

Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).


Permissions are stored on inode which all hardlinks share. Before file is deleted, chmod 777 is made on that file (incase its read-only probably).

Unless there is another use case where hard links will break (separate bugreport), I would not change current behavior.