X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Futil%2Fnetatalk_conf.c;h=a3f2620d8710510caed19b87d008d7fba2d56974;hb=7ef5a9ef9c2b5a5a1ec9b609310859de155b44de;hp=a1d27311a4c2e9d786efdd35dfc431acef4af60e;hpb=3a84db87064922ad10ac10cc1d6833380e575995;p=netatalk.git diff --git a/libatalk/util/netatalk_conf.c b/libatalk/util/netatalk_conf.c index a1d27311..a3f2620d 100644 --- a/libatalk/util/netatalk_conf.c +++ b/libatalk/util/netatalk_conf.c @@ -803,6 +803,8 @@ static struct vol *creatvol(AFPObj *obj, else if (strcasecmp(val, "xlateupper") == 0) volume->v_casefold = AFPVOL_ULOWERMUPPER; } + if (getoption_bool(obj->iniconfig, section, "case sensitive", preset, 1)) + volume->v_casefold |= AFPVOL_CASESENS; if (getoption_bool(obj->iniconfig, section, "read only", preset, 0)) volume->v_flags |= AFPVOL_RO; @@ -1047,14 +1049,45 @@ EC_CLEANUP: /* ---------------------- */ -static int volfile_changed(struct afp_options *p) +static int volfile_changed(AFPObj *obj) { struct stat st; + struct afp_options *p = &obj->options; + int result; + const char *includefile; - if (!stat(p->configfile, &st) && st.st_mtime > p->volfile.mtime) { + result = stat(p->configfile, &st); + if (result != 0) { + LOG(log_debug, logtype_afpd, "where is the config file %s ?", + p->configfile); + /* + * We return 1 which means "config file changed". The caller + * will re-read config and fail too which is what we want. + */ + return 1; + } + + if (st.st_mtime > p->volfile.mtime) { p->volfile.mtime = st.st_mtime; return 1; } + + includefile = atalk_iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, + "include", NULL); + if (includefile) { + result = stat(includefile, &st); + if (result != 0) { + LOG(log_debug, logtype_afpd, "where is the include file %s ?", + includefile); + return 1; + } + + if (st.st_mtime > p->includefile.mtime) { + p->includefile.mtime = st.st_mtime; + return 1; + } + } + return 0; } @@ -1430,6 +1463,7 @@ int load_volumes(AFPObj *obj, lv_flags_t flags) struct stat st; int retries = 0; struct vol *vol; + char *includefile; LOG(log_debug, logtype_afpd, "load_volumes: BEGIN"); @@ -1450,7 +1484,7 @@ int load_volumes(AFPObj *obj, lv_flags_t flags) } if (Volumes) { - if (!volfile_changed(&obj->options)) + if (!volfile_changed(obj)) goto EC_CLEANUP; have_uservol = 0; for (vol = Volumes; vol; vol = vol->v_next) { @@ -1469,6 +1503,13 @@ int load_volumes(AFPObj *obj, lv_flags_t flags) LOG(log_debug, logtype_afpd, "load_volumes: no volumes yet"); EC_ZERO_LOG( lstat(obj->options.configfile, &st) ); obj->options.volfile.mtime = st.st_mtime; + + includefile = atalk_iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, + "include", NULL); + if (includefile) { + EC_ZERO_LOG( stat(includefile, &st) ); + obj->options.includefile.mtime = st.st_mtime; + } } /* try putting a read lock on the volume file twice, sleep 1 second if first attempt fails */ @@ -1822,9 +1863,6 @@ int afp_config_parse(AFPObj *AFPObj, char *processname) options->configfile = AFPObj->cmdlineconfigfile ? strdup(AFPObj->cmdlineconfigfile) : strdup(_PATH_CONFDIR "afp.conf"); options->sigconffile = strdup(_PATH_STATEDIR "afp_signature.conf"); options->uuidconf = strdup(_PATH_STATEDIR "afp_voluuid.conf"); -#ifdef HAVE_TRACKER_SPARQL - options->slmod_path = strdup(_PATH_AFPDUAMPATH "slmod_sparql.so"); -#endif options->flags = OPTION_UUID | AFPObj->cmdlineflags; if ((config = atalk_iniparser_load(AFPObj->options.configfile)) == NULL) @@ -2114,9 +2152,6 @@ void afp_config_free(AFPObj *obj) CONFIG_ARG_FREE(obj->options.fqdn); if (obj->options.ignored_attr) CONFIG_ARG_FREE(obj->options.ignored_attr); - if (obj->options.slmod_path) - CONFIG_ARG_FREE(obj->options.slmod_path); - if (obj->options.unixcodepage) CONFIG_ARG_FREE(obj->options.unixcodepage); if (obj->options.maccodepage)