mailx/nail-11.25-path.dif
2014-12-17 12:34:52 +00:00

265 lines
7.0 KiB
Plaintext

--- Makefile
+++ Makefile 2005-10-14 13:44:09.000000000 +0000
@@ -11,13 +11,9 @@ BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man
SYSCONFDIR = /etc
-MAILRC = $(SYSCONFDIR)/nail.rc
-MAILSPOOL = /var/mail
-SENDMAIL = /usr/lib/sendmail
-
DESTDIR =
-UCBINSTALL = /usr/ucb/install
+UCBINSTALL = install
# Define compiler, preprocessor, and linker flags here.
# Note that some Linux/glibc versions need -D_GNU_SOURCE in CPPFLAGS, or
@@ -50,7 +46,7 @@ SHELL = /bin/sh
# If you know that the IPv6 functions work on your machine, you can enable
# them here.
-#IPv6 = -DHAVE_IPv6_FUNCS
+##IPv6 = -DHAVE_IPv6_FUNCS
#
# Binaries are stripped with this command after installation.
@@ -63,8 +59,7 @@ STRIP = strip
###########################################################################
###########################################################################
-FEATURES = -DMAILRC='"$(MAILRC)"' -DMAILSPOOL='"$(MAILSPOOL)"' \
- -DSENDMAIL='"$(SENDMAIL)"' $(IPv6)
+FEATURES = $(IPv6)
OBJ = aux.o base64.o cache.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o \
dotlock.o edit.o fio.o getname.o getopt.o head.o hmac.o \
--- cmd1.c
+++ cmd1.c 2005-10-14 13:44:09.000000000 +0000
@@ -78,7 +78,7 @@ get_pager(void)
cp = value("PAGER");
if (cp == NULL || *cp == '\0')
- cp = value("bsdcompat") ? "more" : "pg";
+ cp = value("bsdcompat") ? PATH_MORE : PATH_PG;
return cp;
}
@@ -757,7 +757,7 @@ type1(int *msgvec, int doign, int page,
if (pipe) {
cp = value("SHELL");
if (cp == NULL)
- cp = SHELL;
+ cp = PATH_CSHELL;
obuf = Popen(cmd, "w", cp, 1);
if (obuf == NULL) {
perror(cmd);
--- cmd3.c
+++ cmd3.c 2005-10-14 13:44:09.000000000 +0000
@@ -90,7 +90,7 @@ shell(void *v)
if (bangexp(&cmd, &cmdsize) < 0)
return 1;
if ((shell = value("SHELL")) == NULL)
- shell = SHELL;
+ shell = PATH_CSHELL;
run_command(shell, 0, -1, -1, "-c", cmd, NULL);
safe_signal(SIGINT, sigint);
printf("!\n");
@@ -109,7 +109,7 @@ dosh(void *v)
char *shell;
if ((shell = value("SHELL")) == NULL)
- shell = SHELL;
+ shell = PATH_CSHELL;
run_command(shell, 0, -1, -1, NULL, NULL, NULL);
safe_signal(SIGINT, sigint);
putchar('\n');
--- collect.c
+++ collect.c 2005-10-14 13:44:09.000000000 +0000
@@ -121,7 +121,7 @@ insertcommand(FILE *fp, char *cmd)
if (sigsetjmp(pipejmp, 1))
goto endpipe;
if (cp == NULL)
- cp = SHELL;
+ cp = PATH_CSHELL;
if ((obuf = Popen(cmd, "r", cp, 0)) == NULL) {
perror(cmd);
return;
@@ -1051,7 +1051,7 @@ mespipe(char *cmd)
* stdout = new message.
*/
if ((shell = value("SHELL")) == NULL)
- shell = SHELL;
+ shell = PATH_CSHELL;
if (run_command(shell,
0, fileno(collf), fileno(nf), "-c", cmd, NULL) < 0) {
Fclose(nf);
--- def.h
+++ def.h 2005-10-14 13:45:56.000000000 +0000
@@ -642,3 +642,68 @@ enum ssl_vrfy_level {
VRFY_STRICT
};
#endif /* USE_SSL */
+
+#include <paths.h>
+#ifndef PATH_MORE
+# ifdef _PATH_MORE
+# define PATH_MORE _PATH_MORE
+# else
+# define PATH_MORE "/usr/bin/more"
+# endif
+#endif
+#ifndef PATH_PG
+# ifdef _PATH_PG
+# define PATH_PG _PATH_PG
+# else
+# define PATH_PG "/usr/bin/less"
+# endif
+#endif
+#ifndef PATH_CSHELL
+# ifdef _PATH_CSHELL
+# define PATH_CSHELL _PATH_CSHELL
+# else
+# define PATH_CSHELL "/usr/bin/tcsh"
+# endif
+#endif
+#ifndef PATH_MAILDIR
+# ifdef _PATH_MAILDIR
+# define PATH_MAILDIR _PATH_MAILDIR
+# else
+# define PATH_MAILDIR "/var/mail"
+# endif
+#endif
+#ifndef PATH_EX
+# ifdef _PATH_EX
+# define PATH_EX _PATH_EX
+# else
+# define PATH_EX "/usr/bin/ex"
+# endif
+#endif
+#ifndef PATH_VI
+# ifdef _PATH_VI
+# define PATH_VI _PATH_VI
+# else
+# define PATH_VI "/usr/bin/vi"
+# endif
+#endif
+#ifndef PATH_MASTER_RC
+# ifdef _PATH_MASTER_RC
+# define PATH_MASTER_RC _PATH_MASTER_RC
+# else
+# define PATH_MASTER_RC "/etc/mail.rc"
+# endif
+#endif
+#ifndef PATH_SENDMAIL
+# ifdef _PATH_SENDMAIL
+# define PATH_SENDMAIL _PATH_SENDMAIL
+# else
+# define PATH_SENDMAIL "/usr/sbin/sendmail"
+# endif
+#endif
+#ifndef PATH_TMP
+# ifdef _PATH_TMP
+# define PATH_TMP _PATH_TMP
+# else
+# define PATH_TMP "/tmp"
+# endif
+#endif
--- dotlock.c
+++ dotlock.c 2005-10-14 13:44:09.000000000 +0000
@@ -82,7 +82,7 @@ maildir_access(const char *fname)
static int
perhaps_setgid(const char *name, gid_t gid)
{
- char safepath[]= MAILSPOOL;
+ char safepath[]= PATH_MAILDIR;
if (strncmp(name, safepath, sizeof (safepath)-1) ||
strchr(name + sizeof (safepath), '/'))
--- edit.c
+++ edit.c 2005-10-14 13:47:03.000000000 +0000
@@ -153,7 +153,7 @@ edit1(int *msgvec, int type)
* Run an editor on the file at "fpp" of "size" bytes,
* and return a new file pointer.
* Signals must be handled by the caller.
- * "Type" is 'e' for ed, 'v' for vi.
+ * "Type" is 'e' for PATH_EX, 'v' for PATH_VI.
*/
FILE *
run_editor(FILE *fp, off_t size, int type, int readonly,
@@ -212,7 +212,7 @@ run_editor(FILE *fp, off_t size, int typ
}
nf = NULL;
if ((edit = value(type == 'e' ? "EDITOR" : "VISUAL")) == NULL)
- edit = type == 'e' ? "ed" : "vi";
+ edit = type == 'e' ? PATH_EX : PATH_VI;
sigemptyset(&set);
if (run_command(edit, oldint != SIG_IGN ? &set : NULL, -1, -1,
tempEdit, NULL, NULL) < 0) {
--- main.c
+++ main.c 2005-10-14 13:44:09.000000000 +0000
@@ -403,7 +403,7 @@ usage:
rcvmode = !to && !tflag;
spreserve();
if (!nosrc)
- load(MAILRC);
+ load(PATH_MASTER_RC);
/*
* Expand returns a savestr, but load only uses the file name
* for fopen, so it's safe to do this.
--- names.c
+++ names.c 2005-10-14 13:44:09.000000000 +0000
@@ -343,7 +343,7 @@ outof(struct name *names, FILE *fo, stru
* on one another.
*/
if ((shell = value("SHELL")) == NULL)
- shell = SHELL;
+ shell = PATH_CSHELL;
sigemptyset(&nset);
sigaddset(&nset, SIGHUP);
sigaddset(&nset, SIGINT);
--- send.c
+++ send.c 2005-10-14 13:44:09.000000000 +0000
@@ -1088,7 +1088,7 @@ getpipefile(char *pipecmd, FILE **qbuf,
Ftfree(&tempPipe);
}
if ((shell = value("SHELL")) == NULL)
- shell = SHELL;
+ shell = PATH_CSHELL;
if ((rbuf = Popen(pipecmd, "W", shell, fileno(*qbuf)))
== NULL) {
perror(pipecmd);
--- sendout.c
+++ sendout.c 2005-10-14 13:44:09.000000000 +0000
@@ -884,7 +884,7 @@ start_mta(struct name *to, struct name *
if ((cp = value("sendmail")) != NULL)
cp = expand(cp);
else
- cp = SENDMAIL;
+ cp = PATH_SENDMAIL;
execv(cp, args);
perror(cp);
}
--- temp.c
+++ temp.c 2005-10-14 13:44:09.000000000 +0000
@@ -121,7 +121,7 @@ tinit(void)
tmpdir = smalloc(strlen(cp) + 1);
strcpy(tmpdir, cp);
} else {
- tmpdir = "/tmp";
+ tmpdir = PATH_TMP;
}
if (myname != NULL) {
if (getuserid(myname) < 0) {
--- v7.local.c
+++ v7.local.c 2005-10-14 13:44:09.000000000 +0000
@@ -70,7 +70,7 @@ findmail(char *user, int force, char *bu
which_protocol(cp) == PROTO_IMAP) {
snprintf(buf, size, "%s/INBOX", protbase(cp));
} else if (force || (mbox = value("MAIL")) == NULL) {
- snprintf(buf, size, "%s/%s", MAILSPOOL, user);
+ snprintf(buf, size, "%s/%s", PATH_MAILDIR, user);
} else {
strncpy(buf, mbox, size);
buf[size-1]='\0';