Downgrade internal errors to reporter warnings in file/directory BiFs

This allows Zeek execution to continue gracefully in the presence of such
errors, particularly at zeek_init() time. Includes a tweak to expand the
bifs.directory_operations test to check continuation after errors.

Resolves #3595.
This commit is contained in:
Christian Kreibich 2025-02-05 17:36:02 -08:00
parent 4ee7bde05e
commit 1f3d13a371
4 changed files with 17 additions and 10 deletions

View file

@ -9,3 +9,4 @@ F
F
F
F
Shutting down.

View file

@ -4,7 +4,7 @@
event zeek_init()
{
# Test succesful operations...
# Test successful operations...
print mkdir("testdir");
print mkdir("testdir");
local a = open("testdir/testfile");
@ -14,7 +14,7 @@ event zeek_init()
print unlink("testdir2/testfile2");
print rmdir("testdir2");
# ... and failing ones.
print unlink("nonexisting");
print rename("a", "b");
print rmdir("nonexisting");
@ -22,3 +22,9 @@ event zeek_init()
close(a);
print mkdir("testfile");
}
event zeek_done()
{
# Only reached when above failures don't cause Zeek to exit.
print "Shutting down.";
}