- if (longer_path[shorter_len] == '/')
- LOG(log_info, logtype_afpd, "volume \"%s\" paths are nested: \"%s\" and \"%s\"", name, path, vol->v_path);
+ if (longer_path[shorter_len] == '/') {
+ if (!new_vol_nested && STRCMP(vol->v_cnidscheme, !=, "last")) {
+ /* the volume "vol" is nested, we must force cnidscheme "last" and read-only */
+ LOG(log_warning, logtype_afpd, "volume \"%s\" path \"%s\" is nested, set to read-only",
+ vol->v_configname, vol->v_path);
+ vol->v_flags = AFPVOL_RO;
+ free(vol->v_cnidscheme);
+ vol->v_cnidscheme = strdup("last");
+ }
+ }