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
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix byte ordering and wrong PROTO identifier in dump_ipv6_packet() for openvas-nasl. [#549](https://github.com/greenbone/openvas/pull/549)
- Fix size calculation which lead to alloc error in get_tcp_element() of openvas-nasl. [#546](https://github.com/greenbone/openvas/pull/546)
- Fix filter out of default 'radio' type preferences [#560](https://github.com/greenbone/openvas/pull/560)
- Allow group access to lockfile and fix empty timestamp [#562](https://github.com/greenbone/openvas/pull/562)

### Removed
- Removed "network scan" mode. This includes removal of NASL API methods "scan_phase()" and "network_targets()". Sending a "network_mode=yes" in a scanner configuration will have no effect anymore. [#493](https://github.com/greenbone/openvas/pull/493)
Expand Down
3 changes: 2 additions & 1 deletion tools/greenbone-nvt-sync.in
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ do_sync ()
log_write "Feed is already current, skipping synchronization."
else
(
chmod +660 $OPENVAS_RUN_DIR/feed-update.lock
flock -n 9
if [ $? -eq 1 ] ; then
log_warning "Another process related to the feed update is already running"
Expand All @@ -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.

fi
}

Expand Down