Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Aug 1995 11:15:22 -0700
From:      Bill Trost <trost@cloud.rain.com>
To:        bugs@freebsd.org
Subject:   realpath() doesn't terminate on symlink loops
Message-ID:  <m0simzq-00004eC@cloud.rain.com>

next in thread | raw e-mail | index | archive | help
The following program hangs under both 2.0.0-SNAP950322 and 2.0.5.
(No, I haven't looked at how to fix it -- sorry)


#include <sys/param.h>
#include <stdlib.h>

main(int argc, char **argv) {
	char result[MAXPATHLEN];
	char *f = "/tmp/loop.trost";

	symlink(f, f);
	
	if (realpath(f, result) == 0)
		printf("We have a problem here, Houston: %s\n", result);
	else
		printf("path is %s\n", result);
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0simzq-00004eC>