Bug 203363

Summary: Unwanted modifications of APACHE default-server.conf file over YAST2 and YAST
Product: [openSUSE] SUSE Linux 10.1 Reporter: Slawomir Ligus <oozie>
Component: YaST2Assignee: Michal Zugec <mzugec>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: i586   
OS: SuSE Linux 10.1   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Slawomir Ligus 2006-09-01 19:00:04 UTC
Hi Everybody! 

My system is top-pachted at the moment, but it does no great matter - because 
I'm able to reproduce this bug also on new installation of SUSE 10.1 Pro

YaST2 (and YaST - but not that critical) have problems editing configuration
files of APACHE. I played around with DocumentRoot entry. If you change it over
 YaST2 (GUI) and if you add a single "/" at the very end of the entry you will
lost the whole <DIRECTORY "/srv/www/htdocs"> section. This will forbid you
to access your "http://localhost/", because the rules for DocumentRoot are not 
set.

Just adding "/" to "/srv/www/htdocs" makes no sense of course, but if you want 
to alter the path to your DocumentRoot and put a "/" at the end of it, the 
following section will be cut off aswell.

YaST (textmode) it not that dangerous, it only adds a tab to 12, 23, 27 lines.
Still it's something we don't want :)

Best regards,
Slawek Ligus
Comment 1 Michal Zugec 2007-04-17 17:21:30 UTC
read/write agent fixed in 10.3
Lukas, there is problem with regexp in FileUtils::CheckAndCreatePath() function
- it removes last / character (in case of single "/" result is empty string). Could you fix it?
Comment 2 Lukas Ocilka 2007-04-18 06:32:43 UTC
Of course, fixed in yast2-2.15.29 ;)

Index: FileUtils.ycp
===================================================================
--- FileUtils.ycp       (revision 37520)
+++ FileUtils.ycp       (working copy)
@@ -274,7 +274,10 @@
         string check_path = pathvalue;
 
         // remove the final slash
-        if (regexpmatch(check_path, "/$")) check_path = regexpsub(check_path, "^(.*)/$", "\\1");
+       // but never the last one "/"
+       // bugzilla #203363
+        if (regexpmatch (check_path, "/$") && check_path != "/")
+           check_path = regexpsub (check_path, "^(.*)/$", "\\1");
         y2milestone("Checking existency of %1 path", check_path);
 
         // Directory (path) already exists
Comment 3 Michal Zugec 2007-04-18 11:36:15 UTC
Thank you
close as fixed