vbox enhancements

Use encrypted mailbox passwords.
Taken from Debian sidvbox-diffs.patch

Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
This commit is contained in:
Karsten Keil 2012-02-25 15:42:06 +01:00
parent f9c7fe0ed0
commit 0a8f69d1d9
9 changed files with 115 additions and 75 deletions

View File

@ -166,7 +166,7 @@ standard.tcl.
this configuration file.
.TP
/usr/doc/isdnutils/examples/vbox.conf
/usr/share/doc/isdnvboxserver/examples/vbox.conf
an example.
.SH SEE ALSO
@ -175,3 +175,4 @@ an example.
.SH AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>,
for Debian GNU/Linux and isdn4linux.
Now maintained by Paul Slootman <paul@debian.org>.

View File

@ -2,7 +2,7 @@
.\" CHECKIN $Date: 2001/03/01 14:45:07 $
.TH vbox 5 "@MANDATE@" "ISDN 4 Linux @I4LVERSION@" "Linux System Administration"
.SH NAME
vbox files \- file format
vbox \- file format
.SH FORMAT
With version 2.0.0 of vbox the recorded files have a new header, that
does not only include compression mode and connection information, but

View File

@ -67,9 +67,10 @@ path relative to SPOOLDIR.
this configuration file
.TP
.B /usr/doc/isdnutils/examples/vboxd.conf
.B /usr/share/doc/isdnvboxserver/examples/vboxd.conf
an example
.SH AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>,
for Debian GNU/Linux and isdn4linux.
Now maintained by Paul Slootman <paul@debian.org>.

View File

@ -16,6 +16,26 @@ is used by
to send notification of a new voice message via email. It is not meant
to be called directly by any user.
You can make local modifications to this script by copying it from
/usr/sbin/vboxmail to /etc/isdn/vboxmail, and editing the copy there.
Note that there is an enhanced version of this script available as
/usr/share/doc/isdnvboxserver/vboxmail.enhanced . To use it, copy it
to /etc/isdn/vboxmail . This enhanced version will send the recorded message
as a MIME attachment in the email notification.
If lame or xingmp3enc are installed in /usr/local/bin, then the message will
be converted to MP3 format; otherwise, it will be sent as a WAV file.
For this to work, you also need the following packages installed:
.br
.B mime-construct sox
.br
and of course an MP3 encoder if you want MP3 format. Note that the MP3 format
will only be 50% smaller (instead of the 90% you might otherwise expect),
because of the relatively bad sound quality to begin with (8kHz sampling, mono).
If you want to use another MP3 encoder than lame or xingmp3enc, you'll have to
make patches to the script. I'll be happy to implement your changes. Send them
as a wishlist bug report on isdnvboxserver.
.SH SEE ALSO
.B vboxgetty(8), vboxgetty.conf(5)

View File

@ -88,7 +88,7 @@ BLACK RED GREEN BROWN BLUE MAGENTA CYAN GREY
.B ~/.vboxrc
this configuration file
.TP
.B /usr/doc/isdnutils/examples/vboxrc
.B /usr/share/doc/isdnvboxclient/examples/vboxrc
an example
.SH SEE ALSO
@ -97,3 +97,4 @@ an example
.SH AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>,
for Debian GNU/Linux and isdn4linux.
Now maintained by Paul Slootman <paul@debian.org>.

View File

@ -13,7 +13,9 @@ L:*:N
# All hosts in the full access list (begins with 'A') are checked if the
# server gets the 'login' command.
A:localhost:RW:michael:xxx:/var/spool/vbox/michael:incoming
A:localhost:RW:nicole:xxx:/var/spool/vbox/nicole:incoming
# One user in this file can be configured by the `debconf' system, the next one.
# Remove this comment if you don't want any configuration to happen.
A:localhost:RW:username:*invalid*password*:/var/spool/vbox/ttyI6:incoming
# A:localhost:RW:nicole:xxx:/var/spool/vbox/nicole:incoming
A:*:!:!:!:!:!

View File

@ -21,17 +21,17 @@ debuglevel FEWIDJ
# Settings for port ttyI6
port /dev/ttyI6
modeminit ATZ&B512&E7830022
user nicole
modeminit ATZ&B512&E000000
user vboxdaemonuser
group users
spooldir /var/spool/vbox/nicole
spooldir /var/spool/vbox/ttyI6
vboxconfig /home/vboxdaemonuser/.vbox.conf
# Settings for port ttyI7
port /dev/ttyI7
modeminit ATZ&B512&E7850413
user michael
group users
spooldir /var/spool/vbox/michael
#port /dev/ttyI7
# modeminit ATZ&B512&E7850413
# user michael
# group users
# spooldir /var/spool/vbox/michael

