aboutsummaryrefslogtreecommitdiff
path: root/mail/qmail-contrib/files
diff options
context:
space:
mode:
authorSteve Price <steve@FreeBSD.org>1999-05-03 02:44:24 +0000
committerSteve Price <steve@FreeBSD.org>1999-05-03 02:44:24 +0000
commita63d37261eb47e46f4e0dce1a775d33f92d16a51 (patch)
tree532264764bc8cdd9ac884b0f9fdb5470665f029e /mail/qmail-contrib/files
parentc4ccdffc92875cf583b8c1a54609c64c59ddaa58 (diff)
downloadports-a63d37261eb47e46f4e0dce1a775d33f92d16a51.tar.gz
ports-a63d37261eb47e46f4e0dce1a775d33f92d16a51.zip
Notes
Diffstat (limited to 'mail/qmail-contrib/files')
-rw-r--r--mail/qmail-contrib/files/extra-patch-newaliases113
-rw-r--r--mail/qmail-contrib/files/extra-patch-striplocal28
2 files changed, 141 insertions, 0 deletions
diff --git a/mail/qmail-contrib/files/extra-patch-newaliases b/mail/qmail-contrib/files/extra-patch-newaliases
new file mode 100644
index 000000000000..58a5341f7077
--- /dev/null
+++ b/mail/qmail-contrib/files/extra-patch-newaliases
@@ -0,0 +1,113 @@
+*** newaliases.c.orig Fri Apr 24 17:34:58 1998
+--- newaliases.c Fri Apr 24 17:38:32 1998
+***************
+*** 12,17 ****
+--- 12,21 ----
+
+ #define FATAL "newaliases: fatal: "
+
++ stralloc fnsrc = {0};
++ stralloc fncdb = {0};
++ stralloc fntmp = {0};
++
+ void nomem()
+ {
+ strerr_die2x(111,FATAL,"out of memory");
+***************
+*** 26,36 ****
+ }
+ void writeerr()
+ {
+! strerr_die2sys(111,FATAL,"unable to write to /etc/aliases.tmp: ");
+ }
+ void readerr()
+ {
+! strerr_die2sys(111,FATAL,"unable to read /etc/aliases: ");
+ }
+ void die_control()
+ {
+--- 30,40 ----
+ }
+ void writeerr()
+ {
+! strerr_die4sys(111,FATAL,"unable to write to ",fntmp.s,": ");
+ }
+ void readerr()
+ {
+! strerr_die4sys(111,FATAL,"unable to read ",fnsrc.s,": ");
+ }
+ void die_control()
+ {
+***************
+*** 270,288 ****
+ if (cdbmss_add(&cdbmss,key.s,key.len,instr.s,instr.len) == -1) writeerr();
+ }
+
+! void main()
+ {
+ int fd;
+
+ umask(033);
+ readcontrols();
+
+! fd = open_read("/etc/aliases");
+ if (fd == -1) readerr();
+ substdio_fdbuf(&ssin,read,fd,inbuf,sizeof inbuf);
+
+! fd = open_trunc("/etc/aliases.tmp");
+! if (fd == -1) strerr_die2sys(111,FATAL,"unable to create /etc/aliases.tmp: ");
+ if (cdbmss_start(&cdbmss,fd) == -1) writeerr();
+
+ if (!stralloc_copys(&line,"")) nomem();
+--- 274,305 ----
+ if (cdbmss_add(&cdbmss,key.s,key.len,instr.s,instr.len) == -1) writeerr();
+ }
+
+! void main(argc,argv)
+! int argc;
+! char **argv;
+ {
+ int fd;
+
+ umask(033);
+ readcontrols();
+
+! if (!stralloc_copys(&fnsrc,argv[1] ? argv[1] : "/etc/aliases")) nomem();
+! if (!stralloc_0(&fnsrc)) nomem();
+!
+! if (!stralloc_copys(&fncdb,fnsrc.s)) nomem();
+! if (!stralloc_cats(&fncdb,".cdb")) nomem();
+! if (!stralloc_0(&fncdb)) nomem();
+!
+! if (!stralloc_copys(&fntmp,fnsrc.s)) nomem();
+! if (!stralloc_cats(&fntmp,".tmp")) nomem();
+! if (!stralloc_0(&fntmp)) nomem();
+!
+! fd = open_read(fnsrc.s);
+ if (fd == -1) readerr();
+ substdio_fdbuf(&ssin,read,fd,inbuf,sizeof inbuf);
+
+! fd = open_trunc(fntmp.s);
+! if (fd == -1) strerr_die4sys(111,FATAL,"unable to create ",fntmp.s,": ");
+ if (cdbmss_start(&cdbmss,fd) == -1) writeerr();
+
+ if (!stralloc_copys(&line,"")) nomem();
+***************
+*** 314,321 ****
+ if (fsync(fd) == -1) writeerr();
+ if (close(fd) == -1) writeerr(); /* NFS stupidity */
+
+! if (rename("/etc/aliases.tmp","/etc/aliases.cdb") == -1)
+! strerr_die2sys(111,FATAL,"unable to move /etc/aliases.tmp to /etc/aliases.cdb: ");
+
+ _exit(0);
+ }
+--- 331,338 ----
+ if (fsync(fd) == -1) writeerr();
+ if (close(fd) == -1) writeerr(); /* NFS stupidity */
+
+! if (rename(fntmp.s,fncdb.s) == -1)
+! strerr_die6sys(111,FATAL,"unable to move ",fntmp.s," to ",fncdb.s,": ");
+
+ _exit(0);
+ }
diff --git a/mail/qmail-contrib/files/extra-patch-striplocal b/mail/qmail-contrib/files/extra-patch-striplocal
new file mode 100644
index 000000000000..8017b679fa71
--- /dev/null
+++ b/mail/qmail-contrib/files/extra-patch-striplocal
@@ -0,0 +1,28 @@
+*** fastforward.c.orig Thu Apr 23 20:35:48 1998
+--- fastforward.c Thu Apr 23 20:37:05 1998
+***************
+*** 261,270 ****
+ if (gettarget(1,"?",addr))
+ if (!stralloc_copy(&sender,&data)) nomem();
+ if (!gettarget(1,":",addr))
+! if (flagpassthrough)
+! _exit(0);
+! else
+! strerr_die1x(100,"Sorry, no mailbox here by that name. (#5.1.1)");
+ dodata();
+ }
+
+--- 261,273 ----
+ if (gettarget(1,"?",addr))
+ if (!stralloc_copy(&sender,&data)) nomem();
+ if (!gettarget(1,":",addr))
+! if (strpbrk(addr,"-"))
+! if (!str_copy(addr,strpbrk(addr,"-")+1)) nomem();
+! if (!gettarget(1,":",addr))
+! if (flagpassthrough)
+! _exit(0);
+! else
+! strerr_die1x(100,"Sorry, no mailbox here by that name. (#5.1.1)");
+ dodata();
+ }
+