summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2020-10-27 11:29:11 +0000
committerStefan Eßer <se@FreeBSD.org>2020-10-27 11:29:11 +0000
commit1f474190fc280d4a4ef0c214e4d7fff0d1237e22 (patch)
tree123ca2f0a46ad9a1203a6b3c7a7a38c2a50854e6 /tools
parent7b39bef2cf93f6f0e79cc55a8ee2d339e42a6816 (diff)
downloadsrc-test2-1f474190fc280d4a4ef0c214e4d7fff0d1237e22.tar.gz
src-test2-1f474190fc280d4a4ef0c214e4d7fff0d1237e22.zip
Replace literal uses of /usr/local in C sources with _PATH_LOCALBASE
Literal references to /usr/local exist in a large number of files in the FreeBSD base system. Many are in contributed software, in configuration files, or in the documentation, but 19 uses have been identified in C source files or headers outside the contrib and sys/contrib directories. This commit makes it possible to set _PATH_LOCALBASE in paths.h to use a different prefix for locally installed software. In order to avoid changes to openssh source files, LOCALBASE is passed to the build via Makefiles under src/secure. While _PATH_LOCALBASE could have been used here, there is precedent in the construction of the path used to a xauth program which depends on the LOCALBASE value passed on the compiler command line to select a non-default directory. This could be changed in a later commit to make the openssh build consistently use _PATH_LOCALBASE. It is considered out-of-scope for this commit. Reviewed by: imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26942
Notes
Notes: svn path=/head/; revision=367075
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/ath/athprom/athprom.c3
-rw-r--r--tools/tools/net80211/wesside/wesside/wesside.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/tools/ath/athprom/athprom.c b/tools/tools/ath/athprom/athprom.c
index e295fd1d70a1..1010c0bf5315 100644
--- a/tools/tools/ath/athprom/athprom.c
+++ b/tools/tools/ath/athprom/athprom.c
@@ -41,12 +41,13 @@
#include <getopt.h>
#include <errno.h>
#include <err.h>
+#include <paths.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifndef DIR_TEMPLATE
-#define DIR_TEMPLATE "/usr/local/libdata/athprom"
+#define DIR_TEMPLATE _PATH_LOCALBASE "/libdata/athprom"
#endif
struct ath_diag atd;
diff --git a/tools/tools/net80211/wesside/wesside/wesside.c b/tools/tools/net80211/wesside/wesside/wesside.c
index 5d63dc421990..d1e6fd8fe6d7 100644
--- a/tools/tools/net80211/wesside/wesside/wesside.c
+++ b/tools/tools/net80211/wesside/wesside/wesside.c
@@ -32,6 +32,7 @@
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <arpa/inet.h>
+#include <paths.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -154,7 +155,7 @@ unsigned int min_prga = 128;
* XXX builtin pathnames
*/
#define CRACK_LOCAL_CMD "../aircrack/aircrack"
-#define CRACK_INSTALL_CMD "/usr/local/bin/aircrack"
+#define CRACK_INSTALL_CMD _PATH_LOCALBASE "/bin/aircrack"
#define INCR 10000
int thresh_incr = INCR;