* NEW: support for Unicode characters in the range above U+010000 using
internal surrogate pairs
* NEW: apple_dump: utility to dump AppleSingle and AppleDouble files
+* NEW: afpd: new volume option to enable live debugging of AFP connections:
+ debugfile:FILE. When FILE is created in volume root from the AFP
+ client, the afpd process raises its debug level to log_maxdebug
+ and writes to FILE.
* UPD: atalkd and papd are now disabled by default. AppleTalk is legacy.
* UPD: slp advertisement is now disabled by default. server option -slp
SRVLOC is legacy.
/*
- * $Id: file.c,v 1.131 2010-01-26 20:39:52 didg Exp $
+ * $Id: file.c,v 1.132 2010-02-04 10:52:29 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
}
upath = s_path->u_name;
-
+
/* if upath is deleted we already in trouble anyway */
if ((of = of_findname(s_path))) {
adp = of->of_ad;
setvoltime(obj, vol );
+ /* Check if this is the magic debugfile */
+ if (retvalue == AFP_OK
+ && curdir->d_did == htonl(2)
+ && vol->v_debugfile
+ && strcmp(upath, vol->v_debugfile) == 0) {
+ char *path = absupath(vol, curdir, upath);
+ char *logstring = malloc(strlen("default log_maxdebug ") + strlen(path) + 1);
+ sprintf(logstring, "default log_maxdebug %s", path);
+ setuplog(logstring);
+ free(logstring);
+ }
+
return (retvalue);
}
/*
- * $Id: volume.c,v 1.115 2010-01-26 09:31:59 didg Exp $
+ * $Id: volume.c,v 1.116 2010-02-04 10:52:29 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#define VOLOPT_FPERM 25 /* fperm default files perms */
#define VOLOPT_DFLTPERM 26 /* perm */
#define VOLOPT_EA_VFS 27 /* Extended Attributes vfs indirection */
-
-#define VOLOPT_MAX 28 /* <== IMPORTANT !!!!!! */
+#define VOLOPT_DEBUG_FILE 28 /* Enable debugging for one AFP process */
+#define VOLOPT_MAX 29 /* <== IMPORTANT !!!!!! */
#define VOLOPT_NUM (VOLOPT_MAX + 1)
#define VOLPASSLEN 8
else if (strcasecmp(val + 1, "none") == 0)
options[VOLOPT_EA_VFS].i_value = AFPVOL_EA_NONE;
+ } else if (optionok(tmp, "debugfile:", val)) {
+ setoption(options, save, VOLOPT_DEBUG_FILE, val);
+
} else {
/* ignore unknown options */
LOG(log_debug, logtype_afpd, "ignoring unknown volume option: %s", tmp);
if (options[VOLOPT_ROOTPOSTEXEC].c_value)
volume->v_root_postexec = volxlate(obj, NULL, MAXPATHLEN, options[VOLOPT_ROOTPOSTEXEC].c_value, pwd, path, name);
}
+
+ if (options[VOLOPT_DEBUG_FILE].c_value)
+ volume->v_debugfile = strdup(options[VOLOPT_DEBUG_FILE].c_value);
+
}
volume->v_dperm |= volume->v_perm;
volume->v_fperm |= volume->v_perm;
/*
- * $Id: volume.h,v 1.11 2010-01-05 12:06:34 franklahm Exp $
+ * $Id: volume.h,v 1.12 2010-02-04 10:52:29 franklahm Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
char *v_postexec;
int v_root_preexec_close;
int v_preexec_close;
-
+ char *v_debugfile; /* magic file that enables debugging when created in did 2 */
#ifdef FORCE_UIDGID
char *v_forceuid;
char *v_forcegid;