2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-03 07:45:47 +00:00

now use sudo_realpath()

This commit is contained in:
Todd C. Miller
1994-07-25 22:25:58 +00:00
parent 0230d8474c
commit 93230e6c29

View File

@@ -110,7 +110,7 @@ char *find_path(file)
*/ */
/* XXX - check return val here? */ /* XXX - check return val here? */
if (strchr(file, '/')) if (strchr(file, '/'))
return((char *) realpath(file, command)); return((char *) sudo_realpath(file, command));
/* /*
* grab PATH out of environment and make a local copy * grab PATH out of environment and make a local copy
@@ -180,7 +180,7 @@ static char * realpath_exec(path, file, command)
/* resolve the path */ /* resolve the path */
errno = 0; errno = 0;
if (realpath(fn, command)) { if (sudo_realpath(fn, command)) {
/* stat the file to make sure it is executable */ /* stat the file to make sure it is executable */
if (stat(command, &statbuf) == 0 && (statbuf.st_mode & 0000111)) if (stat(command, &statbuf) == 0 && (statbuf.st_mode & 0000111))
return(command); return(command);