summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/webdavcgi/files')
-rw-r--r--www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch21
-rw-r--r--www-apps/webdavcgi/files/apache-webdavcgi-0.8-example.conf59
-rw-r--r--www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf7
-rw-r--r--www-apps/webdavcgi/files/postinstall-en.txt29
-rw-r--r--www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt32
-rw-r--r--www-apps/webdavcgi/files/reconfig32
-rw-r--r--www-apps/webdavcgi/files/reconfig-suid26
-rw-r--r--www-apps/webdavcgi/files/webdav-0.8.conf88
-rw-r--r--www-apps/webdavcgi/files/webdavcgi-1.1.2-fix-unescaped-braces.patch98
9 files changed, 102 insertions, 290 deletions
diff --git a/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch b/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch
deleted file mode 100644
index 739ff7f4c79b..000000000000
--- a/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ru cgi-bin.orig/logout-dist cgi-bin/logout-dist
---- cgi-bin.orig/logout-dist 2011-03-22 17:25:52.000000000 +0100
-+++ cgi-bin/logout-dist 2012-10-03 21:44:35.057437306 +0200
-@@ -34,13 +34,13 @@
- # -----
- ### REALM: the basic authentication realm
- ### (must be equal to your AuthName value for Apache)
--REALM="Change Me"
-+REALM="${REALM:=Change Me}"
-
- ### HOMEURL: the home URL
--HOMEURL="/changemyhomeurl"
-+HOMEURL="${HOMEURL:=/changemyhomeurl}"
-
--### TIMEOUT: the refresh timeout for the logut page
--TIMEOUT=0
-+### TIMEOUT: the refresh timeout for the logout page
-+TIMEOUT=${TIMEOUT:=0}
-
- # SETUP END
-
diff --git a/www-apps/webdavcgi/files/apache-webdavcgi-0.8-example.conf b/www-apps/webdavcgi/files/apache-webdavcgi-0.8-example.conf
deleted file mode 100644
index cf1d4d4dafe0..000000000000
--- a/www-apps/webdavcgi/files/apache-webdavcgi-0.8-example.conf
+++ /dev/null
@@ -1,59 +0,0 @@
-# Example Apache HTTP server configuration snippet for WebDAV CGI
-#
-# Add the following lines to the Apache HTTP virtual host which should run
-# WebDAV CGI.
-#
-# WebDAV CGI will be accessible via http://www.example.com/webdav/ and uses
-# basic HTTP authentication (by default). For this to work, you need to add all
-# valid users to the AuthUserFile with the help of the htpasswd command:
-#
-# htpasswd -c /etc/webdavcgi-0.8/default/users.htpasswd user1
-# htpasswd /etc/webdavcgi-0.8/default/users.htpasswd user2
-#
-# Note, that if you have the UID/GID wrapper enabled (USE=suid), WebDAV CGI will
-# switch to the login user after a successful login, thus the users within the
-# AuthType need to present on the system as well.
-#
-# You probably want to review and change the following settings:
-# - /webdavcgi should point to your desired webdavwrapper, which is either
-# webdavwrapper, webdavwrapper-afs, webdavwrapper-krb or in case you disabled
-# the UID/GID wrapper (USE=-suid), webdav.pl
-#
-# - The /webdav location
-# If you change this location, make sure to reflect the new path within the
-# WebDAV CGI configuration (WEBDAVCONF -> $VIRTUAL_BASE) as well.
-#
-# - The authentication provider and/or AuthUserFile
-#
-# - The HOMEURL environment variable. After a user logs out, the browser will
-# be redirected to this URL.
-#
-# - The WEBDAVCONF environment variable has to point to your configuration
-#
-# For further informations and other configuration possibilities consult the
-# WebDAV CGI documentation which is located at http://webdavcgi.sourceforge.net
-# and the Apache HTTP server documentation at https://httpd.apache.org/docs/
-#
- ScriptAlias /webdavcgi "/usr/libexec/webdavcgi-0.8/cgi-bin/webdavwrapper"
- ScriptAlias /webdav/logout "/usr/libexec/webdavcgi-0.8/cgi-bin/logout"
-
- <Location /webdav>
- Order Allow,Deny
- Allow from all
- </Location>
-
- <Location /webdavcgi>
- AuthType Basic
- AuthName "WebDAV-CGI"
- AuthUserFile /etc/webdavcgi-0.8/default/users.htpasswd
- Require valid-user
- Order Allow,Deny
- Allow from all
- </Location>
-
-
- RewriteEngine On
-
- RewriteRule ^/webdav/logout - [L,E=REALM:WebDAV-CGI,E=HOMEURL:/webdav,E=TIMEOUT:5]
-
- RewriteRule ^/webdav /webdavcgi [PT,L,E=WEBDAVCONF:/etc/webdavcgi-0.8/default/webdav.conf,E=PERLLIB:/usr/share/webdavcgi-0.8/lib/perl,E=LOGOUTURL:/webdav/logout]
diff --git a/www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf b/www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf
index 4ee926fbd7c7..900e0ba5a2c4 100644
--- a/www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf
+++ b/www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf
@@ -30,9 +30,10 @@
#
# - The WEBDAVCONF environment variable has to point to your configuration
#
-# For further informations and other configuration possibilities consult the
-# WebDAV CGI documentation which is located at http://webdavcgi.sourceforge.net
-# and the Apache HTTP server documentation at https://httpd.apache.org/docs/
+# For further information and other configuration possibilities consult the
+# WebDAV CGI documentation and Apache HTTP server documentation:
+# * https://danrohde.github.io/webdavcgi/doc.html
+# * https://httpd.apache.org/docs/
#
ScriptAlias /webdavcgi "/usr/libexec/webdavcgi-1.1/cgi-bin/webdavwrapper"
ScriptAlias /webdav/logout "/usr/libexec/webdavcgi-1.1/cgi-bin/logout"
diff --git a/www-apps/webdavcgi/files/postinstall-en.txt b/www-apps/webdavcgi/files/postinstall-en.txt
deleted file mode 100644
index 8aa6f95d87a2..000000000000
--- a/www-apps/webdavcgi/files/postinstall-en.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Before you can run WebDAV CGI you need to configure your web server and WebDAV
-CGI itself.
-
-The following configuration snippet serves as an example for the Apache HTTPD
-web server. You will have to adapt it to suite your own server and configuration
-needs.
-
- ScriptAlias /cgi-bin/ "${VHOST_CGIBINDIR}/"
-
- <Location /${VHOST_CGIBINDIR##*/}/>
- AuthType Basic
- AuthName "WebDAV-CGI"
- AuthUserFile ${VHOST_ROOT}/etc/users.htpasswd
- Require valid-user
- Order Allow,Deny
- Allow from all
- </Location>
-
- RewriteEngine On
- RewriteRule ^/${VHOST_APPDIR}/logout /${VHOST_CGIBINDIR##*/}/logout [PT,E=REALM:WebDAV-CGI,E=HOMEURL:/${VHOST_APPDIR},L]
- RewriteRule ^/${VHOST_APPDIR} /${VHOST_CGIBINDIR##*/}/webdav.pl [PT,E=WEBDAVCONF:${VHOST_ROOT}/etc/webdav.conf,E=PERLLIB:${VHOST_ROOT}/lib/perl,L]
-
-
-Afterwards you need to copy the default configuration file and edit it:
-cp -p ${VHOST_ROOT}/etc/{webdav.conf-dist,webdav.conf}
-\$EDITOR ${VHOST_ROOT}/etc/webdav.conf
-
-For further informations study the online documentation which is located at:
-http://webdavcgi.sourceforge.net/doc.html
diff --git a/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt b/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt
deleted file mode 100644
index 5f30d81be7b6..000000000000
--- a/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-Before you can run WebDAV CGI you need to configure your web server and WebDAV
-CGI itself.
-
-The following configuration snippet serves as an example for the Apache HTTPD
-web server. You will have to adapt it to suite your own server and configuration
-needs.
-
- ScriptAlias /cgi-bin/ "${VHOST_CGIBINDIR}/"
-
- <Location /${VHOST_CGIBINDIR##*/}/>
- AuthType Basic
- AuthName "WebDAV-CGI"
- AuthUserFile ${VHOST_ROOT}/etc/users.htpasswd
- Require valid-user
- Order Allow,Deny
- Allow from all
- </Location>
-
- RewriteEngine On
- RewriteRule ^/${VHOST_APPDIR}/logout /${VHOST_CGIBINDIR##*/}/logout [PT,E=REALM:WebDAV-CGI,E=HOMEURL:/${VHOST_APPDIR},L]
- RewriteRule ^/${VHOST_APPDIR} /${VHOST_CGIBINDIR##*/}/webdavwrapper [PT,E=WEBDAVCONF:${VHOST_ROOT}/etc/webdav.conf,E=PERLLIB:${VHOST_ROOT}/lib/perl,L]
-
-
-Afterwards you need to copy the default configuration file and edit it:
-cp -p ${VHOST_ROOT}/etc/{webdav.conf-dist,webdav.conf}
-\$EDITOR ${VHOST_ROOT}/etc/webdav.conf
-
-Also make sure that all system users which should be able to login to WebDAV CGI
-are able to access the installed files below ${VHOST_ROOT}.
-
-For further informations study the online documentation which is located at:
-http://webdavcgi.sourceforge.net/doc.html
diff --git a/www-apps/webdavcgi/files/reconfig b/www-apps/webdavcgi/files/reconfig
deleted file mode 100644
index 07710dd7c3e9..000000000000
--- a/www-apps/webdavcgi/files/reconfig
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-confDir="etc"
-distConfFile="webdav.conf-dist"
-
-sedCmd="/bin/sed"
-
-
-function die ()
-{
- echo "reconfig error: $1" >&2
- exit 1
-}
-
-
-if [ $1 != "install" ]; then
- # nothing to be done, exit
- exit 0
-fi
-
-# Set the correct path within the config file
-distConfFilePath="${VHOST_ROOT}/${confDir}/${distConfFile}"
-if ! ${sedCmd} -i -e "s|^\(\$INSTALL_BASE\)=.*|\1='${VHOST_ROOT}/';|" \
- ${distConfFilePath}
-then
- die "Setting INSTALL_BASE path in ${distConfFilePath} failed"
-fi
-
-
-# Adding logout support
-# see: http://webdavcgi.sourceforge.net/doc.html#logout
-echo "\$HEADER = '<div class=\"header\">WebDAV CGI - Web interface: You are logged in as <span title="'.`id -a`.'">' .\$ENV{REMOTE_USER}.'</span> (<a href="/logout">Logout</a>).</div>';" >> ${distConfFilePath}
diff --git a/www-apps/webdavcgi/files/reconfig-suid b/www-apps/webdavcgi/files/reconfig-suid
deleted file mode 100644
index d7fb87722614..000000000000
--- a/www-apps/webdavcgi/files/reconfig-suid
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-webDavWrapper="webdavwrapper"
-webDavWrapperPath="${VHOST_CGIBINDIR}/${webDavWrapper}"
-
-chmodCmd="/bin/chmod"
-chownCmd="/bin/chown"
-
-
-function die ()
-{
- echo "reconfig error: $1" >&2
- exit 1
-}
-
-if [ $1 = "install" ]; then
- # In order to change the user and group ID at runtime, the webdavwrapper
- # needs to be run as root (set-user-ID and set-group-ID bit)
- if ! ${chownCmd} root:root ${webDavWrapperPath}; then
- die "Chown for ${webDavWrapperPath} failed"
- fi
-
- if ! ${chmodCmd} 6755 ${webDavWrapperPath}; then
- die "Setting SUID and SGID bit on ${webDavWrapperPath} failed"
- fi
-fi
diff --git a/www-apps/webdavcgi/files/webdav-0.8.conf b/www-apps/webdavcgi/files/webdav-0.8.conf
deleted file mode 100644
index 8563df7ad617..000000000000
--- a/www-apps/webdavcgi/files/webdav-0.8.conf
+++ /dev/null
@@ -1,88 +0,0 @@
-## -- INSTALL_BASE
-## folder path to the webdav.conf, .css, .js, and. msg files for the Web
-## interface
-## (don't forget the trailing slash)
-$INSTALL_BASE='/usr/share/webdavcgi-0.8/';
-
-## -- VIRTUAL_BASE
-## only neccassary if you use redirects or rewrites from a VIRTUAL_BASE to
-## the DOCUMENT_ROOT;
-## regular expressions are allowed
-## EXAMPLE: $VIRTUAL_BASE = '/';
-$VIRTUAL_BASE = '/webdav';
-
-## -- DOCUMENT_ROOT
-## by default the server document root
-## (don't forget a trailing slash '/'):
-$DOCUMENT_ROOT = '/home/';
-
-## -- UMASK
-## mask for file/folder creation
-## (it does not change permission of existing files/folders):
-$UMASK = 0007;
-
-## -- ENABLE_DAVMOUNT
-## enables DAV mount button in the folder navigation of the Web interface
-$ENABLE_DAVMOUNT = 1;
-
-## -- ENABLE_COMPRESSION
-## enables/disables gzip content encoding for the Web interface
-$ENABLE_COMPRESSION = 0;
-
-## -- PAGE_LIMIT
-## limits number of files/folders shown in the Web interface
-$PAGE_LIMIT=100;
-
-## -- PAGE_LIMITS
-## allowed selectable limits (-1 = show all)
-@PAGE_LIMITS = ( 5, 10, 15, 20, 30, 50, 100, -1);
-
-## -- DBI_(SRC/USER/PASS)
-## database setup for LOCK/UNLOCK/PROPPATCH/PROPFIND data
-##
-## SQLite config
-## If users share the same folder they should use the same database
-## in this case you have to use a single file writeable for all users.
-#$DBI_SRC='dbi:SQLite:dbname=/var/lib/webdavcgi/0.8/default/webdav.db';
-#$DBI_USER='';
-#$DBI_PASS='';
-#$CREATE_DB = !-e '/var/lib/webdavcgi/0.8/default/webdav.db';
-
-## MySQL config
-#$DBI_SRC='DBI:mysql:database=webdavcgi;host=localhost;port=3306';
-#$DBI_USER='mysqluser';
-#$DBI_PASS='changeme';
-#$CREATE_DB=0;
-
-## PostgreSQL config
-#$DBI_SRC='dbi:Pg:dbname=webdavcgi;host=localhost;port=5432';
-#$DBI_USER='pguser';
-#$DBI_PASS='changeme';
-#$CREATE_DB = 0;
-
-## -- HEADER
-## content after body tag in the Web interface
-$HEADER = '<div class="header">WebDAV CGI - Web interface: You are logged in as <span title=.`id -a`.>' .$ENV{REMOTE_USER}.'</span> (<a href="'.$ENV{LOGOUTURL}.'">Logout</a>).</div>';
-
-## -- ENABLE_CALDAV
-## Disable CalDAV support for Lightning/Sunbird/iCal/iPhone calender/task
-## support
-$ENABLE_CALDAV = 0;
-
-## -- ENABLE_GROUPDAV
-## Disables GroupDAV (http://groupdav.org/draft-hess-groupdav-01.txt)
-$ENABLE_GROUPDAV = 0;
-
-## -- ENABLE_THUMBNAIL
-## Disable image thumbnail support and media rss feed for folder listings of the
-## Web interface.
-## If enabled the default icons for images will be replaced by thumbnails
-## and if the mouse is over a icon the icon will be zoomed to the size of
-## $THUMBNAIL_WIDTH.
-$ENABLE_THUMBNAIL = 0;
-
-## -- THUMBNAIL_CACHEDIR
-## defines the path to a cache directory for image thumbnails
-## this is neccessary if you enable the thumbnail cache ($ENABLE_THUMBNAIL_CACHE)
-## EXAMPLE: $THUMBNAIL_CACHEDIR=".thumbs";
-$THUMBNAIL_CACHEDIR="/var/cache/webdavcgi/0.8/default/thumbnails";
diff --git a/www-apps/webdavcgi/files/webdavcgi-1.1.2-fix-unescaped-braces.patch b/www-apps/webdavcgi/files/webdavcgi-1.1.2-fix-unescaped-braces.patch
new file mode 100644
index 000000000000..3b3262bfd088
--- /dev/null
+++ b/www-apps/webdavcgi/files/webdavcgi-1.1.2-fix-unescaped-braces.patch
@@ -0,0 +1,98 @@
+diff --git a/lib/perl/Requests/WebDAVRequest.pm b/lib/perl/Requests/WebDAVRequest.pm
+index 8d5b89e6..2b6ea4d9 100644
+--- a/lib/perl/Requests/WebDAVRequest.pm
++++ b/lib/perl/Requests/WebDAVRequest.pm
+@@ -134,7 +134,7 @@ sub get_prop_stat {
+ $fn .= $is_dir && $fn !~ /\/$/xms ? q{/} : q{};
+ foreach my $prop ( @{$props} ) {
+ my ( $xmlnsuri, $propname ) = ( 'DAV:', $prop );
+- if ( $prop =~ /^{([^}]*)}(.*)$/xms ) {
++ if ( $prop =~ /^[{]([^}]*)[}](.*)$/xms ) {
+ ( $xmlnsuri, $propname ) = ( $1, $2 );
+ }
+
+diff --git a/lib/perl/WebDAV/Properties.pm b/lib/perl/WebDAV/Properties.pm
+index 2baf319b..a9ee2d73 100644
+--- a/lib/perl/WebDAV/Properties.pm
++++ b/lib/perl/WebDAV/Properties.pm
+@@ -139,7 +139,7 @@ sub set_property {
+ my $rfn = $self->resolve($fn);
+ my $ru = $REQUEST_URI;
+ my ( $ns, $pn );
+- if ( $propname =~ /^{([^}]+)}(.*)$/xms ) {
++ if ( $propname =~ /^[{]([^}]+)[}](.*)$/xms ) {
+ ( $ns, $pn ) = ( $1, $2 );
+ }
+
+@@ -186,7 +186,7 @@ sub set_property {
+ if ( $parref
+ && ref($parref) eq 'HASH'
+ && ( !${$parref}{xmlns} || ${$parref}{xmlns} eq q{} )
+- && $n !~ /^{[^}]*}/xms )
++ && $n !~ /^[{][^}]*[}]/xms )
+ {
+ $n = '{}' . $n;
+ }
+diff --git a/lib/perl/WebDAV/XMLHelper.pm b/lib/perl/WebDAV/XMLHelper.pm
+index 10ec2ceb..c8116927 100644
+--- a/lib/perl/WebDAV/XMLHelper.pm
++++ b/lib/perl/WebDAV/XMLHelper.pm
+@@ -229,7 +229,7 @@ sub get_namespace_uri {
+
+ sub nonamespace {
+ my ($prop) = @_;
+- $prop =~ s/^{[^}]*}//xms;
++ $prop =~ s/^[{][^}]*[}]//xms;
+ return $prop;
+ }
+
+diff --git a/lib/perl/WebInterface/Common.pm b/lib/perl/WebInterface/Common.pm
+index a4236fae..6fa904cf 100644
+--- a/lib/perl/WebInterface/Common.pm
++++ b/lib/perl/WebInterface/Common.pm
+@@ -562,7 +562,7 @@ sub _get_varref {
+ if ( defined $self->{$str} ) {
+ return $self->{$str};
+ }
+- if ($str=~/^(.*){(.*?)}/xms) {
++ if ($str=~/^(.*)[{](.*?)[}]/xms) {
+ $ref = $DefaultConfig::{$1}{$2};
+ return $ref;
+ }
+diff --git a/lib/perl/WebInterface/Extension/PropertiesViewer.pm b/lib/perl/WebInterface/Extension/PropertiesViewer.pm
+index 2f6223e8..be7ba438 100644
+--- a/lib/perl/WebInterface/Extension/PropertiesViewer.pm
++++ b/lib/perl/WebInterface/Extension/PropertiesViewer.pm
+@@ -157,7 +157,7 @@ sub _render_viewer {
+ my $title = create_xml( $r200{prop}, 1 );
+ my $value = create_xml( $r200{prop}{$prop}, 1 );
+ my $namespace = get_namespace_uri($prop);
+- if ( $prop =~ /^{([^}]*)}/xms ) {
++ if ( $prop =~ /^[{]([^}]*)[}]/xms ) {
+ $namespace = $1;
+ }
+ push @bgstyleclasses, shift @bgstyleclasses;
+diff --git a/lib/perl/WebInterface/View/Simple/RenderFileListTable.pm b/lib/perl/WebInterface/View/Simple/RenderFileListTable.pm
+index 44cfd894..972d431f 100644
+--- a/lib/perl/WebInterface/View/Simple/RenderFileListTable.pm
++++ b/lib/perl/WebInterface/View/Simple/RenderFileListTable.pm
+@@ -85,7 +85,7 @@ sub render_file_list_table {
+ unselectable => $self->is_unselectable($fn) ? 'yes' : 'no',
+ );
+ $filelisttabletemplate =~
+- s/[\$]{?(\w+)}?/exists $stdvars{$1} && defined $stdvars{$1}?$stdvars{$1}:"\$$1"/xmegs;
++ s/[\$][{]?(\w+)[}]?/exists $stdvars{$1} && defined $stdvars{$1}?$stdvars{$1}:"\$$1"/xmegs;
+ my %jsondata = (
+ content => $self->minify_html(
+ $self->render_template( $fn, $ru, $filelisttabletemplate )
+@@ -253,8 +253,8 @@ sub _render_file_list_entry {
+ my $displayname = $self->{cgi}->escapeHTML( $self->{backend}->getDisplayName($full) );
+ my $now = $self->{c}{_render_file_list_entry}{now}{$lang} //= DateTime->now( locale => $lang );
+ my $cct = $self->can_create_thumb($full);
+- my $u = $self->{c}{_render_file_list_entry}{uid}{$uid // 'unknown'} //= $uid && $uid=~/^\d+$/xms ? scalar getpwuid( $uid ) : $uid ? $uid : 'unknown';
+- my $g = $self->{c}{_render_file_list_entry}{gid}{$gid // 'unknown'} //= $gid && $gid=~/^\d+$/xms ? scalar getgrgid( $gid ) : $gid ? $gid : 'unknown';
++ my $u = $self->{c}{_render_file_list_entry}{uid}{$uid // 'unknown'} //= $uid && $uid=~/^\d+$/xms ? scalar getpwuid( $uid ) // $uid: $uid ? $uid : 'unknown';
++ my $g = $self->{c}{_render_file_list_entry}{gid}{$gid // 'unknown'} //= $gid && $gid=~/^\d+$/xms ? scalar getgrgid( $gid ) // $gid: $gid ? $gid : 'unknown';
+ my $icon = $self->{c}{_render_file_list_entry}{icon}{$mime}
+ //= $self->get_icon($mime);
+ my $enthumb = $self->{c}{_render_file_list_entry}{cookie}{thumbnails}