diff options
author | Todd C. Miller <Todd.Miller@courtesan.com> | 1995-03-24 03:32:53 +0000 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@courtesan.com> | 1995-03-24 03:32:53 +0000 |
commit | 990b26b599f47fd9feab3eeff57f9b491bba1b8d (patch) | |
tree | 8874954911eba305693beaa1cb47b47871ff335f /sudo_realpath.c | |
parent | 1b16e8235e64ac3d90a3ddc75da9569cefd15c32 (diff) | |
download | sudo-990b26b599f47fd9feab3eeff57f9b491bba1b8d.tar.gz |
merged in utk changes
Diffstat (limited to 'sudo_realpath.c')
-rw-r--r-- | sudo_realpath.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sudo_realpath.c b/sudo_realpath.c index 753895e99..40db05a92 100644 --- a/sudo_realpath.c +++ b/sudo_realpath.c @@ -94,6 +94,7 @@ char * sudo_realpath(old, new) struct stat statbuf; /* for lstat() */ char * temp; /* temporary ptr */ int len; /* length parameter */ + int err; /* did we get an error? */ /* check for brain damage */ if (old == NULL || old[0] == '\0') @@ -105,6 +106,12 @@ char * sudo_realpath(old, new) /* we need to be root for this section */ set_perms(PERM_ROOT); +#ifndef USE_REALPATH + err = stat(new, &statbuf); + set_perms(PERM_USER); + return((err == 0) ? new : NULL); +#endif /* USE_REALPATH */ + /* * Resolve the last component of the path if it is a link * until it is a non-link. |