-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate config files and directories with CMake #316
Generate config files and directories with CMake #316
Conversation
@@ -191,7 +191,7 @@ | |||
|
|||
int main(int argc, char **argv) | |||
{ | |||
char spath[PATH_MAX] = RENDER_SOCKET; | |||
char spath[PATH_MAX] = RENDERD_SOCKET; |
Check notice
Code scanning / Flawfinder
Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120).
@@ -320,7 +320,7 @@ | |||
fprintf(stderr, " -m, --map=STYLE Instead of going through all styls of CONFIG, only use a specific map-style\n"); | |||
fprintf(stderr, " -n, --num-threads=N the number of parallel request threads (default 1)\n"); | |||
fprintf(stderr, " -s, --socket=SOCKET|HOSTNAME:PORT unix domain socket name or hostname and port for contacting renderd\n"); | |||
fprintf(stderr, " -t, --tile-dir tile cache directory (defaults to '" HASH_PATH "')\n"); | |||
fprintf(stderr, " -t, --tile-dir tile cache directory (defaults to '" RENDERD_TILE_DIR "')\n"); |
Check notice
Code scanning / Flawfinder
If format strings can be influenced by an attacker, they can be exploited (CWE-134).
@@ -224,7 +224,7 @@ | |||
fprintf(stderr, " -m, --map=MAP render tiles in this map (defaults to '" XMLCONFIG_DEFAULT "')\n"); | |||
fprintf(stderr, " -n, --num-threads=N the number of parallel request threads (default 1)\n"); | |||
fprintf(stderr, " -s, --socket=SOCKET|HOSTNAME:PORT unix domain socket name or hostname and port for contacting renderd\n"); | |||
fprintf(stderr, " -t, --tile-dir tile cache directory (defaults to '" HASH_PATH "')\n"); | |||
fprintf(stderr, " -t, --tile-dir tile cache directory (defaults to '" RENDERD_TILE_DIR "')\n"); |
Check notice
Code scanning / Flawfinder
If format strings can be influenced by an attacker, they can be exploited (CWE-134).
@@ -2726,10 +2726,10 @@ | |||
scfg->max_load_old = MAX_LOAD_OLD; | |||
scfg->max_load_missing = MAX_LOAD_MISSING; | |||
scfg->veryold_threshold = VERYOLD_THRESHOLD; | |||
strncpy(scfg->renderd_socket_name, RENDER_SOCKET, PATH_MAX - 1); | |||
strncpy(scfg->renderd_socket_name, RENDERD_SOCKET, PATH_MAX - 1); |
Check notice
Code scanning / Flawfinder
Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120).
scfg->renderd_socket_name[PATH_MAX - 1] = 0; | ||
scfg->renderd_socket_port = 0; | ||
strncpy(scfg->tile_dir, HASH_PATH, PATH_MAX - 1); | ||
strncpy(scfg->tile_dir, RENDERD_TILE_DIR, PATH_MAX - 1); |
Check notice
Code scanning / Flawfinder
Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120).
@@ -188,7 +188,7 @@ | |||
fprintf(stderr, "Usage: convert_meta [OPTION] ...\n"); | |||
fprintf(stderr, "Convert the rendered PNGs into the more efficient .meta format\n"); | |||
fprintf(stderr, " -m, --map convert tiles in this map (default is 'default')\n"); | |||
fprintf(stderr, " -t, --tile-dir tile cache directory (default is '" HASH_PATH "')\n"); | |||
fprintf(stderr, " -t, --tile-dir tile cache directory (default is '" RENDERD_TILE_DIR "')\n"); |
Check notice
Code scanning / Flawfinder
If format strings can be influenced by an attacker, they can be exploited (CWE-134).
@@ -206,7 +206,7 @@ | |||
fprintf(stderr, " -m, --map=MAP render tiles in this map (defaults to '" XMLCONFIG_DEFAULT "')\n"); | |||
fprintf(stderr, " -n, --num-threads=N the number of parallel request threads (default 1)\n"); | |||
fprintf(stderr, " -s, --socket=SOCKET|HOSTNAME:PORT unix domain socket name or hostname and port for contacting renderd\n"); | |||
fprintf(stderr, " -t, --tile-dir tile cache directory (defaults to '" HASH_PATH "')\n"); | |||
fprintf(stderr, " -t, --tile-dir tile cache directory (defaults to '" RENDERD_TILE_DIR "')\n"); |
Check notice
Code scanning / Flawfinder
If format strings can be influenced by an attacker, they can be exploited (CWE-134).
40456c4
to
3f57e50
Compare
Very nice improvement. Would love to merge it. Please rebase and resolve conflict. Thank you! |
CMake >= 3.13 required due to 'https://cmake.org/Bug/view.php?id=14444'
ea87849
to
6910cee
Compare
@xamanu Alright, I've rebased this and the tests are passing. Thanks! |
Since most of the variables contained within config files and related to directory destinations are available at build time, they can be used to generate and install some of the config files and directories.
/etc/renderd.conf
renderd
configuration file withrenderd
&mapnik
sections/etc/apache2/mods-available/tile.load
(path varies based on OS/Distribution)LoadModule
directive configuration file/var/run/renderd
/var/cache/renderd/tiles