errno = 0;
tmpbuf = true_getcwd_DEFAULT(buf, size);
sandbox_on = 1;
if (tmpbuf) {
if ((tmpbuf) && (errno == 0)) {
old_errno = errno;
lstat(buf, &st);
}
errno = old_errno;
} else if (errno != 0) {
/* Make sure we do not return garbage if the current libc or kernel's
/* Make sure we do not return garbage if the current libc or
* getcwd() is buggy.
* kernel's getcwd() is buggy.
*/
if (errno != 0) {
if (tmpbuf)
free(tmpbuf);
return NULL;