Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 149403 - net-ftp/pure-ftp-1.0.21-r1: duplicate -B option in default config, and other minor problems
Summary: net-ftp/pure-ftp-1.0.21-r1: duplicate -B option in default config, and other ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Luca Longinotti (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-28 05:02 UTC by Martin von Gagern
Modified: 2006-09-28 15:06 UTC (History)
0 users

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 Martin von Gagern 2006-09-28 05:02:44 UTC
Looking at /usr/portage/net-ftp/pure-ftpd/files/pure-ftpd.conf_d you'll notice that the flag "-B" for daemonize to background is stated in two config variables:
DAEMON="-B"
MISC_OTHER="-A -x -j -R -B -Z"
From what I can tell from init.d/pure-ftpd those vars are simply concatenated, so it does not matter where the flag is and duplicate flags seem to have no ill effects. However, somebody might want to remove this flag (whatfor I cannot imagine, but it is configurable, after all), and get surprised if he only removes one occurrence.

I suggest dropping the flag from MISC_OTHER.

And if you already have the config_d file opened for editing, you might wish to move the UPLOADSCRIPT option somewhere else instead of between MISC_OTHER and the explanation of possible flags for MISC_OTHER. Parting those two seems a bad idea to me. Personally, I'd move the UPLOADSCRIPT before the MISC_OTHER.

Oh, and I just wonder if this uploadscript stuff could really work. Looking at the init script, if UPLOADSCRIPT is set, UPSCRIPT will be set to "--uploadscript", so it does not include the value of UPLOADSCRIPT, and only UPSCRIPT not UPLOADSCRIPT is passed to start-stop-daemon. I haven't tried this, but I'd be surprised if this could work.

It seems that in the other config vars it has been a policy to always include the command line switch itself along with the value to set in every option. To stick with this for UPLOADSCRIPT the default should be "--uploadscript /path/to/script" or something like this, of course only as a comment. For the sake of uniformity I'd suggest treating all settings the same, either always including the flag or never.
Comment 1 Luca Longinotti (RETIRED) gentoo-dev 2006-09-28 15:06:53 UTC
(In reply to comment #0)
> Looking at /usr/portage/net-ftp/pure-ftpd/files/pure-ftpd.conf_d you'll notice
> that the flag "-B" for daemonize to background is stated in two config
> variables:
> ...
> I suggest dropping the flag from MISC_OTHER.

You're right, fixed, I've deleted the occurrence in MISC_OTHER.

> And if you already have the config_d file opened for editing, you might wish to
> move the UPLOADSCRIPT option somewhere else instead of between MISC_OTHER and
> the explanation of possible flags for MISC_OTHER. Parting those two seems a bad
> idea to me. Personally, I'd move the UPLOADSCRIPT before the MISC_OTHER.

Yeah, it's more readable like that, done.

> Oh, and I just wonder if this uploadscript stuff could really work. Looking at
> the init script, if UPLOADSCRIPT is set, UPSCRIPT will be set to
> "--uploadscript", so it does not include the value of UPLOADSCRIPT, and only
> UPSCRIPT not UPLOADSCRIPT is passed to start-stop-daemon. I haven't tried this,
> but I'd be surprised if this could work.

It works, I tested the whole thing myself before committing it, but it works slightly differently than the other vars... Because to the pure-ftpd binary you only tell "--uploadscript", and NOT the path! You only tell it "there is an uploadscript you have to use..." and then later start the pure-uploadscript binary, and pass the path of the uploadscript to that binary. So, how it's done at the moment, is the only way to make it work... The only info that is needed from conf.d is "what is the path?", and then, IF there is a path, it tells pure-ftpd "hey, you'll have to watch out for the uploadscript!", and then starts the pure-uploadscript binary, and to that it tells "and this here is the path to the script!". Conclusion: it's strange, it's different, but it has to be like that and it works. ;)
Best regards, CHTEKK.