Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock file created with 000 permissions -- why? #480

Open
jimduchek opened this issue Mar 11, 2022 · 1 comment
Open

Lock file created with 000 permissions -- why? #480

jimduchek opened this issue Mar 11, 2022 · 1 comment

Comments

@jimduchek
Copy link

The lock file is opened with the following code:

ret = open(lock_file_full, O_WRONLY | O_CREAT | O_EXCL, 0);

Is there a reason the file is created with 0 permissions? It seems that this was a deliberate choice, but I can't figure out why.

The reason this comes up is having a file with no permissions at all causes an error with rsync, as it cannot read the contents of the file (I'm not sure why it bothers trying to read a 0-length file, but it does). Yes, I could exclude .cache/tilda, I suppose. But I don't see anything else making PID files 0-permissions, so not sure why Tilda does. Would suggest changing to S_IRUSR if this is merely an oversight.

@lanoxx
Copy link
Owner

lanoxx commented Nov 19, 2023

It seems this was added in commit 0a66b99 around 2014 and I cannot remember why I have used 0 as the access permission. It might have been by accident. Technically, the lock files have no content, we only use them to track the pids of running tilda processes, so maybe we choose a mode of 0 to avoid accidentally writing into it. No idea, if is causing issues with rsync I guess we should give at least read access mode to the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants