Secure config errors
If user can make NETHACKOPTIONS point to a file, that user could then get the file contents via the extended config file error reporting. Add CONFIG_ERROR_SECURE compile-time option to make that case output only the first error, no line number or error context.
This commit is contained in:
@@ -449,6 +449,14 @@ typedef unsigned char uchar;
|
||||
|
||||
#define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
|
||||
|
||||
/* CONFIG_ERROR_SECURE: If user makes NETHACKOPTIONS point to a file ...
|
||||
* TRUE: Show the first error, nothing else.
|
||||
* FALSE: Show all errors as normal, with line numbers and context.
|
||||
*/
|
||||
#ifndef CONFIG_ERROR_SECURE
|
||||
# define CONFIG_ERROR_SECURE TRUE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Section 4: EXPERIMENTAL STUFF
|
||||
*
|
||||
|
||||
@@ -767,7 +767,7 @@ E void FDECL(unlock_file, (const char *));
|
||||
#ifdef USER_SOUNDS
|
||||
E boolean FDECL(can_read_file, (const char *));
|
||||
#endif
|
||||
E void FDECL(config_error_init, (BOOLEAN_P, const char *));
|
||||
E void FDECL(config_error_init, (BOOLEAN_P, const char *, BOOLEAN_P));
|
||||
E void FDECL(config_error_add, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E int NDECL(config_error_done);
|
||||
E boolean FDECL(read_config_file, (const char *, int));
|
||||
|
||||
Reference in New Issue
Block a user