[Open]Solaris.
* FIX: afpd: Check if options->server is set in set_signature, preventing
SIGSEGV.
+* FIX: afpd: server signature wasn't initialized in some cases
* FIX: DESTDIR support: DESTDIR was expanded twice
* FIX: Fix for compilation error if header files of an older Netatalk
version are installed.
/*
- * $Id: afp_config.c,v 1.32 2010-03-29 15:22:57 franklahm Exp $
- *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*/
config->defoptions = defoptions;
#endif /* NO_DDP */
+
+ /* set signature */
+ set_signature(options);
+
/* handle dsi transports and dsi proxies. we only proxy
* for DSI connections. */
/*
- * $Id: afp_options.c,v 1.54 2010-04-02 16:17:22 hat001 Exp $
- *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
free(opt->uamlist);
if (opt->passwdfile && (opt->passwdfile != save->passwdfile))
free(opt->passwdfile);
+ if (opt->signatureopt && (opt->signatureopt != save->signatureopt))
+ free(opt->signatureopt);
if (opt->signature && (opt->signature != save->signature))
- free(opt->signature);
+ free(opt->signature);
if (opt->k5service && (opt->k5service != save->k5service))
free(opt->k5service);
if (opt->k5realm && (opt->k5realm != save->k5realm))
options->sleep = 10* 120; /* 10 h in 30 seconds tick */
options->server_notif = 1;
options->authprintdir = NULL;
+ options->signatureopt = "auto";
options->umask = 0;
#ifdef ADMIN_GRP
options->admingid = 0;
options->port = strdup(c);
if ((c = getoption(buf, "-ddpaddr")))
atalk_aton(c, &options->ddpaddr);
+ if ((c = getoption(buf, "-signature")) && (opt = strdup(c)))
+ options->signatureopt = opt;
/* do a little checking for the domain name. */
if ((c = getoption(buf, "-fqdn"))) {
if ((c = getoption(buf, "-ntseparator")) && (opt = strdup(c)))
options->ntseparator = opt;
-
- if ((c = getoption(buf, "-signature")) && (opt = strdup(c))) {
- set_signature(opt, options);
- }
- else {
- set_signature("auto", options);
- }
return 1;
}
/*
- * $Id: globals.h,v 1.33 2010-03-29 15:22:57 franklahm Exp $
- *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
char *guest, *loginmesg, *keyfile, *passwdfile;
char *uamlist;
char *authprintdir;
+ char *signatureopt;
unsigned char signature[16];
char *k5service, *k5realm, *k5keytab;
char *unixcodepage,*maccodepage;
/*
- * $Id: status.c,v 1.31 2010-03-29 15:22:57 franklahm Exp $
- *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
/* If cannot open conf file, use one-time signature. */
/* If -signature user:xxxxx, use it. */
-void set_signature(char *opt, struct afp_options *options) {
+void set_signature(struct afp_options *options) {
char *usersign;
int fd, i;
struct stat tmpstat;
char *server_tmp;
server_tmp = (options->server ? options->server : options->hostname);
- if (strcmp(opt, "auto") == 0) {
+ if (strcmp(options->signatureopt, "auto") == 0) {
goto server_signature_auto; /* default */
- } else if (strcmp(opt, "host") == 0) {
- LOG(log_warning, logtype_afpd, "WARNING: option \"-signature host\" is obsoleted. Switching back to auto.", opt);
+ } else if (strcmp(options->signatureopt, "host") == 0) {
+ LOG(log_warning, logtype_afpd, "WARNING: option \"-signature host\" is obsoleted. Switching back to auto.", options->signatureopt);
goto server_signature_auto; /* same as auto */
- } else if (strncmp(opt, "user", 4) == 0) {
+ } else if (strncmp(options->signatureopt, "user", 4) == 0) {
goto server_signature_user; /* user string */
} else {
- LOG(log_error, logtype_afpd, "ERROR: option \"-signature %s\" is not valid. Switching back to auto.", opt);
+ LOG(log_error, logtype_afpd, "ERROR: option \"-signature %s\" is not valid. Switching back to auto.", options->signatureopt);
goto server_signature_auto; /* switch back to auto*/
}
server_signature_user:
/* Signature type is user string */
- len = strlen(opt);
+ len = strlen(options->signatureopt);
if (len <= 5) {
- LOG(log_warning, logtype_afpd, "WARNING: option \"-signature %s\" is not valid. Switching back to auto.", opt);
+ LOG(log_warning, logtype_afpd, "WARNING: option \"-signature %s\" is not valid. Switching back to auto.", options->signatureopt);
goto server_signature_auto;
}
- usersign = opt + 5;
+ usersign = options->signatureopt + 5;
len = len - 5;
if (len > 16) {
LOG(log_warning, logtype_afpd, "WARNING: signature user string %s is very long !", usersign);
-/*
- * $Id: status.h,v 1.11 2010-03-29 15:22:57 franklahm Exp $
- */
-
#ifndef AFPD_STATUS_H
#define AFPD_STATUS_H 1
extern void status_uams (char * /*status*/, const char * /*authlist*/);
extern void status_init (AFPConfig *, AFPConfig *,
const struct afp_options *);
-extern void set_signature(char *, struct afp_options *);
+extern void set_signature(struct afp_options *);
/* FP functions */
int afp_getsrvrinfo (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen);