You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2020/06/24 09:21:32 UTC
svn commit: r1879144 - /httpd/httpd/trunk/server/util.c
Author: ylavic
Date: Wed Jun 24 09:21:32 2020
New Revision: 1879144
URL: http://svn.apache.org/viewvc?rev=1879144&view=rev
Log:
Follow up to r1879075: ap_getparents() to return the empty string above root.
Actually it was its previous behaviour before it was implemented using
ap_normalize_path() in r1879075.
Modified:
httpd/httpd/trunk/server/util.c
Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1879144&r1=1879143&r2=1879144&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Wed Jun 24 09:21:32 2020
@@ -607,7 +607,10 @@ AP_DECLARE(int) ap_normalize_path(char *
*/
AP_DECLARE(void) ap_getparents(char *name)
{
- (void)ap_normalize_path(name, AP_NORMALIZE_ALLOW_RELATIVE);
+ if (!ap_normalize_path(name, AP_NORMALIZE_NOT_ABOVE_ROOT |
+ AP_NORMALIZE_ALLOW_RELATIVE)) {
+ name[0] = '\0';
+ }
}
AP_DECLARE(void) ap_no2slash_ex(char *name, int is_fs_path)