]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
Config file: when not using quotes, don't silently drop slashes in names/values.
authorBram Matthys <redacted>
Sat, 9 Sep 2023 07:41:47 +0000 (09:41 +0200)
committerBram Matthys <redacted>
Sat, 9 Sep 2023 07:41:47 +0000 (09:41 +0200)
In the config file, when not using quotes, a slash at the beginning of a
variable name or value was silently discarded (eg `file /tmp/xyz;` resulted
in a file `tmp/xyz`).

Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6325

doc/RELEASE-NOTES.md
src/conf.c

index 9092db5b8d2343f624fdc0fce88dd1cb4bff5321..6dd6086edb82f89ad75596f53346afd018ed397f 100644 (file)
@@ -847,6 +847,9 @@ about UnrealIRCd 6.
 * Several log messages were missing some information.
 * Reputation syncing across servers had a small glitch. Fix is mostly
   useful for servers that were not linked to the network for days or weeks.
+* In the config file, when not using quotes, a slash at the beginning of a
+  variable name or value was silently discarded (eg `file /tmp/xyz;` resulted
+  in a file `tmp/xyz`).
 
 ### Changes:
 * Clarified that UnrealIRCd is licensed as "GPLv2 or later"
index c989cc5de447e6abb85e3413dd2b6e4998bdda1b..ed6c8c5e5593f1c9148ae8cec58758c5f82ede3d 100644 (file)
@@ -1173,6 +1173,11 @@ ConfigFile *config_parse_with_offset(const char *filename, char *confdata, unsig
                                                return NULL;
                                        }
                                }
+                               else
+                               {
+                                       /* Something like /tmp/xyz */
+                                       goto processchar;
+                               }
                                break;
                        case '\'':
                                if (curce)
@@ -1295,6 +1300,7 @@ ConfigFile *config_parse_with_offset(const char *filename, char *confdata, unsig
 
                                break;
                        default:
+                       processchar:
                                if ((*ptr == '*') && (*(ptr+1) == '/'))
                                {
                                        config_status("%s:%i: Ignoring extra end comment\n",