#include <atalk/util.h>
#include <atalk/bstrlib.h>
#include <atalk/bstradd.h>
+#include <atalk/globals.h>
#include "desktop.h"
#include "directory.h"
#include "dircache.h"
#include "volume.h"
-#include "globals.h"
#include "file.h"
#include "fork.h"
#include "filedir.h"
*/
struct savedir {
u_short sd_vid;
- u_int32_t sd_did;
+ uint32_t sd_did;
int sd_buflen;
char *sd_buf;
char *sd_last;
macnamelength(1) + macname(31) + utf8(4) + utf8namelen(2) + utf8name(255) +
oddpadding(1) */
-#define REPLY_PARAM_MAXLEN (4 + 104 + 1 + MACFILELEN + 4 + 2 + 255 + 1)
+#define REPLY_PARAM_MAXLEN (4 + 104 + 1 + MACFILELEN + 4 + 2 + UTF8FILELEN_EARLY + 1)
/* ----------------------------- */
static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_,
int did, ret, len, first = 1;
size_t esz;
char *data, *start;
- u_int16_t vid, fbitmap, dbitmap, reqcnt, actcnt = 0;
- u_int16_t temp16;
- u_int32_t sindex, maxsz, sz = 0;
+ uint16_t vid, fbitmap, dbitmap, reqcnt, actcnt = 0;
+ uint16_t temp16;
+ uint32_t sindex, maxsz, sz = 0;
struct path *o_path;
struct path s_path;
int header;
LOG(log_debug, logtype_afpd, "enumerate(\"%s/%s\", f/d:%04x/%04x, rc:%u, i:%u, max:%u)",
getcwdpath(), o_path->u_name, fbitmap, dbitmap, reqcnt, sindex, maxsz);
- data = rbuf + 3 * sizeof( u_int16_t );
- sz = 3 * sizeof( u_int16_t ); /* fbitmap, dbitmap, reqcount */
+ data = rbuf + 3 * sizeof( uint16_t );
+ sz = 3 * sizeof( uint16_t ); /* fbitmap, dbitmap, reqcount */
/*
* Read the directory into a pre-malloced buffer, stored
sd.sd_last = sd.sd_buf;
/* if dir was in the cache we don't have the inode */
if (( !o_path->st_valid && lstat( ".", &o_path->st ) < 0 ) ||
- (ret = for_each_dirent(vol, ".", enumerate_loop, (void *)&sd)) < 0)
+ (ret = for_each_dirent(vol, ".", enumerate_loop, (void *)&sd)) < 0)
{
+ LOG(log_error, logtype_afpd, "enumerate: loop error: %s (%d)", strerror(errno), errno);
switch (errno) {
case EACCES:
- return AFPERR_ACCESS;
+ return AFPERR_ACCESS;
case ENOTDIR:
return AFPERR_BADTYPE;
case ENOMEM:
*/
*sd.sd_last = 0;
sd.sd_last += len + 1;
- curdir->offcnt--; /* a little lie */
+ curdir->d_offcnt--; /* a little lie */
continue;
}
continue;
}
int len = strlen(s_path.u_name);
- if ((dir = dircache_search_by_name(vol, curdir, s_path.u_name, len, s_path.st.st_ctime)) == NULL) {
+ if ((dir = dircache_search_by_name(vol, curdir, s_path.u_name, len)) == NULL) {
if ((dir = dir_add(vol, curdir, &s_path, len)) == NULL) {
LOG(log_error, logtype_afpd, "enumerate(vid:%u, did:%u, name:'%s'): error adding dir: '%s'",
ntohs(vid), ntohl(did), o_path->u_name, s_path.u_name);