if((p2 = strrchr(p, '/')) == NULL)
continue;
*p2 = 0;
- if(!access(t = sprintf3("%s/etc/%s", p, name), R_OK)) {
+ if(!access(t = sprintf2("%s/etc/%s", p, name), R_OK)) {
free(path);
- return(sstrdup(t));
+ return(t);
}
+ free(t);
}
free(path);
return(NULL);
{
int c;
int nodef;
- char *gcf, *lcf;
+ char *gcf, *lcf, *clcf;
struct hthead *req;
int fd;
}
}
if(lcf != NULL) {
- if((lconfig = readconfig(lcf)) == NULL)
- exit(1);
+ if(strchr(lcf, '/') == NULL) {
+ if((clcf = findstdconf(sprintf3("ashd/%s", lcf))) == NULL) {
+ flog(LOG_ERR, "could not find requested configuration `%s'", lcf);
+ exit(1);
+ }
+ if((lconfig = readconfig(clcf)) == NULL)
+ exit(1);
+ free(clcf);
+ } else {
+ if((lconfig = readconfig(lcf)) == NULL)
+ exit(1);
+ }
}
if(chdir(argv[optind])) {
flog(LOG_ERR, "could not change directory to %s: %s", argv[optind], strerror(errno));