Provide a mechanism for configurable file safety checking.
Use it in maidag (.forward file safety) and in libmu_auth (TLS files). * include/mailutils/tls.h (mu_tls_module_config): New members for safety check flags. * include/mailutils/util.h (MU_FILE_SAFETY_NONE,MU_FILE_SAFETY_ALL) (MU_FILE_SAFETY_OWNER_MISMATCH) (MU_FILE_SAFETY_GROUP_WRITABLE,MU_FILE_SAFETY_WORLD_WRITABLE) (MU_FILE_SAFETY_GROUP_READABLE,MU_FILE_SAFETY_WORLD_READABLE) (MU_FILE_SAFETY_LINKED_WRDIR) (MU_FILE_SAFETY_DIR_IWGRP,MU_FILE_SAFETY_DIR_IWOTH): New constants. (mu_file_safety_check,mu_file_safety_name_to_code) (mu_file_safety_name_to_error): New protos. * libmailutils/base/checkperms.c: New file. * libmailutils/base/Makefile.am (libbase_la_SOURCES): Add checkperms.c. * libmailutils/diag/errors: Add new error codes. (MU_ERR_UNSAFE_PERMS): change description wording. * libmu_auth/tls.c (mu_check_tls_environment): Use mu_file_safety_check. * libmu_cfg/tls.c (tls_settings): Initialize. (mu_tls_param): New configuration file statements: key-file-safety-checks, cert-file-safety-checks, ca-file-safety-checks. * maidag/forward.c (maidag_forward): Use mu_file_safety_check. * maidag/maidag.c (cb2_forward_file_checks): Use mu_file_safety_name_to_code.
Showing
10 changed files
with
446 additions
and
212 deletions
libmailutils/base/filesafety.c
0 → 100644
-
Please register or sign in to post a comment