[yast-commit] r54287 - in /trunk/instserver: package/yast2-instserver.changes src/Instserver.ycp
Author: lslezak Date: Fri Dec 19 13:00:25 2008 New Revision: 54287 URL: http://svn.opensuse.org/viewcvs/yast?rev=54287&view=rev Log: - do not configure vsftpd in xinetd mode if it's set to standalone mode in the config file (bnc#438694) Modified: trunk/instserver/package/yast2-instserver.changes trunk/instserver/src/Instserver.ycp Modified: trunk/instserver/package/yast2-instserver.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/instserver/package/yast2-instserver.changes?rev=54287&r1=54286&r2=54287&view=diff ============================================================================== --- trunk/instserver/package/yast2-instserver.changes (original) +++ trunk/instserver/package/yast2-instserver.changes Fri Dec 19 13:00:25 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Dec 19 12:57:33 CET 2008 - lslezak@suse.cz + +- do not configure vsftpd in xinetd mode if it's set to standalone + mode in the config file (bnc#438694) + +------------------------------------------------------------------- Wed Oct 15 15:38:13 CEST 2008 - lslezak@suse.cz - fixed UI syntax error when asking for a CD (bnc#435658) Modified: trunk/instserver/src/Instserver.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/instserver/src/Instserver.ycp?rev=54287&r1=54286&r2=54287&view=diff ============================================================================== --- trunk/instserver/src/Instserver.ycp (original) +++ trunk/instserver/src/Instserver.ycp Fri Dec 19 13:00:25 2008 @@ -300,59 +300,78 @@ y2warning("not implemented"); } - y2debug("configuring services"); - // read the current configuration - map resource = (map)ReadServiceSettings("inetd_auto"); - list<map> netdconf = []; - - // replace vsftpd config - boolean ftpdenabled = false; - boolean servicefound = false; - foreach(map conf, resource["netd_conf"]:[], { - // the service is ftp with vsftpd server - if (conf["service"]:"" == "ftp" && conf["script"]:"" == "vsftpd") - { - servicefound = true; - - // enable disabled service - if (conf["enabled"]:false != true) - { - conf["enabled"] = true; - } - else + // check if vsftpd is configured in standalone mode (listen=YES) (bnc#438694) + // see 'man vsftpd.conf' + boolean vsftpd_standalone = SCR::Execute(.target.bash, "grep -q '^listen=YES$' /etc/vsftpd.conf") == 0; + + if (vsftpd_standalone) + { + y2milestone("Configuring FTP service in standalone mode"); + + // enable/start the service + Service::Enable("vsftpd"); + if (Service::Status("vsftpd") == 0 ) + Service::Reload("vsftpd"); + else + Service::Start("vsftpd"); + } + else + { + y2milestone("Configuring FTP service in xinetd mode"); + // read the current configuration + map resource = (map)ReadServiceSettings("inetd_auto"); + list<map> netdconf = []; + + // replace vsftpd config + boolean ftpdenabled = false; + boolean servicefound = false; + foreach(map conf, resource["netd_conf"]:[], { + // the service is ftp with vsftpd server + if (conf["service"]:"" == "ftp" && conf["script"]:"" == "vsftpd") { - ftpdenabled = true; + servicefound = true; + + // enable disabled service + if (conf["enabled"]:false != true) + { + conf["enabled"] = true; + } + else + { + ftpdenabled = true; + } } + + // add the configuration to the list + netdconf = add(netdconf, conf); } + ); - // add the configuration to the list - netdconf = add(netdconf, conf); + if (servicefound == false) + { + // the FTP service config was not found, add it + map vsftpdconf = $["protocol":"tcp", "script":"vsftpd", "server":"/usr/sbin/vsftpd", "service":"ftp"]; + netdconf = add(netdconf, vsftpdconf); } - ); - if (servicefound == false) - { - // the FTP service config was not found, add it - map vsftpdconf = $["protocol":"tcp", "script":"vsftpd", "server":"/usr/sbin/vsftpd", "service":"ftp"]; - netdconf = add(netdconf, vsftpdconf); - } + // ftp service was not enabled/configured + if (ftpdenabled == false) + { + // update the configuration + resource["netd_conf"] = netdconf; - // ftp service was not enabled/configured - if (ftpdenabled == false) - { - // update the configuration - resource["netd_conf"] = netdconf; + // write the configuration + ConfigureService("inetd_auto", resource); + } - // write the configuration - ConfigureService("inetd_auto", resource); + // enable/start the service + Service::Enable("xinetd"); + if (Service::Status("xinetd") == 0 ) + Service::Reload("xinetd"); + else + Service::Start("xinetd"); } - // enable/start the service - Service::Enable("xinetd"); - if (Service::Status("xinetd") == 0 ) - Service::Reload("xinetd"); - else - Service::Start("xinetd"); return true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn.opensuse.org