Links:

https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_webdav

https://redmine.lighttpd.net/projects/1/wiki/InstallFromSource

Requirements:
  • yum install autoconf automake libtool m4 pkg-config pcre2 pcre2-devel lua lua-devel nettle nettle-devel libuuid libuuid-devel libxml2 libxmle2-devel libxml2-static sqlite sqlite-devel

  • yum -y install perl-Digest perl-Digest-MD5 perl-Encode-Locale perl-HTML-Entities-Interpolate perl-HTML-Parser perl-HTML-Tagset perl-HTTP-Date perl-HTTP-Message perl-IO-HTML perl-LWP-MediaTypes perl-Test-Harness perl-Test-Simple perl-Tie-Function perl-TimeDate
Installation
Environmnet
  • useradd lighttpd
  • conf file:
    • doc/config/lighttpd.conf
    • example:
    • Start:
      • src/lighttpd -D -f doc/config/lighttpd.conf -m $PWD/src/.libs
Bug Fixing per il modulo webdav:

Nel modulo src/mod_webdav.c c'e' la funzione webdav_propfind_dir() che dentro usa un flag che non permette di seguire il symlink della directory.

Messo a 1 tutto funziona.

Questo e' il codice con la modifica:

static void
webdav_propfind_dir (webdav_propfind_bufs * const restrict pb)
{
    /* arbitrary recursion limit to prevent infinite loops,
     * e.g. due to symlink loops, or excessive resource usage */
    if (++pb->recursed > 100) return;

    physical_st * const dst = pb->dst;
  #ifndef _ATFILE_SOURCE /*(not using fdopendir unless _ATFILE_SOURCE)*/
    const int dfd = -1;
    DIR * const dir = opendir(dst->path.ptr);
  #else
/*  EGO: il secondo argomento in fdevent_open_dirname indica se seguire o meno
         il symlink nel caso che sia una directory.
         Stranamente e' messo a 0 senza fare controlli sulla configurazione di
         webdav.opts += ("unsafe-propfind-follow-symlink" => "enable")
         Dato che nel nostro caso usiamo webdav solo in readonly lo forziamo a 1
    Riga originale: const int dfd = fdevent_open_dirname(dst->path.ptr, 0);
*/
    const int dfd = fdevent_open_dirname(dst->path.ptr, 1);
    DIR * const dir = (dfd >= 0) ? fdopendir(dfd) : NULL;
  #endif
    if (NULL == dir) {
        int errnum = errno;
        if (dfd >= 0) close(dfd);
        if (errnum != ENOENT)
            webdav_propfind_resource_403(pb); /* Forbidden */
        return;
    }
Topic revision: r3 - 30 Jun 2023, Dibiase
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Wiki_Virgo_LSC? Send feedback