Hello community,
here is the log from the commit of package yast2-ftp-server
checked in at Wed May 30 19:02:42 CEST 2007.
--------
--- yast2-ftp-server/yast2-ftp-server.changes 2007-05-10 15:14:17.000000000 +0200
+++ /mounts/work_src_done/NOARCH/yast2-ftp-server/yast2-ftp-server.changes 2007-05-30 18:40:38.459544000 +0200
@@ -1,0 +2,7 @@
+Wed May 30 17:31:06 CEST 2007 - juhliarik@suse.cz
+
+- added patch for uploading anonymous users via vsftpd
+- added creation "upload" subdirectory with writing permission
+- V 2.15.5
+
+-------------------------------------------------------------------
Old:
----
yast2-ftp-server-2.15.4.tar.bz2
New:
----
yast2-ftp-server-2.15.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-ftp-server.spec ++++++
--- /var/tmp/diff_new_pack.H14695/_old 2007-05-30 19:02:28.000000000 +0200
+++ /var/tmp/diff_new_pack.H14695/_new 2007-05-30 19:02:28.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-ftp-server (Version 2.15.4)
+# spec file for package yast2-ftp-server (Version 2.15.5)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-ftp-server
-Version: 2.15.4
+Version: 2.15.5
Release: 1
License: GNU General Public License (GPL)
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-ftp-server-2.15.4.tar.bz2
+Source0: yast2-ftp-server-2.15.5.tar.bz2
prefix: /usr
Requires: yast2 yast2-inetd
BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-inetd yast2-testsuite
@@ -34,7 +34,7 @@
Jozef Uhliarik
%prep
-%setup -n yast2-ftp-server-2.15.4
+%setup -n yast2-ftp-server-2.15.5
%build
%{prefix}/bin/y2tool y2autoconf
@@ -70,6 +70,10 @@
%doc %{prefix}/share/doc/packages/yast2-ftp-server
%changelog
+* Wed May 30 2007 - juhliarik@suse.cz
+- added patch for uploading anonymous users via vsftpd
+- added creation "upload" subdirectory with writing permission
+- V 2.15.5
* Thu May 10 2007 - juhliarik@suse.cz
- added corrections for starting daemon via "when booting"
- added corrections for help text
++++++ yast2-ftp-server-2.15.4.tar.bz2 -> yast2-ftp-server-2.15.5.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/config/ftp-server.rnc new/yast2-ftp-server-2.15.5/config/ftp-server.rnc
--- old/yast2-ftp-server-2.15.4/config/ftp-server.rnc 2007-05-04 11:02:59.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/config/ftp-server.rnc 2007-05-30 17:22:13.000000000 +0200
@@ -23,7 +23,6 @@
element AnonCreatDirs { text }? &
element Banner { text }? &
element SSLEnable { text }? &
- element SSLVersion { text }? &
element TLS { text }? &
element AntiWarez { text }? &
element SSL { text }? &
@@ -35,5 +34,7 @@
element CertFile { text }? &
element VirtualUser { text }? &
element FTPUser { text }? &
- element GuestUser { text }?
+ element GuestUser { text }? &
+ element EnableUpload { text }?
+
}
\ No newline at end of file
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/configure new/yast2-ftp-server-2.15.5/configure
--- old/yast2-ftp-server-2.15.4/configure 2007-05-10 15:16:28.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/configure 2007-05-30 18:44:26.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for yast2-ftp-server 2.15.4.
+# Generated by GNU Autoconf 2.60 for yast2-ftp-server 2.15.5.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -559,8 +559,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-ftp-server'
PACKAGE_TARNAME='yast2-ftp-server'
-PACKAGE_VERSION='2.15.4'
-PACKAGE_STRING='yast2-ftp-server 2.15.4'
+PACKAGE_VERSION='2.15.5'
+PACKAGE_STRING='yast2-ftp-server 2.15.5'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1181,7 +1181,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-ftp-server 2.15.4 to adapt to many kinds of systems.
+\`configure' configures yast2-ftp-server 2.15.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1252,7 +1252,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-ftp-server 2.15.4:";;
+ short | recursive ) echo "Configuration of yast2-ftp-server 2.15.5:";;
esac
cat <<\_ACEOF
@@ -1330,7 +1330,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-ftp-server configure 2.15.4
+yast2-ftp-server configure 2.15.5
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1344,7 +1344,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-ftp-server $as_me 2.15.4, which was
+It was created by yast2-ftp-server $as_me 2.15.5, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -2145,7 +2145,7 @@
# Define the identity of the package.
PACKAGE='yast2-ftp-server'
- VERSION='2.15.4'
+ VERSION='2.15.5'
cat >>confdefs.h <<_ACEOF
@@ -2372,7 +2372,7 @@
-VERSION="2.15.4"
+VERSION="2.15.5"
RPMNAME="yast2-ftp-server"
MAINTAINER="Jozef Uhliarik "
@@ -3258,7 +3258,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-ftp-server $as_me 2.15.4, which was
+This file was extended by yast2-ftp-server $as_me 2.15.5, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3301,7 +3301,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-ftp-server config.status 2.15.4
+yast2-ftp-server config.status 2.15.5
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/configure.in new/yast2-ftp-server-2.15.5/configure.in
--- old/yast2-ftp-server-2.15.4/configure.in 2007-05-10 15:16:23.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/configure.in 2007-05-30 18:44:21.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.14.0 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-ftp-server, 2.15.4, http://bugs.opensuse.org/, yast2-ftp-server)
+AC_INIT(yast2-ftp-server, 2.15.5, http://bugs.opensuse.org/, yast2-ftp-server)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,7 +17,7 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.15.4"
+VERSION="2.15.5"
RPMNAME="yast2-ftp-server"
MAINTAINER="Jozef Uhliarik "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/src/dialogs.ycp new/yast2-ftp-server-2.15.5/src/dialogs.ycp
--- old/yast2-ftp-server-2.15.4/src/dialogs.ycp 2007-05-10 09:52:46.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/src/dialogs.ycp 2007-05-29 16:07:36.000000000 +0200
@@ -223,11 +223,13 @@
result["custom_widget"] = `VBox();
result["init"] = InitAnonSettings;
result["store"] = StoreAnonSettings;
+ result["handle"] = HandleAnonSettings;
result["help"] = DialogHelpText("anon_settings");
return result;
}
+
/**
* Init function where are added UI hadle functions
* Expert Settings widget (vsftpd)
@@ -431,6 +433,28 @@
/**
* Init function where are added UI hadle functions
+ * Anonymous Settings widget
+ * define for tabs_vsftpd/tabs_pureftpd necessary later in screens (CWNTree)
+ *
+ * @return map map for Anonymous Settings widget
+ */
+
+map vsftpd_anon_settings () {
+ map result = $[];
+
+ result["contents"] = `VBox (
+ VsftpdAnonSettings()
+ );
+ // TRANSLATORS: part of dialog caption
+ result["caption"] = _("FTP Anonymous Settings");
+ // TRANSLATORS: tree menu item
+ result["tree_item_label"] = _("Authentication");
+ result["widget_names"] = [ "DisBackButton", "AnonSettings"];
+
+ return result;
+}
+/**
+ * Init function where are added UI hadle functions
* Expert Settings widget (vsftpd)
* define for tabs_vsftpd necessary later in screens (CWNTree)
*
@@ -513,7 +537,7 @@
"VSFTPDAddSettings": VSFTPDSettings(),
- "PUREFTPDAddSettings": PUREFTPDAddSettings (),
+ //"PUREFTPDAddSettings": PUREFTPDAddSettings (),
"RBVsPureFTPd" : RBVsftpdPureftpd (),
@@ -537,7 +561,7 @@
"perfor_settings" :perfor_settings (),
- "anon_settings" : anon_settings (),
+ "anon_settings" : vsftpd_anon_settings (),
"addit_settings" : addit_settings (),
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/src/FtpServer.ycp new/yast2-ftp-server-2.15.5/src/FtpServer.ycp
--- old/yast2-ftp-server-2.15.4/src/FtpServer.ycp 2007-05-10 13:49:57.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/src/FtpServer.ycp 2007-05-30 16:55:39.000000000 +0200
@@ -96,6 +96,24 @@
global boolean start_xinetd = false;
/**
+ * variable signifies if it is create upload dir
+ * only for vsftpd and anonymous connections with allowed upload
+ *
+ * global boolean variable
+ */
+
+global boolean create_upload_dir = false;
+
+/**
+ * variable signifies if upload dir has good permissions
+ * only for vsftpd and anonymous connections with allowed upload
+ *
+ * global boolean variable
+ */
+
+global boolean upload_good_permission = false;
+
+/**
* variable signifies home dir for anonymous user
*
* global string variable
@@ -146,7 +164,7 @@
"UmaskAnon", "UmaskLocal", "PasMinPort", "PasMaxPort", "MaxIdleTime", "MaxClientsPerIP",
"MaxClientsNumber", "LocalMaxRate", "AnonMaxRate", "AnonAuthen", "AnonReadOnly",
"AnonCreatDirs", "Banner", "SSLEnable", "TLS", "AntiWarez", "SSL", "StartXinetd",
-"PassiveMode", "CertFile", "SSLv2", "SSLv3", "VirtualUser", "FTPUser", "GuestUser"];
+"PassiveMode", "CertFile", "SSLv2", "SSLv3", "VirtualUser", "FTPUser", "GuestUser", "EnableUpload"];
/**
* map of deafult values for options in UI
@@ -186,6 +204,7 @@
"VirtualUser" : "NO",
"FTPUser" : "ftp",
"GuestUser" : "",
+ "EnableUpload" : "NO",
];
@@ -251,6 +270,48 @@
return true;
}
+
+/**
+ * Read vsftpd configuration
+ * existing upload file and permissions
+ *
+ * @return boolean successfull
+ */
+
+
+boolean ReadVSFTPDUpload () {
+ boolean result = false;
+ string command = "";
+ if (anon_homedir !="")
+ command = "ls -l "+anon_homedir+ " | grep upload";
+ if (command != "") {
+ map options = (map)SCR::Execute (.target.bash_output, command);
+ y2milestone("[ftp-server] (ReadVSFTPDUpload) command for existing upload dir: %1 output: %2",command, options);
+ if (options["exit"]:nil == 0)
+ result = true;
+ else
+ result = false;
+ if (result) {
+ //Popup::Message("Work ReadVSFTPDUpload");
+ create_upload_dir = true;
+ string permissions = substring (tostring(options["stdout"]:nil),0,10);
+ string w = filterchars (permissions, "w");
+ string r = filterchars (permissions, "r");
+ if ((size(w) <3) || (size(r) <3)) {
+ upload_good_permission = false;
+ //Popup::Message("good permissions");
+ } else {
+ upload_good_permission = true;
+ //Popup::Message("wrong permissions");
+ }
+ }
+ }
+ return result;
+}
+
+
+
+
/**
* Remap current pure -FtpServer configuration
* to temporary structure
@@ -294,7 +355,7 @@
if ((Users::Read () == "") && (EDIT_SETTINGS["VirtualUser"]:nil == "NO")) {
if ((vsftpd_edit) && (EDIT_SETTINGS["GuestUser"]:nil != "")
&& (EDIT_SETTINGS["FtpDirLocal"]:nil == "")) {
- Popup::Message("if ((vsftpd_edit) && (EDIT_SETTINGS");
+ //Popup::Message("if ((vsftpd_edit) && (EDIT_SETTINGS");
Users::SelectUserByName (EDIT_SETTINGS["GuestUser"]:nil);
userinfo = Users::GetCurrentUser ();
string guest_home_dir = (string) userinfo["homedirectory"]:nil;
@@ -318,9 +379,10 @@
boolean progress_orig = Progress::set (false);
SuSEFirewall::Read ();
Progress::set (progress_orig);
-
-
-
+ //read existing upload directory for vsftpd
+ if (vsftpd_edit) {
+ result = ReadVSFTPDUpload ();
+ }
return result;
}
@@ -504,7 +566,49 @@
return result;
}
+/**
+ * Ask for creation upload directory
+ * It is necessary if user want to allow uploading for anonymous
+ * @return boolean result of function (true/false)
+ */
+boolean WriteUpload () {
+ boolean result = true;
+ string command ="";
+ integer authentication = tointeger(EDIT_SETTINGS["AnonAuthen"]:nil);
+ if ((vsftpd_edit) && (authentication == 0) && (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);
+ if ((write_enable) && ((anon_upload) || (anon_create_dirs)))
+ command = "dir=`ls ";
+ command = command + anon_homedir;
+ command = command + " | grep upload`; if [ -z $dir ]; then mkdir ";
+ command = command + anon_homedir +"upload; chown ";
+
+ if (EDIT_SETTINGS["GuestUser"]:nil !="")
+ command = command + EDIT_SETTINGS["GuestUser"]:nil +":"+EDIT_SETTINGS["GuestUser"]:nil;
+ else if (EDIT_SETTINGS["FTPUser"]:nil !="")
+ command = command + EDIT_SETTINGS["FTPUser"]:nil +":"+EDIT_SETTINGS["FTPUser"]:nil;
+ command = command + " " + anon_homedir +"upload; chmod 766 ";
+ command = command + anon_homedir +"upload; else chmod 766 " + anon_homedir +"upload; fi";
+/*
+"dir=`ls /srv/ftp/ | grep upload`; if [ -z $dir ]; then echo $dir; mkdir /srv/ftp/upload;
+ 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);
+ map options = (map)SCR::Execute (.target.bash_output, command);
+ if (options["exit"]:nil == 0)
+ result = true;
+ else
+ result = false;
+ //Popup::Message(command);
+
+ } else {
+ result = true;
+ }
+ return result;
+}
/**
* read value from PURE_EDIT_SETTINGS
*
@@ -666,7 +770,7 @@
/* FtpServer read dialog caption */
string caption = _("Saving FTP Configuration");
- integer steps = 2;
+ integer steps = 3;
// We do not set help text here, because it was set outside
Progress::New(caption, " ",
@@ -696,6 +800,13 @@
if (!WriteXinetd ()) Report::Error (_("Cannot write settings for xinetd!"));
sleep(sl);
+ if (PollAbort()) return false;
+ Progress::NextStage ();
+ // write settings for starting daemon
+ if (!WriteUpload ()) Report::Error (_("Cannot create upload direcotry for anonymous connections!"));
+ sleep(sl);
+
+
if(PollAbort()) return false;
/* Progress finished */
Progress::NextStage();
@@ -857,7 +968,6 @@
* @return table items
*/
global list Overview() {
- // TODO FIXME: your code here...
return [];
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/src/helps.ycp new/yast2-ftp-server-2.15.5/src/helps.ycp
--- old/yast2-ftp-server-2.15.4/src/helps.ycp 2007-05-10 09:12:00.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/src/helps.ycp 2007-05-30 17:16:46.000000000 +0200
@@ -146,14 +146,26 @@
/* anonymous settings anonymous can't upload dialog help 5/6 */
_("<p><b>Anonymous Can Upload</b><br>
-If enabled anonymous users will be permitted to upload.</p>
+If enabled anonymous users will be permitted to upload.
+<i>vsftpd only: </i>If you want that anonymous users can upload you
+need existing directory with allowed writing in home directory after login.</p>
")+
/* anonymous settings anonymous can create dirs dialog help 6/6 */
_("<p><b>Anonymous Can Create Dirs</b><br>
-If enabled anonymous users can create directories.</p>
+If enabled anonymous users can create directories.
+<i>vsftpd only: </i>If you want that anonymous users can create directories you
+need existing directory with allowed writing in home directory after login.</p>
+")+
+
+/* anonymous settings anonymous can create dirs dialog help 6/6 */
+_("<p><b>Enable Upload <i>(vsftpd only)</i></b><br>
+If enable ftp users can upload. Anonymous users need to allow
+ \"Anonymous Can Upload\" for enabling upload.</p>
"),
+
+
/* expert settings dialog help 1/6 */
"vsftpd_settings" : _("<p><b><big>Expert Settings</b><br>
Expert settings - security and firewall settings.</p>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/src/uiforms.ycp new/yast2-ftp-server-2.15.5/src/uiforms.ycp
--- old/yast2-ftp-server-2.15.4/src/uiforms.ycp 2007-05-03 11:48:30.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/src/uiforms.ycp 2007-05-30 10:46:23.000000000 +0200
@@ -94,6 +94,49 @@
}
+
+
+
+
+
+
+term VsftpdAnonSettings() {
+ term dialog = `VBox (
+ `Frame ( _("Enable/Disable Anonymous and Local Users"),
+ `RadioButtonGroup(`id("AnonAuthen"),
+ `HBox(`HSpacing(1),`VBox(
+ `Left(`RadioButton(`id(0), "Anonymo&us Only")),
+ `Left(`RadioButton(`id(1), "Aut&henticated Users Only", true)),
+ `Left(`RadioButton(`id(2), "&Both"))
+ ))
+ ) //end of `HBox(`HSpacing(1),`RadioButtonGroup(`id("AnonAuthen")
+ ), //end of `Frame ( _("Enable/Disable Anonymous and Local Users")
+ `VSpacing(1),
+ `Frame ( _("Uploading"),
+ `HBox(`HSpacing(1),`VBox (
+ `Left(`CheckBox (`id("EnableUpload"), `opt(`notify), _("&Enable Upload"))),
+ `HBox(`HSpacing(2),`VBox(
+ `Left(`CheckBox (`id("AnonReadOnly"), `opt(`notify), _("Anon&ymous Can Upload"))),
+ `Left(`CheckBox (`id("AnonCreatDirs"),`opt(`notify), _("Anonymou&s Can Create Directories")))
+ ))
+ ))
+ ), //end of `Frame ( _("Anonymous Settings")
+ `VStretch()
+ );
+ return dialog;
+}
+
+
+
+
+
+
+
+
+
+
+
+
term FTPAnonSettings() {
term dialog = `VBox (
`Frame ( _("Enable/Disable Anonymous and Local Users"),
@@ -118,6 +161,11 @@
}
+
+
+
+
+
term VSFTPDAddSettings() {
term dialog = `VBox (
`CheckBoxFrame ( `id("PassiveMode"), _("Pass&ive Mode"), true,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/src/wid_functions.ycp new/yast2-ftp-server-2.15.5/src/wid_functions.ycp
--- old/yast2-ftp-server-2.15.4/src/wid_functions.ycp 2007-05-03 14:48:42.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/src/wid_functions.ycp 2007-05-30 17:25:21.000000000 +0200
@@ -25,6 +25,15 @@
include "ftp-server/uiforms.ycp";
+
+/**
+ * variable signifies repeat asking about upload file
+ * only for vsftpd
+ *
+ * internal boolean variable
+ */
+boolean ask_again = true;
+
/**
* CWMServiceStart function with no parameter returning boolean value
* that says if the service is started.
@@ -307,7 +316,7 @@
}
/**
- * Init function for performance settings
+ * Init function for anon settings
* change ValidChars from textentry
*/
void InitAnonSettings(string key) {
@@ -318,13 +327,19 @@
(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 performance settings
+ * Store function for anon settings
* save values to temporary structure
*/
void StoreAnonSettings (string key, map event) {
@@ -334,9 +349,76 @@
});
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 directory\n" + FtpServer::anon_homedir +"upload with allowed writing?";
+ yesno_comment = "If you want that \"anonymous\" users can upload\n you need to create directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after 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 permission\nfor" + FtpServer::anon_homedir +"upload (allow writing)?";
+ yesno_comment = "If you want that \"anonymous\" users can upload\n you need directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after 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 directory\n" + FtpServer::anon_homedir +"upload with allowed writing?";
+ yesno_comment = "If you want that \"anonymous\" users can create directories\n you need to create directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after 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 permission\nfor" + FtpServer::anon_homedir +"upload (allow writing)?";
+ yesno_comment = "If you want that \"anonymous\" users can create directories\n you need directory with allowed writing.\n\n";
+ yesno_comment = yesno_comment + FtpServer::anon_homedir + " is a home directory after 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) {
+}
+
+
+
/**
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/src/write_load.ycp new/yast2-ftp-server-2.15.5/src/write_load.ycp
--- old/yast2-ftp-server-2.15.4/src/write_load.ycp 2007-05-10 12:07:04.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/src/write_load.ycp 2007-05-29 17:24:16.000000000 +0200
@@ -703,10 +703,11 @@
if (FtpServer::vsftpd_edit) {
if (write) {
yes_no = FtpServer::EDIT_SETTINGS["AnonReadOnly"]:nil;
- if (yes_no == "YES")
+ if (yes_no == "YES") {
FtpServer::VS_SETTINGS["anon_upload_enable"] = "NO";
- else
+ } else {
FtpServer::VS_SETTINGS["anon_upload_enable"] = "YES";
+ }
} else {
if (haskey(FtpServer::VS_SETTINGS, "anon_upload_enable")) {
yes_no = toupper(FtpServer::VS_SETTINGS["anon_upload_enable"]:nil);
@@ -728,13 +729,11 @@
case("AnonCreatDirs"):
if (vsftpd_edit) {
if (write) {
- FtpServer::VS_SETTINGS["anon_mkdir_write_enable"] = EDIT_SETTINGS["AnonCreatDirs"]:nil;
+ FtpServer::VS_SETTINGS["anon_mkdir_write_enable"] = FtpServer::EDIT_SETTINGS["AnonCreatDirs"]:nil;
} else {
return ((haskey(FtpServer::VS_SETTINGS, "anon_mkdir_write_enable") ?
toupper(FtpServer::VS_SETTINGS["anon_mkdir_write_enable"]:nil) : FtpServer::DEFAULT_CONFIG["AnonCreatDirs"]:nil));
}
-
-
} else {
if (write)
FtpServer::PURE_SETTINGS["AnonymousCanCreateDirs"] = FtpServer::EDIT_SETTINGS["AnonCreatDirs"]:nil;
@@ -743,6 +742,25 @@
toupper(FtpServer::PURE_SETTINGS["AnonymousCanCreateDirs"]:nil):FtpServer::DEFAULT_CONFIG["AnonCreatDirs"]:nil));
}
break;
+ //only vsftpd
+ case("EnableUpload"):
+ if (FtpServer::vsftpd_edit) {
+ if (write) {
+ if (FtpServer::EDIT_SETTINGS["EnableUpload"]:nil != "")
+ FtpServer::VS_SETTINGS["write_enable"] = FtpServer::EDIT_SETTINGS["EnableUpload"]:nil;
+ else
+ FtpServer::VS_SETTINGS["write_enable"] = nil;
+ } else {
+ return ((haskey(FtpServer::VS_SETTINGS, "write_enable") ?
+ FtpServer::VS_SETTINGS["write_enable"]:nil : FtpServer::DEFAULT_CONFIG["EnableUpload"]:nil));
+ }
+ } else {
+ if (!write)
+ return FtpServer::DEFAULT_CONFIG["EnableUpload"]:nil;
+ else
+ return "";
+ }
+ break;
//only vsftpd
case("Banner"):
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-ftp-server-2.15.4/VERSION new/yast2-ftp-server-2.15.5/VERSION
--- old/yast2-ftp-server-2.15.4/VERSION 2007-05-10 13:54:12.000000000 +0200
+++ new/yast2-ftp-server-2.15.5/VERSION 2007-05-30 17:33:41.000000000 +0200
@@ -1 +1 @@
-2.15.4
+2.15.5
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org