View File

@ -40,7 +40,7 @@ lists.o: $(HEADERS) lists.c
$(CC) $(CFLAGS) -c lists.c
script.o: $(HEADERS) script.c
$(CC) $(CFLAGS) -DBINDIR='"$(VBOX_BINDIR)"' -c script.c
$(CC) $(CFLAGS) -DBINDIR='"$(VBOX_SBINDIR)"' -c script.c
voice.o: $(HEADERS) voice.c
$(CC) $(CFLAGS) $(VBOX_SUSPEND_DEF) -c voice.c
@ -149,7 +149,7 @@ vboxbeep: $(VBOXBEEPOBJS)
VBOXDOBJS = vboxd.o streamio.o
vboxd: $(VBOXDOBJS)
$(CC) $(CFLAGS) $(VBOXDOBJS) -o vboxd -L. -lvbox
$(CC) $(CFLAGS) $(VBOXDOBJS) -o vboxd -L. -lvbox -lcrypt
distclean: clean

View File

@ -6,6 +6,9 @@
#include "config.h"
#define _GNU_SOURCE /* for crypt() */
#include <unistd.h>
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
@ -21,7 +24,6 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <dirent.h>
#include <fnmatch.h>
@ -96,7 +98,7 @@ static struct servercmds commands[] =
{ "list" , srv_list },
{ "noop" , srv_noop },
{ "count" , srv_count },
{ "login" , srv_login },
{ "login" , srv_login },
{ "header" , srv_header },
{ "message" , srv_message },
{ "toggle" , srv_toggle },
@ -109,11 +111,11 @@ static struct servercmds commands[] =
static struct option arguments[] =
{
{ "version" , no_argument , NULL, 'v' },
{ "help" , no_argument , NULL, 'h' },
{ "timeout" , required_argument , NULL, 't' },
{ "file" , required_argument , NULL, 'f' },
{ NULL , 0 , NULL, 0 }
{ "version" , no_argument , NULL, 'v' },
{ "help" , no_argument , NULL, 'h' },
{ "timeout" , required_argument , NULL, 't' },
{ "file" , required_argument , NULL, 'f' },
{ NULL , 0 , NULL, 0 }
};
/**************************************************************************/
@ -251,7 +253,7 @@ static void usage(void)
fprintf(stderr, "Usage: %s [ OPTION ] [ ... ]\n", vbasename);
fprintf(stderr, "\n");
fprintf(stderr, "-f, --file FILE Overwrites \"%s\".\n", VBOXDRC);
fprintf(stderr, "-t, --timeout SECS Close connection after SECS idle time (default 600).\n");
fprintf(stderr, "-t, --timeout SECS Close connection after SECS idle time (default 600).\n");
fprintf(stderr, "-v, --version Displays program version.\n");
fprintf(stderr, "-h, --help Displays this message.\n");
fprintf(stderr, "\n");
@ -425,7 +427,7 @@ static int get_next_command(char *line, int linelen, int timeout)
{
syslog(LOG_ERR, "can't read (%s).", strerror(errno));
message("%s can't read (%s).\r\n", VBOXD_VAL_TEMPERROR, strerror(errno));
message("%s can't read (%s).\r\n", VBOXD_VAL_TEMPERROR, strerror(errno));
return(VBOXD_ERR_TIMEOUT);
}
@ -522,51 +524,51 @@ static int check_client_access_start(char *name, char *addr)
while (streamio_gets(line, VBOXD_LEN_ACCESSLINE, accesslist))
{
if ((line[0] != 'L') || (line[1] != ':')) continue;
if ((line[0] != 'L') || (line[1] != ':')) continue;
/*
* Split the current line into seperate fields.
*/
/*
* Split the current line into seperate fields.
*/
for (list[0] = line, i = 0, p = line; ((*p) && (i < 3)); p++)
{
if (*p == ':')
{
*p = '\0';
for (list[0] = line, i = 0, p = line; ((*p) && (i < 3)); p++)
{
if (*p == ':')
{
*p = '\0';
list[++i] = (p + 1);
}
}
list[++i] = (p + 1);
}
}
if (i != 2) continue;
if (i != 2) continue;
/*
* Check if the hostname or the hosts ip address matchs the current
* pattern.
*/
/*
* Check if the hostname or the hosts ip address matchs the current
* pattern.
*/
if ((name) || (addr))
{
if (!wildmat(name, list[1]))
{
if (!wildmat(addr, list[1])) continue;
}
}
if ((name) || (addr))
{
if (!wildmat(name, list[1]))
{
if (!wildmat(addr, list[1])) continue;
}
}
/*
* Check if the client has access to count new messages. If true,
* the "login" is correct.
*/
/*
* Check if the client has access to count new messages. If true,
* the "login" is correct.
*/
if ((strcasecmp(list[2], "yes")) == 0 || (strcasecmp(list[2], "y") == 0))
{
client_access |= VBOXD_ACC_COUNT;
if ((strcasecmp(list[2], "yes")) == 0 || (strcasecmp(list[2], "y") == 0))
{
client_access |= VBOXD_ACC_COUNT;
returnok();
}
}
returnok();
}
}
returnerror();
returnerror();
}
/**************************************************************************/
@ -634,7 +636,20 @@ static int check_client_access_login(char *name, char *addr, char *user, char *p
if (strcmp(list[4], "-" ) == 0) continue;
if (strcmp(list[4], "!" ) == 0) continue;
if (strcmp(list[4], pass) != 0) continue;
if (strncmp(list[4], "DES ", 4) == 0 && strlen(list[4]) == 17) {
/* This is a DES-encrypted password */
char salt[3];
salt[0] = list[4][4];
salt[1] = list[4][5];
salt[2] = 0;
if (strcmp(&(list[4][4]), crypt(pass, salt)) != 0)
continue; /* no match, next line */
}
else {
if (strcmp(list[4], pass) != 0)
continue;
}
/* fallthrough case: password accepted */
}
/*
@ -712,7 +727,7 @@ static void message(char *fmt, ...)
va_start(arg, fmt);
vfprintf(stdout, fmt, arg);
va_end(arg);
va_end(arg);
}
/**************************************************************************/
@ -849,7 +864,7 @@ static void srv_message(int argc, char **argv)
if (read(fd, block, status.st_size) == status.st_size)
{
message("%s %d\r\n", VBOXD_VAL_MESSAGE, status.st_size);
pullmsg(stdout);
pullmsg(stdout);
write(STDOUT_FILENO, block, status.st_size);
@ -972,20 +987,20 @@ static void srv_login(int argc, char **argv)
static void srv_help(int argc, char **argv)
{
message("%s Commands require special access:\r\n" , VBOXD_VAL_HELP);
message("%s \r\n" , VBOXD_VAL_HELP);
message("%s Commands require special access:\r\n" , VBOXD_VAL_HELP);
message("%s \r\n" , VBOXD_VAL_HELP);
message("%s LIST List all messages.\r\n" , VBOXD_VAL_HELP);
message("%s COUNT Count new messages.\r\n" , VBOXD_VAL_HELP);
message("%s DELETE <message> Delete a message.\r\n" , VBOXD_VAL_HELP);
message("%s DELETE <message> Delete a message.\r\n" , VBOXD_VAL_HELP);
message("%s MESSAGE <message> Get a message.\r\n" , VBOXD_VAL_HELP);
message("%s HEADER <message> Get a message header.\r\n" , VBOXD_VAL_HELP);
message("%s TOGGLE <message> Toggle message new flag.\r\n" , VBOXD_VAL_HELP);
message("%s STATUSCTRL <control> Check if control exists.\r\n" , VBOXD_VAL_HELP);
message("%s CREATECTRL <control> Create a control file.\r\n" , VBOXD_VAL_HELP);
message("%s REMOVECTRL <control> Remove a control file.\r\n" , VBOXD_VAL_HELP);
message("%s \r\n" , VBOXD_VAL_HELP);
message("%s Commands available for all clients:\r\n" , VBOXD_VAL_HELP);
message("%s \r\n" , VBOXD_VAL_HELP);
message("%s HEADER <message> Get a message header.\r\n" , VBOXD_VAL_HELP);
message("%s TOGGLE <message> Toggle message new flag.\r\n" , VBOXD_VAL_HELP);
message("%s STATUSCTRL <control> Check if control exists.\r\n" , VBOXD_VAL_HELP);
message("%s CREATECTRL <control> Create a control file.\r\n" , VBOXD_VAL_HELP);
message("%s REMOVECTRL <control> Remove a control file.\r\n" , VBOXD_VAL_HELP);
message("%s \r\n" , VBOXD_VAL_HELP);
message("%s Commands available for all clients:\r\n" , VBOXD_VAL_HELP);
message("%s \r\n" , VBOXD_VAL_HELP);
message("%s LOGIN <username> [password] Login as user (gives access).\r\n", VBOXD_VAL_HELP);
message("%s NOOP Does nothing.\r\n" , VBOXD_VAL_HELP);
message("%s HELP Display command list.\r\n" , VBOXD_VAL_HELP);