Signed-off-by: Christopher Bii <christopherbii@xxxxxxxx> --- support/misc/nfsd_path.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/support/misc/nfsd_path.c b/support/misc/nfsd_path.c index 5168903d..ff946301 100644 --- a/support/misc/nfsd_path.c +++ b/support/misc/nfsd_path.c @@ -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 * -- 2.47.1