X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fvolume.c;h=8079966310bf68a37cad2285e278545eab23652d;hb=9480b301ae3cd89122e7100f0ae052f3d6eaabf8;hp=f50354e047acfd36331549c3850f1b09cd563075;hpb=1f26e97286e30cfe04c48a5868dc8df538379893;p=netatalk.git diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index f50354e0..80799663 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -146,10 +146,10 @@ typedef struct _special_folder { } _special_folder; static const _special_folder special_folders[] = { - {"Network Trash Folder", 1, 0777, 1}, - {"Temporary Items", 1, 0777, 1}, {".AppleDesktop", 1, 0777, 0}, #if 0 + {"Network Trash Folder", 1, 0777, 1}, + {"Temporary Items", 1, 0777, 1}, {"TheFindByContentFolder", 0, 0, 1}, {"TheVolumeSettingsFolder", 0, 0, 1}, #endif @@ -426,7 +426,7 @@ static void volset(struct vol_option *options, struct vol_option *save, setoption(options, save, VOLOPT_ROLIST, val); } else if (optionok(tmp, "codepage:", val)) { - LOG (log_error, logtype_afpd, "The old codepage system has been removed. Please make sure to read the documentation !!!!"); + LOG (log_error, logtype_afpd, "The old codepage system has been removed. Please make sure to read the documentation!"); /* Make sure we don't screw anything */ exit (EXITERR_CONF); } else if (optionok(tmp, "volcharset:", val)) { @@ -513,6 +513,8 @@ static void volset(struct vol_option *options, struct vol_option *save, options[VOLOPT_FLAGS].i_value |= AFPVOL_NONETIDS; else if (strcasecmp(p, "noacls") == 0) options[VOLOPT_FLAGS].i_value &= ~AFPVOL_ACLS; + else if (strcasecmp(p, "followsymlinks") == 0) + options[VOLOPT_FLAGS].i_value |= AFPVOL_FOLLOWSYM; p = strtok(NULL, ","); } @@ -778,6 +780,8 @@ static int creatvol(AFPObj *obj, struct passwd *pwd, volume->v_ad_options |= ADVOL_INVDOTS; if ((volume->v_flags & AFPVOL_NOADOUBLE)) volume->v_ad_options |= ADVOL_NOADOUBLE; + if ((volume->v_flags & AFPVOL_FOLLOWSYM)) + volume->v_ad_options |= ADVOL_FOLLO_SYML; if (options[VOLOPT_PASSWORD].c_value) volume->v_password = strdup(options[VOLOPT_PASSWORD].c_value); @@ -1550,7 +1554,7 @@ static int get_tm_used(struct vol * restrict vol) EC_FAIL; vol->v_tm_used += vol->v_appended; vol->v_appended = 0; - LOG(log_error, logtype_afpd, "getused(\"%s\"): cached: %" PRIu64 " bytes", + LOG(log_debug, logtype_afpd, "getused(\"%s\"): cached: %" PRIu64 " bytes", vol->v_path, vol->v_tm_used); return 0; } @@ -1589,7 +1593,7 @@ EC_CLEANUP: if (dir) closedir(dir); - LOG(log_error, logtype_afpd, "getused(\"%s\"): %" PRIu64 " bytes", vol->v_path, vol->v_tm_used); + LOG(log_debug, logtype_afpd, "getused(\"%s\"): %" PRIu64 " bytes", vol->v_path, vol->v_tm_used); EC_EXIT; } @@ -1638,15 +1642,15 @@ static int getvolspace(struct vol *vol, getvolspace_done: if (vol->v_limitsize) { - if ((used = get_tm_used(vol)) == -1) + if (get_tm_used(vol) != 0) return AFPERR_MISC; *xbtotal = MIN(*xbtotal, (vol->v_limitsize * 1024 * 1024)); - *xbfree = MIN(*xbfree, *xbtotal < used ? 0 : *xbtotal - used); + *xbfree = MIN(*xbfree, *xbtotal < vol->v_tm_used ? 0 : *xbtotal - vol->v_tm_used); - LOG(log_error, logtype_afpd, + LOG(log_debug, logtype_afpd, "volparams: total: %" PRIu64 ", used: %" PRIu64 ", free: %" PRIu64 " bytes", - *xbtotal, used, *xbfree); + *xbtotal, vol->v_tm_used, *xbfree); } *bfree = MIN(*xbfree, maxsize);