commit 42f1746c38435ed85794eb6e852c7cb8349c2e1bc0ba36efa273593cd0a996d0 from: Stefan Sperling date: Thu Oct 2 10:49:22 2025 UTC make gotwebd warn if the webserver's user is set to root in /etc/gotwebd.conf commit - 11d14bebc977b671830614cf83306648bce10eca587a90d4e1ec2889d135caee commit + 42f1746c38435ed85794eb6e852c7cb8349c2e1bc0ba36efa273593cd0a996d0 blob - 23e900367238f93025d033b9c42ba2627814226fdfda9332a3794bb2af2caddf blob + e34533d9797aeec5fadb3790f883a3117f9d995bd77ee635d21cfdbb2ca30e66 --- gotwebd/gotwebd.c +++ gotwebd/gotwebd.c @@ -672,6 +672,10 @@ main(int argc, char **argv) fatalx("unknown user %s", www_username); env->www_uid = pw->pw_uid; www_gid = pw->pw_gid; + if (pw->pw_uid == 0 || pw->pw_gid == 0) { + warnx("warning: detected www user \"root\" in gotwebd.conf; " + "running a web server with UID/GID 0 is dangerous"); + } pw = getpwnam(gotwebd_username); if (pw == NULL)