#include <atalk/cnid.h>
#include <atalk/bstradd.h>
#include <atalk/globals.h>
+#include <atalk/netatalk_conf.h>
#include "fork.h"
#include "file.h"
struct ofork *writtenfork;
#endif
-static int getforkparams(struct ofork *ofork, uint16_t bitmap, char *buf, size_t *buflen)
+static int getforkparams(const AFPObj *obj, struct ofork *ofork, uint16_t bitmap, char *buf, size_t *buflen)
{
struct path path;
struct stat *st;
vol = ofork->of_vol;
dir = dirlookup(vol, ofork->of_did);
- if (NULL == (path.u_name = mtoupath(vol, of_name(ofork), dir->d_did, utf8_encoding()))) {
+ if (NULL == (path.u_name = mtoupath(vol, of_name(ofork), dir->d_did, utf8_encoding(obj)))) {
return( AFPERR_MISC );
}
path.m_name = of_name(ofork);
}
}
}
- return getmetadata(vol, bitmap, &path, dir, buf, buflen, adp );
+ return getmetadata(obj, vol, bitmap, &path, dir, buf, buflen, adp );
}
static off_t get_off_t(char **ibuf, int is64)
/* FIXME should we check it first ? */
upath = s_path->u_name;
if (!vol_unix_priv(vol)) {
- if (check_access(upath, access ) < 0) {
+ if (check_access(obj, vol, upath, access ) < 0) {
return AFPERR_ACCESS;
}
} else {
- if (file_access(s_path, access ) < 0) {
+ if (file_access(obj, vol, s_path, access ) < 0) {
return AFPERR_ACCESS;
}
}
}
}
- if ((ret = getforkparams(ofork, bitmap, rbuf + 2 * sizeof(int16_t), &buflen)) != AFP_OK) {
+ if ((ret = getforkparams(obj, ofork, bitmap, rbuf + 2 * sizeof(int16_t), &buflen)) != AFP_OK) {
ad_close( ofork->of_ad, adflags | ADFLAGS_SETSHRMD);
goto openfork_err;
}
return ret;
}
-int afp_setforkparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen, char *rbuf _U_, size_t *rbuflen)
+int afp_setforkparams(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf _U_, size_t *rbuflen)
{
struct ofork *ofork;
off_t size;
is64 = 0;
if ((bitmap & ( (1<<FILPBIT_EXTDFLEN) | (1<<FILPBIT_EXTRFLEN) ))) {
- if (afp_version >= 30) {
+ if (obj->afp_version >= 30) {
is64 = 4;
}
else
}
/* ---------------------------- */
-int afp_getforkparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
+int afp_getforkparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
{
struct ofork *ofork;
int ret;
}
}
- if (AFP_OK != (ret = getforkparams(ofork, bitmap, rbuf + sizeof( u_short ), &buflen ))) {
+ if (AFP_OK != (ret = getforkparams(obj, ofork, bitmap, rbuf + sizeof( u_short ), &buflen ))) {
return( ret );
}