commit c16cda05743b8a017d150757f0b9da0bc5bffa83 from: Omar Polo date: Mon May 20 12:51:06 2024 UTC gotwebd: remove unix_socket_name Now that `listen' is a top-level, `unix_socket_name' is useless. The default socket remains /var/www/run/gotweb.sock, to listen on an alternate socket now `listen on socket "/some/other/sock" can be used. part of a larger diff that's ok stsp@ commit - d68a7b14eb6995f6fc4c877ea24276f6b0174f85 commit + c16cda05743b8a017d150757f0b9da0bc5bffa83 blob - 3f49c317df61f0920a4cbe046bf927f5ead20532 blob + 22e1f652d4a563c1443ad56608ce3b0afdf22854 --- gotwebd/gotwebd.conf.5 +++ gotwebd/gotwebd.conf.5 @@ -77,10 +77,6 @@ May be specified multiple times to build up a list of Run the specified number of server processes. .Xr gotwebd 8 runs 3 server processes by default. -.It Ic unix_socket_name Ar path -Set the path to the default unix socket. -Defaults to -.Pa /var/www/run/gotweb.sock . .El .Pp If no blob - 37370be2472807ec0d8e2aa976dd6d8a8acd7b88 blob + 79be23fd4a96aa9933e08e7578e6a97b51d844b8 --- gotwebd/gotwebd.h +++ gotwebd/gotwebd.h @@ -363,8 +363,6 @@ struct gotwebd { int server_cnt; char httpd_chroot[PATH_MAX]; - - char unix_socket_name[PATH_MAX]; }; /* blob - c129b07d662a238be22d1cbc79acaef5987db94f blob + 90f1dfb2d5d488e436389ece78e9cebf0e84a4d5 --- gotwebd/parse.y +++ gotwebd/parse.y @@ -113,7 +113,7 @@ typedef struct { %token LOGO_URL SHOW_REPO_OWNER SHOW_REPO_AGE SHOW_REPO_DESCRIPTION %token MAX_REPOS_DISPLAY REPOS_PATH MAX_COMMITS_DISPLAY ON ERROR %token SHOW_SITE_OWNER SHOW_REPO_CLONEURL PORT PREFORK RESPECT_EXPORTOK -%token UNIX_SOCKET_NAME SERVER CHROOT CUSTOM_CSS SOCKET +%token SERVER CHROOT CUSTOM_CSS SOCKET %token SUMMARY_COMMITS_DISPLAY SUMMARY_TAGS_DISPLAY %token STRING @@ -197,19 +197,6 @@ main : PREFORK NUMBER { sizeof(gotwebd->httpd_chroot)); if (n >= sizeof(gotwebd->httpd_chroot)) { yyerror("%s: httpd_chroot truncated", __func__); - free($2); - YYERROR; - } - free($2); - } - | UNIX_SOCKET_NAME STRING { - n = snprintf(gotwebd->unix_socket_name, - sizeof(gotwebd->unix_socket_name), "%s%s", - gotwebd->httpd_chroot, $2); - if (n < 0 || - (size_t)n >= sizeof(gotwebd->unix_socket_name)) { - yyerror("%s: unix_socket_name truncated", - __func__); free($2); YYERROR; } @@ -472,7 +459,6 @@ lookup(char *s) { "socket", SOCKET }, { "summary_commits_display", SUMMARY_COMMITS_DISPLAY }, { "summary_tags_display", SUMMARY_TAGS_DISPLAY }, - { "unix_socket_name", UNIX_SOCKET_NAME }, }; const struct keywords *p; @@ -805,18 +791,12 @@ int parse_config(const char *filename, struct gotwebd *env) { struct sym *sym, *next; - int n; if (config_init(env) == -1) fatalx("failed to initialize configuration"); gotwebd = env; - n = snprintf(env->unix_socket_name, sizeof(env->unix_socket_name), - "%s%s", D_HTTPD_CHROOT, D_UNIX_SOCKET); - if (n < 0 || (size_t)n >= sizeof(env->unix_socket_name)) - fatalx("%s: snprintf", __func__); - file = newfile(filename, 0); if (file == NULL) { add_default_server();