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

Allow group access to lockfile and fix empty timestamp #562

Merged
merged 5 commits into from
Jul 31, 2020

Conversation

timopollmeier
Copy link
Member

This allows gvmd and ospd-openvas to be run as different users in the same group and stops the timestamp in the lockfile being cleared when it is already locked.

This allows the lockfile to be shared with users in the same group.
This prevents the content being overwritten if the file is locked.
@timopollmeier timopollmeier marked this pull request as ready for review July 30, 2020 09:48
@@ -511,7 +512,7 @@ do_sync ()
date > $OPENVAS_RUN_DIR/feed-update.lock
sync_nvts
echo -n $OPENVAS_RUN_DIR/feed-update.lock
)9>$OPENVAS_RUN_DIR/feed-update.lock
)9<$OPENVAS_RUN_DIR/feed-update.lock
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the file doesn't exist, it will end with an error. It should be open with append flag.

Suggested change
)9<$OPENVAS_RUN_DIR/feed-update.lock
)9>>$OPENVAS_RUN_DIR/feed-update.lock

Then, if the flock is successful, the line 512 will overwrite the the content instead of append

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I've changed it in 5d6fa24 and also in the gvmd PR.

Using read mode does not work if the file does not exist.
@jjnicola jjnicola merged commit 50605c4 into greenbone:openvas-20.08 Jul 31, 2020
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

Successfully merging this pull request may close these issues.

2 participants