fork().
June 29, 2005: core dump going off end of exported_ap[] array.
September 29, 2005: patch/fix for pawd not to go into an infinite loop.
+October 25, 2005: patch/fix for pawd to repeatedly resolve path.
* David Rage <rage@ucl.ac.uk>
January 17, 2005: prevent Amd from logging 'Read-only filesystem' errors
+2005-10-25 Erez Zadok <ezk@cs.sunysb.edu>
+
+ * amq/pawd.c (transform_dir): resolve path repeatedly until
+ finished. Bug fix from Jonathan Chen <jon+amd-at-spock.org>.
+ Added safety check to prevent infinite loops.
+
2005-10-19 Erez Zadok <ezk@cs.sunysb.edu>
* doc/am-utils.texi (opts Option): document new pcfs options
- Bugs fixed:
* correctly print nfs_args->addr info (sin_family/port/addr)
+ * pawd should resolve path repeatedly until no more to do
*** Notes specific to am-utils version 6.2a1
#include <am_defs.h>
#include <amq.h>
+/* maximum number of transformations for each path */
+#define MAX_LOOP 10
+
/* statics */
static char *localhost = "localhost";
static char transform[MAXPATHLEN];
struct timeval tmo = {10, 0};
char *dummystr;
amq_string *spp;
+ int again = 1, maxloop = MAX_LOOP;
#ifdef DISK_HOME_HACK
if (ch = hack_name(dir))
return dir;
xstrlcpy(transform, dir, sizeof(transform));
- dummystr = transform;
- spp = amqproc_pawd_1((amq_string *) &dummystr, clnt);
- if (spp && *spp && **spp) {
- xstrlcpy(transform, *spp, sizeof(transform));
- XFREE(*spp);
+ while (again) {
+ if (--maxloop <= 0) {
+ fprintf(stderr, "pawd: exceeded maximum no. of transformations (%d)\n",
+ MAX_LOOP);
+ break;
+ }
+ again = 0;
+ dummystr = transform;
+ spp = amqproc_pawd_1((amq_string *) &dummystr, clnt);
+ if (spp && *spp && **spp) {
+ if (STREQ(transform, *spp))
+ again++;
+ xstrlcpy(transform, *spp, sizeof(transform));
+ XFREE(*spp);
+ }
}
clnt_destroy(clnt);
return transform;