Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175278009
D26942.id78737.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
9 KB
Referenced Files
None
Subscribers
None
D26942.id78737.diff
View Options
Index: crypto/openssh/pathnames.h
===================================================================
--- crypto/openssh/pathnames.h
+++ crypto/openssh/pathnames.h
@@ -23,6 +23,8 @@
#define _PATH_SSH_PIDDIR "/var/run"
#endif
+#include <paths.h>
+
/*
* System-wide file containing host keys of known hosts. This file should be
* world-readable.
@@ -120,7 +122,7 @@
* Default location of askpass
*/
#ifndef _PATH_SSH_ASKPASS_DEFAULT
-#define _PATH_SSH_ASKPASS_DEFAULT "/usr/local/bin/ssh-askpass"
+#define _PATH_SSH_ASKPASS_DEFAULT _PATH_LOCALBASE "/bin/ssh-askpass"
#endif
/* Location of ssh-keysign for hostbased authentication */
@@ -135,7 +137,7 @@
/* xauth for X11 forwarding */
#ifndef _PATH_XAUTH
-#define _PATH_XAUTH "/usr/local/bin/xauth"
+#define _PATH_XAUTH _PATH_LOCALBASE "/bin/xauth"
#endif
/* UNIX domain socket for X11 server; displaynum will replace %u */
Index: crypto/openssh/regress/unittests/sshkey/test_sshkey.c
===================================================================
--- crypto/openssh/regress/unittests/sshkey/test_sshkey.c
+++ crypto/openssh/regress/unittests/sshkey/test_sshkey.c
@@ -9,6 +9,7 @@
#include <sys/types.h>
#include <sys/param.h>
+#include <paths.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
@@ -79,7 +80,7 @@
critopts = sshbuf_new();
ASSERT_PTR_NE(critopts, NULL);
- put_opt(critopts, "force-command", "/usr/local/bin/nethack");
+ put_opt(critopts, "force-command", _PATH_LOCALBASE "/bin/nethack");
put_opt(critopts, "source-address", "192.168.0.0/24,127.0.0.1,::1");
exts = sshbuf_new();
Index: crypto/openssh/ssh-agent.c
===================================================================
--- crypto/openssh/ssh-agent.c
+++ crypto/openssh/ssh-agent.c
@@ -92,7 +92,7 @@
#endif
#ifndef DEFAULT_PKCS11_WHITELIST
-# define DEFAULT_PKCS11_WHITELIST "/usr/lib*/*,/usr/local/lib*/*"
+# define DEFAULT_PKCS11_WHITELIST "/usr/lib*/*," _PATH_LOCALBASE "/lib*/*"
#endif
/* Maximum accepted message length */
Index: lib/libc/nls/msgcat.c
===================================================================
--- lib/libc/nls/msgcat.c
+++ lib/libc/nls/msgcat.c
@@ -49,6 +49,7 @@
#include <fcntl.h>
#include <limits.h>
#include <nl_types.h>
+#include <paths.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
@@ -58,7 +59,9 @@
#include "../locale/xlocale_private.h"
-#define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L"
+#define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:" \
+ _PATH_LOCALBASE "/share/nls/%L/%N.cat:" \
+ _PATH_LOCALBASE "/share/nls/%N/%L"
#define RLOCK(fail) { int ret; \
if (__isthreaded && \
Index: lib/libfetch/common.c
===================================================================
--- lib/libfetch/common.c
+++ lib/libfetch/common.c
@@ -44,6 +44,7 @@
#include <fcntl.h>
#include <inttypes.h>
#include <netdb.h>
+#include <paths.h>
#include <poll.h>
#include <pwd.h>
#include <stdarg.h>
@@ -1071,7 +1072,7 @@
/*
* Configure peer verification based on environment.
*/
-#define LOCAL_CERT_FILE "/usr/local/etc/ssl/cert.pem"
+#define LOCAL_CERT_FILE _PATH_LOCALBASE "/etc/ssl/cert.pem"
#define BASE_CERT_FILE "/etc/ssl/cert.pem"
static int
fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose)
Index: sbin/nvmecontrol/nvmecontrol.c
===================================================================
--- sbin/nvmecontrol/nvmecontrol.c
+++ sbin/nvmecontrol/nvmecontrol.c
@@ -179,7 +179,7 @@
cmd_init();
cmd_load_dir("/lib/nvmecontrol", NULL, NULL);
- cmd_load_dir("/usr/local/lib/nvmecontrol", NULL, NULL);
+ cmd_load_dir(_PATH_LOCALBASE "/lib/nvmecontrol", NULL, NULL);
cmd_dispatch(argc, argv, NULL);
Index: tools/tools/ath/athprom/athprom.c
===================================================================
--- tools/tools/ath/athprom/athprom.c
+++ 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;
Index: tools/tools/net80211/wesside/wesside/wesside.c
===================================================================
--- tools/tools/net80211/wesside/wesside/wesside.c
+++ 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 @@
* 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;
Index: usr.bin/fortune/fortune/pathnames.h
===================================================================
--- usr.bin/fortune/fortune/pathnames.h
+++ usr.bin/fortune/fortune/pathnames.h
@@ -30,5 +30,7 @@
* $FreeBSD$
*/
+#include <paths.h>
+
#define FORTDIR "/usr/share/games/fortune:" \
- "/usr/local/share/games/fortune"
+ _PATH_LOCALBASE "/share/games/fortune"
Index: usr.bin/mail/pathnames.h
===================================================================
--- usr.bin/mail/pathnames.h
+++ usr.bin/mail/pathnames.h
@@ -33,8 +33,10 @@
* $FreeBSD$
*/
+#include <paths.h>
+
#define _PATH_EX "/usr/bin/ex"
#define _PATH_HELP "/usr/share/misc/mail.help"
#define _PATH_TILDE "/usr/share/misc/mail.tildehelp"
-#define _PATH_MASTER_RC "/usr/share/misc/mail.rc:/usr/local/etc/mail.rc:/etc/mail.rc"
+#define _PATH_MASTER_RC "/usr/share/misc/mail.rc:" _PATH_LOCALBASE "/etc/mail.rc:/etc/mail.rc"
#define _PATH_LESS "/usr/bin/less"
Index: usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
===================================================================
--- usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
+++ usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
@@ -81,6 +81,7 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -148,7 +149,7 @@
static const char *paths[MAX_PATHS + 1] = {
"/usr/share/snmp/defs",
- "/usr/local/share/snmp/defs",
+ _PATH_LOCALBASE "/share/snmp/defs",
NULL
};
Index: usr.sbin/cpucontrol/cpucontrol.c
===================================================================
--- usr.sbin/cpucontrol/cpucontrol.c
+++ usr.sbin/cpucontrol/cpucontrol.c
@@ -38,6 +38,7 @@
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
+#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -59,7 +60,7 @@
int verbosity_level = 0;
-#define DEFAULT_DATADIR "/usr/local/share/cpucontrol"
+#define DEFAULT_DATADIR _PATH_LOCALBASE "/share/cpucontrol"
#define FLAG_I 0x01
#define FLAG_M 0x02
Index: usr.sbin/cron/cron/pathnames.h
===================================================================
--- usr.sbin/cron/cron/pathnames.h
+++ usr.sbin/cron/cron/pathnames.h
@@ -59,7 +59,7 @@
/* 4.3BSD-style crontab */
#define SYSCRONTAB "/etc/crontab"
#define SYSCRONTABS "/etc/cron.d"
-#define LOCALSYSCRONTABS "/usr/local/etc/cron.d"
+#define LOCALSYSCRONTABS _PATH_LOCALBASE "/etc/cron.d"
/* what editor to use if no EDITOR or VISUAL
* environment variable specified.
Index: usr.sbin/mailwrapper/mailwrapper.c
===================================================================
--- usr.sbin/mailwrapper/mailwrapper.c
+++ usr.sbin/mailwrapper/mailwrapper.c
@@ -40,6 +40,7 @@
#include <sys/param.h>
#include <err.h>
+#include <paths.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -105,7 +106,7 @@
addarg(&al, argv[0]);
snprintf(localmailerconf, MAXPATHLEN, "%s/etc/mail/mailer.conf",
- getenv("LOCALBASE") ? getenv("LOCALBASE") : "/usr/local");
+ getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE);
mailerconf = localmailerconf;
if ((config = fopen(localmailerconf, "r")) == NULL)
Index: usr.sbin/pciconf/pathnames.h
===================================================================
--- usr.sbin/pciconf/pathnames.h
+++ usr.sbin/pciconf/pathnames.h
@@ -1,4 +1,6 @@
/* $FreeBSD$ */
+#include <paths.h>
+
#define _PATH_DEVPCI "/dev/pci"
#define _PATH_PCIVDB "/usr/share/misc/pci_vendors"
-#define _PATH_LPCIVDB "/usr/local/share/pciids/pci.ids"
+#define _PATH_LPCIVDB _PATH_LOCALBASE "/share/pciids/pci.ids"
Index: usr.sbin/pkg/config.h
===================================================================
--- usr.sbin/pkg/config.h
+++ usr.sbin/pkg/config.h
@@ -31,7 +31,8 @@
#ifndef _PKG_CONFIG_H
#define _PKG_CONFIG_H
-#define _LOCALBASE "/usr/local"
+#include <paths.h>
+
#define URL_SCHEME_PREFIX "pkg+"
typedef enum {
Index: usr.sbin/pkg/config.c
===================================================================
--- usr.sbin/pkg/config.c
+++ usr.sbin/pkg/config.c
@@ -40,6 +40,7 @@
#include <ucl.h>
#include <err.h>
#include <errno.h>
+#include <paths.h>
#include <stdbool.h>
#include <unistd.h>
@@ -454,7 +455,7 @@
}
/* Read LOCALBASE/etc/pkg.conf first. */
- localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE;
+ localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE;
snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf",
localbase);
Index: usr.sbin/pkg/pkg.c
===================================================================
--- usr.sbin/pkg/pkg.c
+++ usr.sbin/pkg/pkg.c
@@ -1046,7 +1046,7 @@
yes = false;
snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg",
- getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE);
+ getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE);
if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) {
bootstrap_only = true;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 10, 4:05 PM (4 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40552958
Default Alt Text
D26942.id78737.diff (9 KB)
Attached To
Mode
D26942: Replace literal uses of /usr/local with a macro defined in paths.h
Attached
Detach File
Event Timeline
Log In to Comment