Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 31782 - invalid proftpd init.d script
Summary: invalid proftpd init.d script
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Stewart (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-22 17:13 UTC by Patrik Kullman
Modified: 2003-11-13 08:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrik Kullman 2003-10-22 17:13:17 UTC
After lots of troubleshooting, I found out that proftpd has a faulty init.d
script. (Only verified this on 1.2.9_rc2 and rc3.

Current line:
start-stop-daemon --start --quiet --exec /usr/sbin/proftpd -- -d -p
/var/run/proftpd.pid

Syntax:
-d (debug) expects a value between 0-9
-p (persistant passwd) expects either 1 or 0

Proposed line:
start-stop-daemon --start --quiet --exec /usr/sbin/proftpd -- -p 0
This forces proftpd to go by nsswitch.conf before looking users up, thus
enabling lookups in other sources than /etc/passwd

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Dizzy 2003-10-28 02:25:34 UTC
yes this is definetly true! this needs fixed asap!

here is the source:
    case 'd':
      if (!optarg) {
        log_pri(PR_LOG_ERR, "Fatal: -d requires debugging level argument.");
        exit(1);
      }
      log_setdebuglevel(atoi(optarg));
      break;

    case 'p': {
      if (!optarg ||
          ((persistent_passwd = atoi(optarg)) != 1 && persistent_passwd !=
0)) {
        log_pri(PR_LOG_ERR, "Fatal: -p requires boolean (0|1) argument.");
        exit(1);
      }

      break;
    }

now why this doesnt trigger and error message is because proftpd has a fauly
check.

gentoo's init line:

start-stop-daemon --start --quiet --exec /usr/sbin/proftpd -- -d -p
/var/run/proftpd.pid

so -d gets optarg as beeing "-p" and -p gets optarg as being "/var/run/proftpd.pid"

proftpd code cheks using atoi() which for -d translates to 0 (atoi("-p")
= 0), and for -p case translates to 0 too (atoi("/var/run/proftpd.pid") =
0).

so I dont know if the person who wrote the init script intended to have proftpd
use persistent passwd and debugging enabled but definetly it doesnt do that
now :)


 it instructs getopt() that -d and -p must have params. then when it gets
'd' it checks for the param which exists (with gentoo's
Comment 2 Dizzy 2003-10-28 02:26:18 UTC
ignore the last 2 lines of my previous comment... :)
Comment 3 Stewart (RETIRED) gentoo-dev 2003-11-05 19:18:45 UTC
You're absolutely right! ProFTPD has probably been ignoring the options completely,
so I've removed them and will allow configuration directives and compile-time
detection to do its work.
Comment 4 Stewart (RETIRED) gentoo-dev 2003-11-05 19:24:38 UTC
Fixed in CVS.