summaryrefslogtreecommitdiffstats
path: root/source/n/biff+comsat/biff+comsat.offset.diff
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2009-08-26 10:00:38 -0500
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:41:17 +0200
commit5a12e7c134274dba706667107d10d231517d3e05 (patch)
tree55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/n/biff+comsat/biff+comsat.offset.diff
downloadcurrent-5a12e7c134274dba706667107d10d231517d3e05.tar.gz
current-5a12e7c134274dba706667107d10d231517d3e05.tar.xz
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009 Slackware 13.0 x86_64 is released as stable! Thanks to everyone who helped make this release possible -- see the RELEASE_NOTES for the credits. The ISOs are off to the replicator. This time it will be a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We're taking pre-orders now at store.slackware.com. Please consider picking up a copy to help support the project. Once again, thanks to the entire Slackware community for all the help testing and fixing things and offering suggestions during this development cycle. As always, have fun and enjoy! -P.
Diffstat (limited to 'source/n/biff+comsat/biff+comsat.offset.diff')
-rw-r--r--source/n/biff+comsat/biff+comsat.offset.diff93
1 files changed, 93 insertions, 0 deletions
diff --git a/source/n/biff+comsat/biff+comsat.offset.diff b/source/n/biff+comsat/biff+comsat.offset.diff
new file mode 100644
index 000000000..11cd1eb76
--- /dev/null
+++ b/source/n/biff+comsat/biff+comsat.offset.diff
@@ -0,0 +1,93 @@
+--- ./comsat/comsat.c.orig Sun Jun 3 01:31:30 2001
++++ ./comsat/comsat.c Sun Jun 3 01:31:34 2001
+@@ -77,8 +77,8 @@
+ static int nutmp;
+
+ static void mailfor(char *name);
+-static void notify(struct utmp *utp, off_t offset);
+-static void jkfprintf(FILE *, const char *name, off_t offset, const char *cr);
++static void notify(struct utmp *utp, off_t offset, const char *mailfile);
++static void jkfprintf(FILE *, const char *name, off_t offset, const char *cr, const char *mailfile);
+ static void onalrm(int);
+
+ int main(void) {
+@@ -273,20 +273,27 @@
+ static void mailfor(char *name)
+ {
+ struct utmp *utp;
+- char *cp;
++ char *cp, *cp2;
+ off_t offset;
+
++ dsyslog(LOG_DEBUG, "mailfor: name = %s\n", name); /* T.Crane 29/06/2001 */
++
++ /* Eg. name is "tom@5990326:/var/spool/mail/tom.wien" */
+ /* Break off the file offset part and convert it to an integer. */
+ cp = strchr(name, '@');
++ /* First, get the actual filename, ie. the part after the ':' */
++ cp2 = strchr(name, ':')+1; /* If it does not exist cp2==NULL */
+ if (!cp) return;
+ *cp = 0;
+ offset = atol(cp + 1);
++ dsyslog(LOG_DEBUG, "mailfor: offset = %d\n", offset); /* T.Crane 29/06/2001 */
++ dsyslog(LOG_DEBUG, "mailfor: mailfile = %s\n", cp2); /* T.Crane 29/06/2001 */
+
+ /* Look through the utmp and call notify() for each matching login. */
+ utp = &utmp[nutmp];
+ while (--utp >= utmp) {
+ if (!strncmp(utp->ut_name, name, sizeof(utmp[0].ut_name)))
+- notify(utp, offset);
++ notify(utp, offset, cp2);
+ }
+ }
+
+@@ -314,7 +321,7 @@
+ /*
+ * This actually writes to the user's terminal.
+ */
+-static void notify(struct utmp *utp, off_t offset)
++static void notify(struct utmp *utp, off_t offset, const char *mailfile)
+ {
+ FILE *tp; /* file open on tty */
+ struct stat stb;
+@@ -427,7 +434,7 @@
+ /*
+ * Print the first few lines of the message.
+ */
+- jkfprintf(tp, name, offset, cr);
++ jkfprintf(tp, name, offset, cr, mailfile);
+
+ /*
+ * Close up and quit the child process.
+@@ -439,8 +446,11 @@
+ /*
+ * This prints a few lines from the mailbox of the user "name" at offset
+ * "offset", using "cr" as the line break string, to the file "tp".
++ * Added mailfile variable to take the name of the actual mailfile
++ * passed to us rather than the defalt mailfile of the user "name",
++ * T.Crane (T.Crane@rhul.ac.uk), 29/05/2001.
+ */
+-static void jkfprintf(FILE *tp, const char *name, off_t offset, const char *cr)
++static void jkfprintf(FILE *tp, const char *name, off_t offset, const char *cr, const char *mailfile)
+ {
+ char *cp, ch;
+ FILE *fi;
+@@ -473,7 +483,17 @@
+ /*
+ * Open the user's mailbox (recall we're already in the mail spool dir)
+ */
+- fi = fopen(name, "r");
++
++ /* If mailfile == NULL, then use name (ie. users' username instead) */
++ if (mailfile != NULL) {
++ dsyslog(LOG_DEBUG, "jkfprint: actual mailbox = %s\n",mailfile);
++ fi = fopen(mailfile, "r");
++ }
++ else {
++ dsyslog(LOG_DEBUG, "jkfprint: actual mailbox==NULL, using name %s\n",name);
++ fi = fopen(name, "r");
++ }
++
+ if (fi == NULL) return;
+
+ /* Move to requested offset */