X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=libatalk%2Futil%2Fnetatalk_conf.c;h=b5652608f33818347b2a342ccd14b84677d96d6a;hb=d7e5521f69859b3df89da09bf50621945f119d97;hp=1a4f9fa64de8b6feec41932bb7a5c9dd39a0a5f6;hpb=f10bc4b73e757315913214d678d33f54328fa19c;p=netatalk.git diff --git a/libatalk/util/netatalk_conf.c b/libatalk/util/netatalk_conf.c index 1a4f9fa6..b5652608 100644 --- a/libatalk/util/netatalk_conf.c +++ b/libatalk/util/netatalk_conf.c @@ -841,6 +841,8 @@ static struct vol *creatvol(AFPObj *obj, volume->v_preexec_close = 1; if (getoption_bool(obj->iniconfig, section, "root preexec close", preset, 0)) volume->v_root_preexec_close = 1; + if (vdgoption_bool(obj->iniconfig, section, "force xattr with sticky bit", preset, 0)) + volume->v_flags |= AFPVOL_FORCE_STICKY_XATTR; if ((val = getoption(obj->iniconfig, section, "ignored attributes", preset, obj->options.ignored_attr))) { if (strstr(val, "all")) { @@ -895,6 +897,8 @@ static struct vol *creatvol(AFPObj *obj, volume->v_ad_options |= ADVOL_FOLLO_SYML; if ((volume->v_flags & AFPVOL_RO)) volume->v_ad_options |= ADVOL_RO; + if ((volume->v_flags & AFPVOL_FORCE_STICKY_XATTR)) + volume->v_ad_options |= ADVOL_FORCE_STICKY_XATTR; /* Mac to Unix conversion flags*/ if ((volume->v_flags & AFPVOL_EILSEQ)) @@ -1043,14 +1047,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; + + 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 (!stat(p->configfile, &st) && st.st_mtime > p->volfile.mtime) { + 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; } @@ -1426,6 +1461,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"); @@ -1446,7 +1482,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) { @@ -1465,6 +1501,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 */