Author: juhliarik
Date: Thu Nov 13 18:22:02 2008
New Revision: 53293
URL: http://svn.opensuse.org/viewcvs/yast?rev=53293&view=rev
Log:
fix problems with anonymous upload
Modified:
trunk/ftp-server/package/yast2-ftp-server.changes
trunk/ftp-server/src/FtpServer.ycp
trunk/ftp-server/src/complex.ycp
trunk/ftp-server/src/dialogs.ycp
trunk/ftp-server/src/wid_functions.ycp
trunk/ftp-server/src/write_load.ycp
Modified: trunk/ftp-server/package/yast2-ftp-server.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/package/yast2-ftp-server.changes?rev=53293&r1=53292&r2=53293&view=diff
==============================================================================
--- trunk/ftp-server/package/yast2-ftp-server.changes (original)
+++ trunk/ftp-server/package/yast2-ftp-server.changes Thu Nov 13 18:22:02 2008
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Thu Nov 13 18:18:38 CET 2008 - juhliarik@suse.cz
+
+- added fix for settings upload directory for anonymous
+ (bnc #409203)
+- fixed typo (bnc #438092)
+- 2.17.2
+
+-------------------------------------------------------------------
Tue Sep 30 18:12:18 CEST 2008 - juhliarik@suse.cz
- corrected typo in help text (bnc #407517)
Modified: trunk/ftp-server/src/FtpServer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/FtpServer.ycp?rev=53293&r1=53292&r2=53293&view=diff
==============================================================================
--- trunk/ftp-server/src/FtpServer.ycp (original)
+++ trunk/ftp-server/src/FtpServer.ycp Thu Nov 13 18:22:02 2008
@@ -382,7 +382,7 @@
list <string> directories = filter(string key, splitstring(anon_homedir, "/"), {return (key != "");});
- y2milestone("[ftp-server] (ReadPermisionUplaod) rozzekane directories...: %1 ",directories);
+ y2milestone("[ftp-server] (ReadPermisionUplaod) split directories...: %1 ",directories);
if (size(directories) == 1 ) {
directory = "/";
@@ -489,7 +489,9 @@
//y2milestone("---------------------------------------------");
if ((anon_homedir != "") && (anon_homedir != nil)) {
if (EDIT_SETTINGS["FtpDirAnon"]:nil == "")
- EDIT_SETTINGS["FtpDirAnon"] = anon_homedir;
+ EDIT_SETTINGS["FtpDirAnon"] = anon_homedir;
+ else if (EDIT_SETTINGS["FtpDirAnon"]:nil != nil)
+ anon_homedir = EDIT_SETTINGS["FtpDirAnon"]:nil;
}
}
//read firewall settings
@@ -710,7 +712,7 @@
string upload ="";
map options = $[];
integer authentication = tointeger(EDIT_SETTINGS["AnonAuthen"]:nil);
- if ((vsftpd_edit) && (authentication == 0) && (create_upload_dir) && (upload_good_permission)) {
+ if ((vsftpd_edit) && (authentication != 1) && (create_upload_dir) && (upload_good_permission)) {
boolean write_enable = ((EDIT_SETTINGS["EnableUpload"]:nil == "YES") ? true:false);
boolean anon_upload = ((EDIT_SETTINGS["AnonReadOnly"]:nil == "NO") ? true:false);
boolean anon_create_dirs = ((EDIT_SETTINGS["AnonCreatDirs"]:nil == "YES") ? true:false);
@@ -736,7 +738,7 @@
chown ftp:ftp /srv/ftp/upload/; chmod 755 /srv/ftp/upload; else chmod 766 /srv/ftp/upload/; fi"
*/
y2milestone("[ftp-server] (WriteUpload) bash command for creating upload dir : %1", command);
- options = (map)SCR::Execute (.target.bash_output, command);
+ options = (map)SCR::Execute (.target.bash_output, command);
if (options["exit"]:nil == 0)
result = true;
else
Modified: trunk/ftp-server/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/complex.ycp?rev=53293&r1=53292&r2=53293&view=diff
==============================================================================
--- trunk/ftp-server/src/complex.ycp (original)
+++ trunk/ftp-server/src/complex.ycp Thu Nov 13 18:22:02 2008
@@ -82,7 +82,7 @@
`VBox(
`Heading (_("No server package installed")),
`Left(`Label(_("Please choose an ftp daemon."))),
- `Left(`Label(_("Press <b>Cancel</b> to cancel the configuration of the ftp."))),
+ `Left(`Label(_("Press Cancel to cancel the configuration of the ftp."))),
`Left(`RadioButton(`id(0), `opt(`notify), _("&vsftpd"), true)),
`Left(`RadioButton(`id(1), `opt(`notify), _("&pure-ftpd"))),
`HBox(
Modified: trunk/ftp-server/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/dialogs.ycp?rev=53293&r1=53292&r2=53293&view=diff
==============================================================================
--- trunk/ftp-server/src/dialogs.ycp (original)
+++ trunk/ftp-server/src/dialogs.ycp Thu Nov 13 18:22:02 2008
@@ -602,27 +602,6 @@
*/
-/*
- * Init function where are added UI hadle functions
- * Anonymous Settings widget
- *
- * @return map map for Anonymous Settings widget
-
-
-map AnonSettings () {
- map result = $[];
-
- result["widget"] = `custom;
- result["custom_widget"] = `VBox();
- result["init"] = InitAnonSettings;
- result["store"] = StoreAnonSettings;
- result["handle"] = HandleAnonSettings;
- result["help"] = DialogHelpText("anon_settings");
-
- return result;
-}
-*/
-
/**
* Enable/Disable Anonymous and Local Users
* Authentication Settings widget
@@ -712,11 +691,6 @@
}
-
-
-
-
-
/**
*-----------================= EXPERT SETTINGS SCREEN =============----------
*
Modified: trunk/ftp-server/src/wid_functions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/wid_functions.ycp?rev=53293&r1=53292&r2=53293&view=diff
==============================================================================
--- trunk/ftp-server/src/wid_functions.ycp (original)
+++ trunk/ftp-server/src/wid_functions.ycp Thu Nov 13 18:22:02 2008
@@ -1118,7 +1118,8 @@
if (((button == "AnonReadOnly") || (anon_upload) && (check_upload)) && (ask_again)) {
if (!FtpServer::create_upload_dir) {
- yesno_question =_("Do you want to create a directory?\n") + FtpServer::anon_homedir +_("Upload with write access?");
+ yesno_question =sformat(_("Create the \"upload\" directory in %1\n"), FtpServer::anon_homedir);
+ yesno_question = yesno_question + _("and enable write access?\n");
yesno_comment = _("If you want anonymous users to be able to upload,
you need to create a directory with write access.
@@ -1204,7 +1205,6 @@
boolean result = false;
boolean enable = (boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value);
-
if (enable) {
if (!FtpServer::vsftpd_edit) {
@@ -1237,14 +1237,8 @@
FtpServer::change_permissions = false;
}
} //end of if (FtpServer::pure_ftp_allowed_permissios_upload == 1)
-
-
} //end else for if if (!FtpServer::vsftpd_edit) {
-
-
} // end of if (enable) {
-
-
}
/**
@@ -1283,7 +1277,6 @@
boolean result = false;
boolean enable = (boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value);
-
if (enable) {
if (!FtpServer::vsftpd_edit) {
@@ -1305,8 +1298,7 @@
if (FtpServer::pure_ftp_allowed_permissios_upload == 1) {
yesno_question = sformat(_("Change permissions of %1 ?\n"), FtpServer::anon_homedir);
- yesno_comment = sformat(_("For anonymous connections the home directory of an anonymous user should have no write access.
-"));
+ yesno_comment = sformat(_("For anonymous connections the home directory of an anonymous user should have no write access."));
result = Popup::YesNoHeadline(yesno_question, yesno_comment);
if (result) {
FtpServer::pure_ftp_allowed_permissios_upload = 0;
@@ -1316,14 +1308,8 @@
FtpServer::change_permissions = false;
}
} //end of if (FtpServer::pure_ftp_allowed_permissios_upload == 1)
-
-
} //end else for if if (!FtpServer::vsftpd_edit) {
-
-
} // end of if (enable) {
-
-
}
@@ -1340,125 +1326,6 @@
}
-
-/**
- * Init function for anon settings
- * change ValidChars from textentry
- */
-void InitAnonSettings(string key) {
- integer current = (integer) UI::QueryWidget(`id("AnonAuthen"), `CurrentButton);
- integer val = tointeger(FtpServer::ValueUIEdit("AnonAuthen"));
- UI::ChangeWidget(`id("AnonAuthen"), `CurrentButton, val);
- UI::ChangeWidget(`id( "AnonReadOnly" ), `Value,
- (FtpServer::ValueUIEdit("AnonReadOnly") == "NO"));
- UI::ChangeWidget(`id( "AnonCreatDirs" ), `Value,
- (FtpServer::ValueUIEdit("AnonCreatDirs") == "YES"));
- if (FtpServer::vsftpd_edit) {
- UI::ChangeWidget(`id( "EnableUpload" ), `Value,
- (FtpServer::ValueUIEdit("EnableUpload") == "YES"));
- if (!((boolean) UI::QueryWidget(`id("EnableUpload"), `Value))) {
- UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, false);
- UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, false);
- }
- }
-}
-
-
-/**
- * Store function for anon settings
- * save values to temporary structure
- */
-void StoreAnonSettings (string key, map event) {
- FtpServer::WriteToEditMap("AnonAuthen", tostring(UI::QueryWidget(`id("AnonAuthen"), `CurrentButton)));
- foreach(string key, ["AnonCreatDirs"],{
- FtpServer::WriteToEditMap(key, (((boolean) UI::QueryWidget(`id(key), `Value) == true) ? "YES":"NO"));
- });
-
- FtpServer::WriteToEditMap("AnonReadOnly", (((boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value) == true) ? "NO":"YES"));
- if (FtpServer::vsftpd_edit)
- FtpServer::WriteToEditMap("EnableUpload", (((boolean) UI::QueryWidget(`id("EnableUpload"), `Value) == true) ? "YES":"NO"));
-
-}
-
-/**
- * Handle function for anon settings
- * save values to temporary structure
- */
-
-symbol HandleAnonSettings(string key, map event) {
- if (FtpServer::vsftpd_edit) {
- any button = event["ID"]:nil;
- boolean anon_upload = false;
- boolean anon_create_dirs = false;
- string yesno_comment ="";
- string yesno_question ="";
- boolean check_upload = (boolean) UI::QueryWidget(`id("EnableUpload"), `Value);
- if (button == "EnableUpload") {
- if (check_upload) {
- UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, true);
- UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, true);
- } else {
- UI::ChangeWidget(`id("AnonReadOnly"), `Enabled, false);
- UI::ChangeWidget(`id( "AnonCreatDirs" ),`Enabled, false);
- }
- } // end of if (button == "EnableUpload") {
-
- anon_upload = (boolean) UI::QueryWidget(`id("AnonReadOnly"), `Value);
- anon_create_dirs = (boolean) UI::QueryWidget(`id("AnonCreatDirs"), `Value);
-
- if (((button == "AnonReadOnly") || (anon_upload) && (check_upload)) && (ask_again)) {
- if (!FtpServer::create_upload_dir) {
- yesno_question = _("Do you want to create a directory?\n") + FtpServer::anon_homedir +_("Upload with write access?");
- yesno_comment = _("If you want anonymous users to be able to upload,
- you need to create a directory with write access.
-
-");
- yesno_comment = yesno_comment + FtpServer::anon_homedir + _(" is a home directory after the login of anonymous users.");
- FtpServer::create_upload_dir = Popup::YesNoHeadline(yesno_question, yesno_comment);
- ask_again = FtpServer::create_upload_dir;
- FtpServer::upload_good_permission = true;
- } else if (!FtpServer::upload_good_permission) {
- yesno_question = _("Do you want to change permissions
-for
-") + FtpServer::anon_homedir +_("Upload (allow writing)?");
- yesno_comment = _("If you want anonymous users to be able to upload, you need a directory with write access.
-
-");
- yesno_comment = yesno_comment + FtpServer::anon_homedir + _(" is a home directory after the login of anonymous users.");
- FtpServer::upload_good_permission = Popup::YesNoHeadline(yesno_question, yesno_comment);
- ask_again = FtpServer::upload_good_permission;
- }
-
- }
-
- if (((button == "AnonCreatDirs") || (anon_create_dirs) && (check_upload)) && (ask_again)) {
- if (!FtpServer::create_upload_dir) {
- yesno_question = _("Do you want to create a directory?\n") + FtpServer::anon_homedir +_("Upload with write access?");
- yesno_comment = _("If you want anonymous users to be able to create directories,
- you have to create a directory with write access.
-
-");
- yesno_comment = yesno_comment + FtpServer::anon_homedir + _(" is a home directory after the login of anonymous users.");
- FtpServer::create_upload_dir = Popup::YesNoHeadline(yesno_question, yesno_comment);
- ask_again = FtpServer::create_upload_dir;
- FtpServer::upload_good_permission = true;
- } else if (!FtpServer::upload_good_permission) {
- yesno_question = _("Do you want to change permissions
-for
-") + FtpServer::anon_homedir +_("Upload (allow writing)?");
- yesno_comment = _("If you want anonymous users to be able to create directories,
- you need a directory with write acccess.
-
-");
- yesno_comment = yesno_comment + FtpServer::anon_homedir + _(" is a home directory after the login of anonymous users.");
- FtpServer::upload_good_permission = Popup::YesNoHeadline(yesno_question, yesno_comment);
- ask_again = FtpServer::upload_good_permission;
- }
- }
- } // end of if (FtpServer::vsftpd_edit) {
-}
-
-
/**
*-----------================= EXPERT SETTINGS SCREEN =============----------
*
Modified: trunk/ftp-server/src/write_load.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ftp-server/src/write_load.ycp?rev=53293&r1=53292&r2=53293&view=diff
==============================================================================
--- trunk/ftp-server/src/write_load.ycp (original)
+++ trunk/ftp-server/src/write_load.ycp Thu Nov 13 18:22:02 2008
@@ -407,8 +407,7 @@
case("FtpDirAnon"):
if (FtpServer::vsftpd_edit) {
if (write) {
- if ((FtpServer::EDIT_SETTINGS["FtpDirAnon"]:nil != "") &&
- (FtpServer::EDIT_SETTINGS["FtpDirAnon"]:nil != FtpServer::anon_homedir))
+ if (FtpServer::EDIT_SETTINGS["FtpDirAnon"]:nil != "")
FtpServer::VS_SETTINGS["anon_root"] = FtpServer::EDIT_SETTINGS["FtpDirAnon"]:nil;
else
FtpServer::VS_SETTINGS["anon_root"] = nil;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org