Commit b7ad8d3b authored by Mike Hibler's avatar Mike Hibler

Older FreeBSD requires an allocated buffer for realpath.

Also fixup clean target.
parent 91e3b608
......@@ -61,4 +61,4 @@ post-install:
control-install:
clean:
rm -f *.o genlastlog suexec core
rm -f *.o genlastlog suexec runsuid core
......@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <sys/param.h>
#include <sys/stat.h>
#include "config.h"
......@@ -50,7 +51,11 @@ sanedir(char *dir)
struct stat sb;
char *rpath;
if ((rpath = realpath(dir, NULL)) == NULL) {
if ((rpath = malloc(PATH_MAX)) == NULL) {
fprintf(stderr, "no memory!\n");
exit(2);
}
if (realpath(dir, rpath) == NULL) {
perror(dir);
exit(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment