Add helper messages for lax permissions

This commit is contained in:
Roger A. Light 2023-09-18 22:21:56 +01:00
parent 7ae22c356b
commit 97c25654ed
2 changed files with 12 additions and 8 deletions

View File

@ -158,8 +158,9 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
#else #else
fprintf(stderr, fprintf(stderr,
#endif #endif
"Warning: File %s has world readable permissions. Future versions will refuse to load this file.", "Warning: File %s has world readable permissions. Future versions will refuse to load this file.\n"
path); "To fix this, use `chmod 0700 %s`.",
path, path);
#if 0 #if 0
return NULL; return NULL;
#endif #endif
@ -175,8 +176,9 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
#else #else
fprintf(stderr, fprintf(stderr,
#endif #endif
"Warning: File %s owner is not %s. Future versions will refuse to load this file.", "Warning: File %s owner is not %s. Future versions will refuse to load this file."
path, result->pw_name); "To fix this, use `chown %s %s`.",
path, result->pw_name, result->pw_name, path);
} }
#if 0 #if 0
// Future version // Future version

View File

@ -166,8 +166,9 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
#else #else
fprintf(stderr, fprintf(stderr,
#endif #endif
"Warning: File %s has world readable permissions. Future versions will refuse to load this file.", "Warning: File %s has world readable permissions. Future versions will refuse to load this file."
path); "To fix this, use `chmod 0700 %s`.",
path, path);
#if 0 #if 0
return NULL; return NULL;
#endif #endif
@ -183,8 +184,9 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
#else #else
fprintf(stderr, fprintf(stderr,
#endif #endif
"Warning: File %s owner is not %s. Future versions will refuse to load this file.", "Warning: File %s owner is not %s. Future versions will refuse to load this file."
path, result->pw_name); "To fix this, use `chown %s %s`.",
path, result->pw_name, result->pw_name, path);
} }
#if 0 #if 0
// Future version // Future version