- /* Read per-user configuration file. */
- snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, _PATH_SSH_USER_CONFFILE);
- read_config_file(buf, host, &options);
-
- /* Read systemwide configuration file. */
- read_config_file(_PATH_HOST_CONFIG_FILE, host, &options);
+ /*
+ * Read per-user configuration file. Ignore the system wide config
+ * file if the user specifies a config file on the command line.
+ */
+ if (config != NULL) {
+ read_config_file(config, host, &options);
+ } else {
+ snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir,
+ _PATH_SSH_USER_CONFFILE);
+
+ /* Read systemwide configuration file. */
+ read_config_file(_PATH_HOST_CONFIG_FILE, host, &options);
+ read_config_file(buf, host, &options);
+ }