@@ -55,19 +55,11 @@ nfsd_rootdir_set(void)
char *
nfsd_path_strip_root(char *pathname)
{
- char buffer[PATH_MAX];
- const char *dir = nfsd_path_rootdir();
-
- if (!dir)
- goto out;
-
- if (realpath(dir, buffer))
- return strstr(pathname, buffer) == pathname ?
- pathname + strlen(buffer) : NULL;
+ if (!rootdir)
+ return pathname;
- xlog(D_GENERAL, "%s: failed to resolve path %s: %m", __func__, dir);
-out:
- return pathname;
+ return strstr(pathname, rootdir) == pathname ?
+ pathname + rootdir_pathlen : pathname;
}
char *
Signed-off-by: Christopher Bii <christopherbii@hyub.org> --- support/misc/nfsd_path.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)