Author Topic: FTP (proftpd) server and PCC.  (Read 337 times)

Offline atolboo

  • Full Member
  • ***
  • Posts: 234
FTP (proftpd) server and PCC.
« on: February 04, 2013, 02:46:47 PM »
Until recently (a few days ago) I have been a happy user of the FTP server on my main-PC <-> Android tablet and main-PC <-> netbook (also PCLOS).
Suddenly the FTP server on my main-PC was not accessible any more.
I am also testing PCLinuxOS KDE 64bit RC1 on this same main-PC in a different partition.
And PCLinuxOS KDE 64bit RC1 does not show this behavior.
Both systems are configured through PCC > Configure FTP (only intranet) + Firewall.
Further investigation show that /etc/proftpd.conf contain
good proftpd.conf
Code: [Select]
Allow from 192.168.1. 127.0.0.1bad proftpd.conf
Code: [Select]
Allow from  127.0.0.1After modifying (as root) the bad proftpd.conf, the problem is solved.
The problem can be re-introduced by executing PCC > Configure FTP (and is thus 100% reproducible).
Also completely removing and installing of proftpd (+ 2x /etc/proftpd.conf... files) doesn't have any influence on this behavior.
Any hint to find the source of this misconfiguration by PCC > Configure FTP are very welcome ;)
(problem first reported here).
« Last Edit: February 04, 2013, 02:51:14 PM by atolboo »

Offline sparerep

  • Jr. Member
  • **
  • Posts: 26
Re: FTP (proftpd) server and PCC.
« Reply #1 on: February 04, 2013, 04:55:34 PM »
I'm running not-quite-up-to-date Xfce. If KDE 64bit RC1 doesn't work this way, you might find the answer in the same file.

And, I'll admit I don't know much about Proftp or PCC (or perl), but PCC does not read and modify proftpd.conf.  Every time I use it for a mod a new proftpd.conf is written based on the options in the script.

/usr/lib/perl5/vendor_perl/5.10.1/MDK/Wizard/Proftpd.pm

Lines 256 - 262

Code: [Select]
if ($wiz_ftp_internal && !$wiz_ftp_external) {
($allow) = $wiz->{net}->itf_get("IPADDR") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/;
$allow .= " 127.0.0.1";
}
elsif ($wiz_ftp_external) {
$allow = "all";
}

So, there's the options: 127.0.0.1 or all.

If I change
Code: [Select]
$allow .= " 127.0.0.1";to
Code: [Select]
$allow .= " 192.168.2. 192.168.1.200 127.0.0.1";
That's what is written to proftpd.conf.

That's a root edit and is in effect until changed in the script. And note: there's a space between " and 127, although it may not be needed.

Tom

Offline atolboo

  • Full Member
  • ***
  • Posts: 234
Re: FTP (proftpd) server and PCC.
« Reply #2 on: February 05, 2013, 01:19:29 PM »
Thanks for the reply.
/usr/lib/perl5/vendor_perl/5.10.1/MDK/Wizard/Proftpd.pm
Proftpd.pm in KDE 64bit RC1 is located in /usr/lib/perl5/vendor_perl/5.12.3/MDK/Wizard/
And that one is 100% equal to the one in my current KDE 32bit according to the compare function in Krusader.
That means that this doesn't explains the difference :-\
Furthermore I also find
Code: [Select]
   if (!$bloc) {
$bloc = "
#drakwizard_proftpd
<Global>
  <Limit LOGIN>
    Order allow,deny
    Allow from $allow
    Deny from all
  </Limit>
</Global>
#drakwizard_proftpd

";
append_to_file($file, $bloc);
      } else {
substInFile { s/Allow from.*/Allow from $allow/ } $file;
      }
in Proftpd.pm
And the value is coming from $allow.
$allow is the result of
Code: [Select]
($allow) = $wiz->{net}->itf_get("IPADDR") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/;This is as far as I can understand the script. ???
« Last Edit: February 05, 2013, 01:33:22 PM by atolboo »