Bug#372155: [Pkg-shadow-devel] Bug#372155: shadow: FTBFS on hurd-i386: PATH_MAX issue

Alexander Gattin xrgtn at yandex.ru
Thu Jun 8 20:23:45 UTC 2006


Hi!

On Thu, Jun 08, 2006 at 04:58:12PM +0200, Michael Banck wrote:
> --- lib/commonio.c.orig	2006-06-08 15:12:21.000000000 +0200
> +++ lib/commonio.c	2006-06-08 15:39:49.000000000 +0200
> @@ -47,13 +47,22 @@
>  int lrename (const char *old, const char *new)
>  {
>  
> +#ifdef PATH_MAX
>  	char resolved_path[PATH_MAX];
> +#else
> +	char *resolved_path;
> +#endif
>  	int res;
>  
>  #if defined(S_ISLNK)
>  	struct stat sb = { 0 };
>  	if (lstat (new, &sb) == 0 && S_ISLNK (sb.st_mode)) {
> +#ifndef PATH_MAX
> +		resolved_path = realpath (new, NULL);
> +		if (resolved_path == NULL) {
> +#else
>  		if (realpath (new, resolved_path) == NULL) {
> +#endif
>  			perror ("realpath in lrename()");
>  		} else {
>  			new = resolved_path;

Hey, I don't see the "char *resolved_path" pointer
being freed anywhere afterwards...

-- 
WBR,
xrgtn




More information about the Pkg-shadow-devel mailing list