/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#include "lint.h"
#include <dirent.h>
#include <limits.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/*
* Canonicalize the path given in file_name, resolving away all symbolic link
* components. Store the result into the buffer named by resolved_name, which
* must be long enough (PATH_MAX bytes will suffice). Returns NULL
* on failure and resolved_name on success. On failure, to maintain
* compatibility with the past, the contents of file_name will be copied
* into resolved_name.
*/
static char *
{
int len;
return (NULL);
}
/*
* Call resolvepath() to resolve all the symlinks in file_name,
* eliminate embedded "." components, and collapse embedded ".."
* components. We may be left with leading ".." components.
*/
return (NULL); /* errno set by resolvepath() */
}
return (resolved_name);
/*
* Prepend the current working directory to the relative path.
* If the relative path is not empty (or "."), collapse all of the
* resulting embedded ".." components with trailing cwd components.
* We know that getcwd() returns a path name free of symlinks.
*/
return (NULL); /* errno set by getcwd() */
}
/*
* Eliminate ".." components from the relative path
* left-to-right, components from cwd right-to-left.
*/
relpath += 3;
len -= 3;
while (*--endcwd != '/')
continue;
}
if (len == 0) {
/* the relative path was all ".." components */
*endcwd = '\0';
} else {
/* there are non-null components on both sides */
*endcwd++ = '/';
(void) strlcpy(resolved_name,
return (NULL);
}
}
}
return (resolved_name);
}
/*
* Canonicalize the path given in file_name, resolving away all symbolic link
* components. If resolved_name is a null pointer, return a malloc()d
* buffer containing the result, else store the result into resolved_name
* and return resolved_name. Return NULL on failure.
*/
char *
{
if (resolved_name != NULL)
return (NULL);
}
/*
* GNU extension.
*/
char *
{
}