Makefile
Makefile.in
afpd
+fce
hash
test_parse_mtab
.deps
pkgconfdir = @PKGCONFDIR@
sbin_PROGRAMS = afpd
-noinst_PROGRAMS = hash
+noinst_PROGRAMS = hash fce
afpd_SOURCES = \
afp_asp.c \
directory.c \
enumerate.c \
extattrs.c \
+ fce_api.c \
+ fce_util.c \
file.c \
filedir.c \
fork.c \
endif
-noinst_HEADERS = auth.h afp_config.h desktop.h directory.h file.h \
+noinst_HEADERS = auth.h afp_config.h desktop.h directory.h fce_api.h fce_api_internal.h file.h \
filedir.h fork.h globals.h icon.h mangle.h misc.h status.h switch.h \
uam_auth.h uid.h unix.h volume.h hash.h acls.h acl_mappings.h extattrs.h \
dircache.h afp_zeroconf.h afp_avahi.h
hash_SOURCES = hash.c
hash_CFLAGS = -DKAZLIB_TEST_MAIN -I$(top_srcdir)/include
+
+fce_SOURCES = fce_api.c fce_util.c
+fce_CFLAGS = -DFCE_TEST_MAIN -I$(top_srcdir)/include
+fce_LDADD = $(top_builddir)/libatalk/libatalk.la
fce_add_udp_socket(c);
}
if ((c = getoption(buf, "-fcecoalesce"))) {
- LOG(log_ote, logtype_afpd, "Fce coalesce: %s", c);
+ LOG(log_note, logtype_afpd, "Fce coalesce: %s", c);
fce_set_coalesce(c);
}
/*\r
- * $Id: fce_api.c,v 0.01 2010-10-01 00:00:0 mw Exp $\r
- *\r
* Copyright (c) 2010 Mark Williams\r
*\r
* File change event API for netatalk\r
int fce_register_file_modification( struct ofork *ofork )\r
{\r
char *u_name = NULL;\r
- struct dir *dir;\r
struct vol *vol;\r
int ret = AFP_OK;\r
\r
- if (ofork == NULL || ofork->of_vol == NULL || ofork->of_dir == NULL)\r
+ if (ofork == NULL || ofork->of_vol == NULL)\r
return AFPERR_PARAM;\r
\r
vol = ofork->of_vol;\r
- dir = ofork->of_dir;\r
\r
- if (NULL == (u_name = mtoupath(vol, of_name(ofork), dir->d_did, utf8_encoding()))) \r
+ if (NULL == (u_name = mtoupath(vol, of_name(ofork), ofork->of_did, utf8_encoding()))) \r
{\r
return AFPERR_MISC;\r
}\r
if (end_time && now >= end_time)\r
break;\r
\r
- register_fce( path, event_code );\r
+ register_fce( path, 0, event_code );\r
ev_cnt++;\r
\r
\r
upath = s_path->u_name;
if ( path_isadir( s_path) ) {
- if (*s_path->m_name != '\0' || curdir->d_did == DIRDID_ROOT)
+ if (*s_path->m_name != '\0' || curdir->d_did == DIRDID_ROOT) {
rc = AFPERR_ACCESS;
- } else {
- /* we have to cache this, the structs are lost in deletcurdir*/
- /* but we need the positive returncode to send our event */
- char dname[256];
- strncpy(dname, curdir->d_u_name, 255 );
- if ((rc = deletecurdir(vol)) == AFP_OK)
- fce_register_delete_dir(dname);
- }
+ } else {
+ /* we have to cache this, the structs are lost in deletcurdir*/
+ /* but we need the positive returncode to send our event */
+ bstring dname;
+ if ((dname = bstrcpy(curdir->d_u_name)) == NULL)
+ return AFPERR_MISC;
+ if ((rc = deletecurdir(vol)) == AFP_OK)
+ fce_register_delete_dir(cfrombstr(dname));
+ bdestroy(dname);
+ }
} else if (of_findname(s_path)) {
rc = AFPERR_BUSY;
} else {
if (s_path->st_valid && s_path->st_errno == ENOENT) {
rc = AFPERR_NOOBJ;
} else {
- if ((rc = deletefile(vol, -1, upath, 1)) === AFP_OK)
+ if ((rc = deletefile(vol, -1, upath, 1)) == AFP_OK)
fce_register_delete_file( s_path );
struct dir *cachedfile;