transfer->filterbufsize = transfer->filterbufdata = 0;
}
-static char *findfilter(struct passwd *pwd)
-{
- char *path, *filtername;
-
- if((path = sprintf2("%s/.dcdl-filter", pwd->pw_dir)) != NULL)
- {
- if(!access(path, X_OK))
- return(path);
- free(path);
- }
- if((filtername = icwcstombs(confgetstr("transfer", "filter"), NULL)) == NULL)
- {
- flog(LOG_WARNING, "could not convert filter name into local charset: %s", strerror(errno));
- } else {
- if(strchr(filtername, '/') == NULL)
- {
- if((path = sprintf2("/etc/%s", filtername)) != NULL)
- {
- if(!access(path, X_OK))
- {
- free(filtername);
- return(path);
- }
- free(path);
- }
- if((path = sprintf2("/usr/etc/%s", filtername)) != NULL)
- {
- if(!access(path, X_OK))
- {
- free(filtername);
- return(path);
- }
- free(path);
- }
- if((path = sprintf2("/usr/local/etc/%s", filtername)) != NULL)
- {
- if(!access(path, X_OK))
- {
- free(filtername);
- return(path);
- }
- free(path);
- }
- } else {
- if(!access(filtername, X_OK))
- return(filtername);
- }
- free(filtername);
- }
- return(NULL);
-}
-
static void handletranscmd(struct transfer *transfer, wchar_t *cmd, wchar_t *arg)
{
if(!wcscmp(cmd, L"status")) {
errno = EACCES;
return(-1);
}
- if((filtername = findfilter(pwent)) == NULL)
+ filtername = findfile(icswcstombs(confgetstr("transfer", "filter"), NULL, NULL), NULL, 0);
+ if(filtername == NULL)
+ filtername = findfile("dc-filter", pwent->pw_dir, 0);
+ if(filtername == NULL)
{
flog(LOG_WARNING, "could not find filter for user %s", pwent->pw_name);
errno = ENOENT;
static struct configvar myvars[] =
{
+ /** The maximum number of simultaneously permitted uploads. A
+ * common hub rule is that you will need at least as many slots as
+ * the number of hubs to which you are connected. */
{CONF_VAR_INT, "slots", {.num = 3}},
+ /** The TOS value to use for upload connections (see the TOS
+ * VALUES section). */
{CONF_VAR_INT, "ultos", {.num = SOCK_TOS_MAXTP}},
+ /** The TOS value to use for download connections (see the TOS
+ * VALUES section). */
{CONF_VAR_INT, "dltos", {.num = SOCK_TOS_MAXTP}},
+ /** The name of the filter script (see the FILES section for
+ * lookup information). */
{CONF_VAR_STRING, "filter", {.str = L"dc-filter"}},
+ /** If true, only one upload is allowed per remote peer. This
+ * option is still experimental, so it is recommended to leave it
+ * off. */
+ {CONF_VAR_BOOL, "ulquota", {.num = 0}},
{CONF_VAR_END}
};