174 // Ignore empty lines and comments |
175 // Ignore empty lines and comments |
175 if ((*line == '\n') || (*line == '\0') || (*line == '#')) |
176 if ((*line == '\n') || (*line == '\0') || (*line == '#')) |
176 continue; |
177 continue; |
177 |
178 |
178 // We only allow assignments line, except for commands "pgp", "source", |
179 // We only allow assignments line, except for commands "pgp", "source", |
179 // "color" and "otrpolicy", unless we're in runtime (i.e. not startup). |
180 // "color", "load" and "otrpolicy", unless we're in runtime (i.e. not startup). |
180 if (runtime || |
181 if (runtime || |
181 (strchr(line, '=') != NULL) || |
182 (strchr(line, '=') != NULL) || |
182 startswith(line, "pgp ", FALSE) || |
183 startswith(line, "pgp ", FALSE) || |
183 startswith(line, "source ", FALSE) || |
184 startswith(line, "source ", FALSE) || |
184 startswith(line, "color ", FALSE) || |
185 startswith(line, "color ", FALSE) || |
|
186 #ifdef MODULES_ENABLE |
|
187 startswith(line, "load ", FALSE) || |
|
188 #endif |
185 startswith(line, "otrpolicy", FALSE)) { |
189 startswith(line, "otrpolicy", FALSE)) { |
186 // Only accept a few "safe" commands |
190 // Only accept a few "safe" commands |
187 if (!runtime && |
191 if (!runtime && |
188 !startswith(line, "set ", FALSE) && |
192 !startswith(line, "set ", FALSE) && |
189 !startswith(line, "bind ", FALSE) && |
193 !startswith(line, "bind ", FALSE) && |
190 !startswith(line, "alias ", FALSE) && |
194 !startswith(line, "alias ", FALSE) && |
191 !startswith(line, "pgp ", FALSE) && |
195 !startswith(line, "pgp ", FALSE) && |
192 !startswith(line, "source ", FALSE) && |
196 !startswith(line, "source ", FALSE) && |
193 !startswith(line, "color ", FALSE) && |
197 !startswith(line, "color ", FALSE) && |
|
198 #ifdef MODULES_ENABLE |
|
199 !startswith(line, "load ", FALSE) && |
|
200 #endif |
194 !startswith(line, "otrpolicy ", FALSE)) { |
201 !startswith(line, "otrpolicy ", FALSE)) { |
195 scr_LogPrint(LPRINT_LOGNORM, "Error in configuration file (l. %d): " |
202 scr_LogPrint(LPRINT_LOGNORM, "Error in configuration file (l. %d): " |
196 "this command can't be used here", ln); |
203 "this command can't be used here", ln); |
197 err++; |
204 err++; |
198 continue; |
205 continue; |