X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fuam.c;h=0d7b6b2b704115033e64092b84144394481c7a14;hb=260c314546ffcfdbef47f2c7de82d5310b26df0a;hp=de0fae7ceb0aec7e34c50a106eaaa38086fa5a92;hpb=5737d08e3c85485df6ad56d7be7423d6309e9b94;p=netatalk.git diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index de0fae7c..0d7b6b2b 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -311,7 +311,7 @@ int uam_random_string (AFPObj *obj, char *buf, int len) if (gettimeofday(&tv, &tz) < 0) return -1; - srandom(tv.tv_sec + (unsigned long) obj + (unsigned long) obj->handle); + srandom(tv.tv_sec + (unsigned long) obj + (unsigned long) obj->dsi); for (i = 0; i < len; i += sizeof(result)) { result = random(); memcpy(buf + i, &result, sizeof(result)); @@ -364,11 +364,6 @@ int uam_afpserver_option(void *private, const int what, void *option, *len = sizeof(obj->options.passwdminlen); break; - case UAM_PASSWD_MAXFAIL: - *((int *) option) = obj->options.loginmaxfail; - *len = sizeof(obj->options.loginmaxfail); - break; - case UAM_PASSWD_EXPIRETIME: /* not implemented */ default: return -1; @@ -377,7 +372,7 @@ int uam_afpserver_option(void *private, const int what, void *option, break; case UAM_OPTION_SIGNATURE: - *buf = (void *) (((AFPConfig *)obj->config)->signature); + *buf = (void *)obj->dsi->signature; if (len) *len = 16; break; @@ -395,13 +390,9 @@ int uam_afpserver_option(void *private, const int what, void *option, *len = strlen(obj->options.hostname); break; - case UAM_OPTION_PROTOCOL: - *((int *) option) = obj->proto; - break; - case UAM_OPTION_CLIENTNAME: { - struct DSI *dsi = obj->handle; + struct DSI *dsi = obj->dsi; const struct sockaddr *sa; static char hbuf[NI_MAXHOST]; @@ -466,15 +457,15 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen, if (!obj) return AFPERR_PARAM; - len = dsi_writeinit(obj->handle, buf, *buflen); + len = dsi_writeinit(obj->dsi, buf, *buflen); if (!len || ((len = action(handle, buf, len)) < 0)) { - dsi_writeflush(obj->handle); + dsi_writeflush(obj->dsi); goto uam_afp_read_err; } - while ((len = (dsi_write(obj->handle, buf, *buflen)))) { + while ((len = (dsi_write(obj->dsi, buf, *buflen)))) { if ((len = action(handle, buf, len)) < 0) { - dsi_writeflush(obj->handle); + dsi_writeflush(obj->dsi); goto uam_afp_read_err; } }