sized types and more krb lib lossage...

Assar Westerlund assar at sics.se
Mon Mar 2 22:50:46 CET 1998


John Hawkinson <jhawk at MIT.EDU> writes:
> Also, following symlinks doesn't seem to work:

It doesn't in `arlad -t'.  Running real arlad it works. :)

The patch below is not that pretty but it seems to make at least
relative symlinks work.

/assar

Index: arlad/arla.c
===================================================================
RCS file: /usr/local/cvsroot/arla/arlad/arla.c,v
retrieving revision 1.45
diff -u -w -u -w -r1.45 arla.c
--- arla.c	1998/02/23 07:01:52	1.45
+++ arla.c	1998/03/02 21:49:29
@@ -96,6 +96,9 @@
      char *comp;
      VenusFid file;
      Result ret;
+     FCacheEntry *entry;
+     int error;
+     char symlink[MAXPATHLEN];
 
      do {
 	 comp = fname;
@@ -109,7 +112,39 @@
 	     ARLADEB (ADEBMISC, ("Error in lookup\n"));
 	     return cwd;
 	 }
+	 error = fcache_get (&entry, file, tmpce);
+	 if (error) {
+	     ARLADEB (ADEBMISC, ("Error in fcache_get\n"));
+	     return cwd;
+	 }
+	 error = fcache_get_data (entry, tmpce);
+	 if (error) {
+	     ReleaseWriteLock (&entry->lock);
+	     ARLADEB (ADEBMISC, ("Error in fcache_get_data\n"));
+	     return cwd;
+	 }
+	 if (entry->status.FileType == TYPE_LINK) {
+	     int len;
+	     int fd;
+
+	     fd = fcache_open_file (entry, O_RDONLY, 0);
+	     if (fd < 0) {
+		 ReleaseWriteLock(&entry->lock);
+		 ARLADEB (ADEBMISC, ("Error in fcache_open_file\n"));
+		 return cwd;
+	     }
+	     len = read (fd, symlink, sizeof(symlink));
+	     close (fd);
+	     if (len <= 0) {
+		 ReleaseWriteLock(&entry->lock);
+		 ARLADEB (ADEBMISC, ("cannot read symlink\n"));
+		 return cwd;
+	     }
+	     symlink[len] = '\0';
+	     fname = comp = slash = symlink;
+	 } else
 	 cwd = file;
+	 ReleaseWriteLock (&entry->lock);
      } while(slash != NULL && *comp);
      return cwd;
 }





More information about the Arla-drinkers mailing list