/* due to the nature of afp packets, we have to exit if we get
an error. we can't do this with translation on. */
#ifdef WITH_SENDFILE
- int fd;
-
- fd = ad_readfile_init(ofork->of_ad, eid, &offset, 0);
-
- if (dsi_stream_read_file(dsi, fd, offset, dsi->datasize) < 0) {
- if (errno == EINVAL || errno == ENOSYS)
- goto afp_read_loop;
- else {
- LOG(log_error, logtype_afpd, "afp_read(%s): ad_readfile: %s", of_name(ofork), strerror(errno));
- goto afp_read_exit;
+ if (!(obj->options.flags & OPTION_NOSENDFILE)) {
+ if (dsi_stream_read_file(dsi,
+ ad_readfile_init(ofork->of_ad, eid, &offset, 0),
+ offset,
+ dsi->datasize) < 0) {
+ switch (errno) {
+ case EINVAL:
+ case ENOSYS:
+ goto afp_read_loop;
+ default:
+ LOG(log_error, logtype_afpd, "afp_read(%s): ad_readfile: %s", of_name(ofork), strerror(errno));
+ goto afp_read_exit;
+ }
}
- }
-
- dsi_readdone(dsi);
- goto afp_read_done;
+ dsi_readdone(dsi);
+ goto afp_read_done;
+ }
afp_read_loop:
#endif
if (q = iniparser_getstrdup(config, INISEC_GLOBAL, "server options", NULL)) {
if (p = strtok(q, ", ")) {
while (p) {
- if (strcasecmp(p, "nozeroconf"))
+ if (strcasecmp(p, "nozeroconf") == 0)
options->flags |= OPTION_NOZEROCONF;
- if (strcasecmp(p, "icon"))
+ if (strcasecmp(p, "icon") == 0)
options->flags |= OPTION_CUSTOMICON;
- if (strcasecmp(p, "noicon"))
+ if (strcasecmp(p, "noicon") == 0)
options->flags &= ~OPTION_CUSTOMICON;
- if (strcasecmp(p, "advertise_ssh"))
+ if (strcasecmp(p, "advertise_ssh") == 0)
options->flags |= OPTION_ANNOUNCESSH;
- if (strcasecmp(p, "noacl2maccess"))
+ if (strcasecmp(p, "noacl2maccess") == 0)
options->flags &= ~OPTION_ACL2MACCESS;
- if (strcasecmp(p, "keepsessions"))
+ if (strcasecmp(p, "keepsessions") == 0)
options->flags |= OPTION_KEEPSESSIONS;
- if (strcasecmp(p, "closevol"))
+ if (strcasecmp(p, "closevol") == 0)
options->flags |= OPTION_CLOSEVOL;
- if (strcasecmp(p, "client_polling"))
+ if (strcasecmp(p, "client_polling") == 0)
options->flags &= ~OPTION_SERVERNOTIF;
- if (strcasecmp(p, "nosavepassword"))
+ if (strcasecmp(p, "nosendfile") == 0)
+ options->flags |= OPTION_NOSENDFILE;
+ if (strcasecmp(p, "nosavepassword") == 0)
options->passwdbits |= PASSWD_NOSAVE;
- if (strcasecmp(p, "savepassword"))
+ if (strcasecmp(p, "savepassword") == 0)
options->passwdbits &= ~PASSWD_NOSAVE;
- if (strcasecmp(p, "nosetpassword"))
+ if (strcasecmp(p, "nosetpassword") == 0)
options->passwdbits &= ~PASSWD_SET;
- if (strcasecmp(p, "setpassword"))
+ if (strcasecmp(p, "setpassword") == 0)
options->passwdbits |= PASSWD_SET;
p = strtok(NULL, ", ");
}