Write session files with O_NOFOLLOW and mode 0600

Also make directory_entry::is_file() report the real type so symlinks are skipped.
This commit is contained in:
xirvik
2026-09-19 01:55:14 +00:00
committed by Jari Sundell
parent 019c16a077
commit a5c39566c8
6 changed files with 236 additions and 25 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "test/helpers/test_fixture.h"
#include <string>
class TestSessionStorer : public test_fixture {
CPPUNIT_TEST_SUITE(TestSessionStorer);
CPPUNIT_TEST(test_temp_file_symlink_is_not_followed);
CPPUNIT_TEST(test_saved_files_are_owner_only);
CPPUNIT_TEST(test_symlinked_entry_is_not_a_file);
CPPUNIT_TEST_SUITE_END();
public:
void setUp();
void tearDown();
void test_temp_file_symlink_is_not_followed();
void test_saved_files_are_owner_only();
void test_symlinked_entry_is_not_a_file();
private:
std::string m_temp_dir;
std::string m_session_dir;
};