LOG(log_debug, logtype_afpd,
"afp_openfork(\"%s\", %s)",
- abspath(s_path->u_name),
+ fullpathname(s_path->u_name),
(fork & OPENFORK_RSCS) ? "OPENFORK_RSCS" : "OPENFORK_DATA");
/* stat() data fork st is set because it's not a dir */
break;
default:
LOG(log_error, logtype_afpd, "afp_openfork(\"%s\"): %s",
- abspath(s_path->m_name), strerror(errno) );
+ fullpathname(s_path->m_name), strerror(errno) );
goto openfork_err;
break;
}
goto afp_read_err;
}
-<<<<<<< HEAD
-#define min(a,b) ((a)<(b)?(a):(b))
- *rbuflen = min( reqcount, *rbuflen );
-=======
*rbuflen = MIN(reqcount, *rbuflen);
LOG(log_debug, logtype_afpd, "afp_read(name: \"%s\", offset: %jd, reqcount: %jd): reading %jd bytes from file",
of_name(ofork), (intmax_t)offset, (intmax_t)reqcount, (intmax_t)*rbuflen);
->>>>>>> netafp/master
+
err = read_file(ofork, eid, offset, nlmask, nlchar, rbuf, rbuflen, xlate);
if (err < 0)
goto afp_read_done;
* in reqcount et al. */
static int write_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen, int is64)
{
-<<<<<<< HEAD
struct ofork *ofork;
- off_t offset, saveoff, reqcount;
+ off_t offset, saveoff, reqcount, oldsize, newsize;
int endflag, eid, xlate = 0, err = AFP_OK;
uint16_t ofrefnum;
-=======
- struct ofork *ofork;
- off_t offset, saveoff, reqcount, oldsize, newsize;
- int endflag, eid, xlate = 0, err = AFP_OK;
- u_int16_t ofrefnum;
->>>>>>> netafp/master
ssize_t cc;
/* figure out parameters */
dbd_log(LOGSTD, "Updating AppleDouble file for '%s/%s' with CNID: %u from database",
cwdbuf, name, ntohl(db_cnid));
ad_init(&ad, myvolinfo->v_adouble, myvolinfo->v_ad_options);
- if (ad_open_metadata( name, adflags, O_RDWR, &ad) != 0) {
+ if (ad_open(&ad, name, adflags | ADFLAGS_HF, O_RDWR, 0666, &ad) != 0) {
dbd_log(LOGSTD, "Error opening AppleDouble file for '%s/%s': %s",
cwdbuf, name, strerror(errno));
return CNID_INVALID;
talloc.h \
tevent.h \
tsocket.h \
- boolean.h \
compat.h \
dsi.h \
ldapconfig.h \
* unix.c
*****************************************************************/
-extern const char *abspath(const char *name);
extern const char *getcwdpath(void);
extern const char *fullpathname(const char *);
extern char *stripped_slashes_basename(char *p);
int st_invalid = -1;
LOG(log_debug, logtype_default, "ad_open_df(\"%s\", %s, %04o)",
- abspath(path), oflags2logstr(oflags), mode);
+ fullpathname(path), oflags2logstr(oflags), mode);
if (ad_data_fileno(ad) == -1) {
hoflags = (oflags & ~(O_RDONLY | O_WRONLY)) | O_RDWR;
* if ((oflags & O_CREAT) ==> (oflags & O_RDWR)
*/
LOG(log_debug, logtype_default, "ad_open(\"%s\"): creating adouble file",
- abspath(path));
+ fullpathname(path));
admode = mode;
errno = 0;
st_invalid = ad_mode_st(ad_p, &admode, &st_dir);
/* Create one */
if (new_ad_header(path, ad, adflags) < 0) {
LOG(log_error, logtype_default, "ad_open_hf_ea: can't create new header: %s",
- abspath(path));
+ fullpathname(path));
goto error;
}
ad->ad_md->adf_flags |= O_CREAT; /* mark as just created */
break;
default:
LOG(log_warning, logtype_default, "ad_open_rf(\"%s\"): %s",
- abspath(path), strerror(errno));
+ fullpathname(path), strerror(errno));
ret = -1;
goto exit;
}
int mode = 0;
LOG(log_debug, logtype_default, "ad_open(\"%s\", %s)",
- abspath(path), adflags2logstr(adflags));
+ fullpathname(path), adflags2logstr(adflags));
if (ad->ad_inited != AD_INITED) /* 1 */
AFP_PANIC("ad_open: not initialized");
if (ad->ad_fullpath == NULL) { /* 2 */
- if ((ad->ad_fullpath = bfromcstr(abspath(path))) == NULL) {
+ if ((ad->ad_fullpath = bfromcstr(fullpathname(path))) == NULL) {
ret = -1;
goto exit;
}
#include <atalk/compat.h>
-#ifndef HAVE_STRNLEN
-size_t strnlen(const char *s, size_t max)
-{
- size_t len;
-
- for (len = 0; len < max; len++) {
- if (s[len] == '\0') {
- break;
- }
- }
- return len;
-
#if !defined HAVE_DIRFD && defined SOLARIS
#include <dirent.h>
int dirfd(DIR *dir)
#include <atalk/dsi.h>
#include <atalk/logger.h>
-#include <netatalk/endian.h>
/* this assumes that the reply follows right after the command, saving
* on a couple assignments. specifically, command, requestID, and
/* ----------------- */
static int RF_chown_ea(VFS_FUNC_ARGS_CHOWN)
{
- mode_t file_mode = ad_hf_mode(mode);
- mode_t dir_mode = file_mode;
- struct set_mode param;
-
- if ((dir_mode & (S_IRUSR | S_IWUSR )))
- dir_mode |= S_IXUSR;
- if ((dir_mode & (S_IRGRP | S_IWGRP )))
- dir_mode |= S_IXGRP;
- if ((dir_mode & (S_IROTH | S_IWOTH )))
- dir_mode |= S_IXOTH;
-
- /* change folder */
- dir_mode |= DIRBITS;
- if (dir_rx_set(dir_mode)) {
- if (chmod_acl( name, dir_mode ) < 0)
- return -1;
- }
- param.st = st;
- param.mode = file_mode;
- if (for_each_adouble("setfilmode_ads", name, ads_setfilmode_loop, ¶m, 0, v_umask) < 0)
- return -1;
-
- if (!dir_rx_set(dir_mode)) {
- if (chmod_acl( name, dir_mode ) < 0)
- return -1;
- }
-
return 0;
}