Skip to content

Commit 83c7c09

Browse files
rakucolpereira
authored andcommitted
Be more portable with realpath(3)
1 parent d4d0af0 commit 83c7c09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lwan-serve-files.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ serve_files(lwan_request_t *request, void *root_directory)
117117
lwan_request_set_response(request, response);
118118

119119
/* FIXME: ``canonical_root'' should be cached somewhere. */
120-
canonical_root = canonicalize_file_name(root_directory);
120+
canonical_root = realpath(root_directory, NULL);
121121
if (!canonical_root)
122122
return (errno == EACCES) ? HTTP_FORBIDDEN : HTTP_INTERNAL_ERROR;
123123

@@ -127,7 +127,7 @@ serve_files(lwan_request_t *request, void *root_directory)
127127
goto end;
128128
}
129129

130-
canonical_path = canonicalize_file_name(path_to_canonicalize);
130+
canonical_path = realpath(path_to_canonicalize, NULL);
131131
if (!canonical_path) {
132132
switch (errno) {
133133
case EACCES:

0 commit comments

Comments
 (0)