cvm-0.97/ 0000755 0000764 0000764 00000000000 12463157763 011617 5 ustar bruce guenter cvm-0.97/v2client.h 0000644 0000764 0000764 00000004772 12463157763 013530 0 ustar bruce guenter #ifndef CVM__V2CLIENT__H__
#define CVM__V2CLIENT__H__
#include
#include "facts.h"
#include "errors.h"
#define CVM_BUFSIZE 512
struct cvm_credential
{
unsigned type;
str value;
};
struct cvm_packet
{
unsigned length;
unsigned char data[CVM_BUFSIZE];
};
extern const char* cvm_client_account_split_chars;
extern const char* cvm_client_ucspi_domain(void);
extern int cvm_client_split_account(str* account, str* domain);
extern int cvm_client_authenticate(const char* module, unsigned count,
const struct cvm_credential* credentials);
extern int cvm_client_fact_str(unsigned number,
const char** data, unsigned* length);
extern int cvm_client_fact_uint(unsigned number, unsigned long* data);
extern int cvm_client_setugid(void);
extern int cvm_client_setenv(void);
extern unsigned cvm_xfer_command_packets(const char* module,
const struct cvm_packet* request,
struct cvm_packet* response);
extern unsigned cvm_xfer_local_packets(const char* path,
const struct cvm_packet* request,
struct cvm_packet* response);
extern unsigned cvm_xfer_udp_packets(const char* hostport,
const struct cvm_packet* request,
struct cvm_packet* response);
/* Wrapper functions for library compatibility. */
extern unsigned cvm_xfer_command(const char* module,
unsigned char buffer[CVM_BUFSIZE],
unsigned* buflen);
extern unsigned cvm_xfer_local(const char* path,
unsigned char buffer[CVM_BUFSIZE],
unsigned* buflen);
extern unsigned cvm_xfer_udp(const char* hostport,
unsigned char buffer[CVM_BUFSIZE],
unsigned* buflen);
/* Wrapper functions. */
extern int cvm_client_authenticate_password(const char* module,
const char* account,
const char* domain,
const char* password,
int split_account);
#ifndef CVM_NOCOMPAT
/* Legacy definitions. */
#define cvm_account_split_chars cvm_client_account_split_chars
#define cvm_ucspi_domain cvm_client_ucspi_domain
#define cvm_setugid cvm_client_setugid
#define cvm_setenv cvm_client_setenv
#define cvm_authenticate_password cvm_client_authenticate_password
#define cvm_split_account cvm_client_split_account
#ifndef CVM__MODULE__H__
# define cvm_authenticate cvm_client_authenticate
# define cvm_fact_str cvm_client_fact_str
# define cvm_fact_uint cvm_client_fact_uint
#else
# undef cvm_authenticate
# undef cvm_fact_str
# undef cvm_fact_uint
#endif
#endif
#endif
cvm-0.97/module_request.c 0000644 0000764 0000764 00000011715 12463157763 015025 0 ustar bruce guenter /* cvm/module_request.c - Request parsing code
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include "module.h"
#include "protocol.h"
const char* cvm_account_name;
const char* cvm_account_domain;
unsigned char cvm_module_inbuffer[BUFSIZE+1];
unsigned cvm_module_inbuflen;
const char* cvm_module_lookup_secret = 0;
str cvm_module_credentials[CVM_CRED_MAX+1];
void cvm_module_init_request(void)
{
/* Determine if the module is to operate in lookup mode, and if not
set the local credential values appropriately. */
cvm_module_lookup_secret = getenv("CVM_LOOKUP_SECRET");
memset(cvm_module_credentials, 0, sizeof cvm_module_credentials);
}
static int v1copy_advance(const char** ptr, char** buf, unsigned* len)
{
char* tmp;
if ((tmp = memchr(*buf, 0, *len)) == 0) return 0;
++tmp;
if (*len < (unsigned)(tmp - *buf)) return 0;
*ptr = *buf;
*len -= tmp - *buf;
*buf = tmp;
return 1;
}
static int parse_v1_input(void)
{
char* buf;
unsigned len;
const char* cred;
/* Prevent buffer run-off by ensuring there is at least one NUL byte */
cvm_module_inbuffer[BUFSIZE] = 0;
buf = (char*)cvm_module_inbuffer + 1;
len = cvm_module_inbuflen - 1;
/* Account name */
if (!v1copy_advance(&cred, &buf, &len)) return CVME_BAD_CLIDATA;
if (!str_copys(&cvm_module_credentials[CVM_CRED_ACCOUNT], cred))
return CVME_IO;
/* Domain name */
if (!v1copy_advance(&cred, &buf, &len)) return CVME_BAD_CLIDATA;
if (*cred != 0
&& !str_copys(&cvm_module_credentials[CVM_CRED_DOMAIN], cred))
return CVME_IO;
if (len > 1) {
/* Allow for only a single credential if one is present.
No existing CVM1 module could handle more than one. */
if (!v1copy_advance(&cred, &buf, &len))
return CVME_BAD_CLIDATA;
if (!str_copys((cvm_module_lookup_secret != 0)
? &cvm_module_credentials[CVM_CRED_SECRET]
: &cvm_module_credentials[CVM_CRED_PASSWORD], cred))
return CVME_IO;
}
if (len != 1) return CVME_BAD_CLIDATA;
return 0;
}
static int parse_v2_input(void)
{
unsigned i;
unsigned len;
unsigned type;
for (i = cvm_module_inbuffer[1] + 2;
i < cvm_module_inbuflen - 2;
i += len + 2) {
type = cvm_module_inbuffer[i];
len = cvm_module_inbuffer[i+1];
if (type <= CVM_CRED_MAX)
if (!str_copyb(&cvm_module_credentials[type],
(char*)cvm_module_inbuffer+i+2, len))
return CVME_IO;
}
if (i >= cvm_module_inbuflen
|| cvm_module_inbuffer[i] != 0)
return CVME_BAD_CLIDATA;
return 0;
}
static int parse_input(void)
{
if (cvm_module_inbuffer[0] == CVM2_PROTOCOL)
return parse_v2_input();
if (cvm_module_inbuffer[0] == CVM1_PROTOCOL)
return parse_v1_input();
return CVME_BAD_CLIDATA;
}
int cvm_module_handle_request(void)
{
int code;
unsigned i;
for (i = 0; i <= CVM_CRED_MAX; ++i)
cvm_module_credentials[i].len = 0;
cvm_module_fact_start();
if ((code = parse_input()) != 0) return code;
if (cvm_module_lookup_secret != 0 && *cvm_module_lookup_secret != 0) {
if (cvm_module_credentials[CVM_CRED_SECRET].len == 0
|| str_diffs(&cvm_module_credentials[CVM_CRED_SECRET],
cvm_module_lookup_secret) != 0)
return CVME_NOCRED;
}
if ((code = cvm_module_lookup()) != 0) return code;
if (cvm_module_lookup_secret == 0)
if ((code = cvm_module_authenticate()) != 0) return code;
if ((code = cvm_module_results()) != 0) return code;
cvm_module_fact_str(CVM_FACT_USERNAME, cvm_fact_username);
cvm_module_fact_uint(CVM_FACT_USERID, cvm_fact_userid);
cvm_module_fact_uint(CVM_FACT_GROUPID, cvm_fact_groupid);
if (cvm_fact_realname)
cvm_module_fact_str(CVM_FACT_REALNAME, cvm_fact_realname);
cvm_module_fact_str(CVM_FACT_DIRECTORY, cvm_fact_directory);
if (cvm_fact_shell)
cvm_module_fact_str(CVM_FACT_SHELL, cvm_fact_shell);
if (cvm_fact_groupname)
cvm_module_fact_str(CVM_FACT_GROUPNAME, cvm_fact_groupname);
if (cvm_fact_sys_username)
cvm_module_fact_str(CVM_FACT_SYS_USERNAME, cvm_fact_sys_username);
if (cvm_fact_sys_directory)
cvm_module_fact_str(CVM_FACT_SYS_DIRECTORY, cvm_fact_sys_directory);
if (cvm_fact_domain)
cvm_module_fact_str(CVM_FACT_DOMAIN, cvm_fact_domain);
if (cvm_fact_mailbox)
cvm_module_fact_str(CVM_FACT_MAILBOX, cvm_fact_mailbox);
return 0;
}
cvm-0.97/TARGETS 0000644 0000764 0000764 00000004213 12463157763 012653 0 ustar bruce guenter all
clean
clean-spac
client_domain.lo
client_domain.o
client_setenv.lo
client_setenv.o
client_setugid.lo
client_setugid.o
client_xfer_command.lo
client_xfer_command.o
client_xfer_compat.lo
client_xfer_compat.o
client_xfer_local.lo
client_xfer_local.o
client_xfer_udp.lo
client_xfer_udp.o
compile
crypt.lib
cvm-benchclient
cvm-benchclient.o
cvm-chain
cvm-chain.o
cvm-checkpassword
cvm-checkpassword.o
cvm-mysql
cvm-mysql-local
cvm-mysql-local.o
cvm-mysql-udp
cvm-mysql-udp.o
cvm-mysql.o
cvm-pgsql
cvm-pgsql-local
cvm-pgsql-local.o
cvm-pgsql-udp
cvm-pgsql-udp.o
cvm-pgsql.o
cvm-pwfile
cvm-pwfile.o
cvm-qmail
cvm-qmail.o
cvm-sqlite
cvm-sqlite.o
cvm-testclient
cvm-testclient.o
cvm-unix
cvm-unix.o
cvm-v1benchclient
cvm-v1benchclient.o
cvm-v1checkpassword
cvm-v1checkpassword.o
cvm-v1testclient
cvm-v1testclient.o
cvm-vchkpw
cvm-vchkpw.o
cvm-vmailmgr
cvm-vmailmgr-local
cvm-vmailmgr-local.o
cvm-vmailmgr-udp
cvm-vmailmgr-udp.o
cvm-vmailmgr.o
docs
errors.lo
errors.o
facts.lo
facts.o
getpwnam.o
install
libcvm-command.la
libcvm-local.la
libcvm-module.la
libcvm-qmail.la
libcvm-sasl.la
libcvm-sql.la
libcvm-udp.la
libcvm-v1client.la
libcvm-v2client.la
libraries
load
ltcompile
ltload
makeshlib
module_command.lo
module_command.o
module_command_main.lo
module_command_main.o
module_local.lo
module_local.o
module_local_main.lo
module_local_main.o
module_log.lo
module_log.o
module_main.lo
module_main.o
module_output.lo
module_output.o
module_request.lo
module_request.o
module_udp.lo
module_udp.o
module_udp_main.lo
module_udp_main.o
mysql
pgsql
programs
qmail-domains.lo
qmail-domains.o
qmail-dotfile.lo
qmail-dotfile.o
qmail-init.lo
qmail-init.o
qmail-lookup.lo
qmail-lookup.o
qmail-users.lo
qmail-users.o
random.lo
random.o
s.lib
sasl-auth-test
sasl-auth-test.o
sasl_auth.lo
sasl_auth.o
sasl_authenticate.lo
sasl_authenticate.o
sasl_cram_md5.lo
sasl_cram_md5.o
sasl_init.lo
sasl_init.o
sasl_login.lo
sasl_login.o
sasl_plain.lo
sasl_plain.o
sasl_start.lo
sasl_start.o
shadow.lib
socket.lib
sql-auth.lo
sql-auth.o
sql-query-test
sql-query-test.o
sql-query.lo
sql-query.o
sqlite
v1client.lo
v1client.o
v2client.lo
v2client.o
v2client_wrappers.lo
v2client_wrappers.o
vmautoconvert.o
vmlookup.o
cvm-0.97/cvm-pgsql-udp.c 0000644 0000764 0000764 00000000000 12463157763 014450 0 ustar bruce guenter cvm-0.97/sasl_plain.c 0000644 0000764 0000764 00000001410 12463157763 014104 0 ustar bruce guenter #include
#include "sasl.h"
#include "sasl_internal.h"
static int response1(struct sasl_state* ss,
const str* response, str* challenge)
{
unsigned i;
unsigned j;
if (response->len == 0)
return SASL_RESP_BAD;
if ((i = str_findfirst(response, 0)) == (unsigned)-1)
return SASL_RESP_BAD;
++i;
if ((j = str_findnext(response, 0, i)) == (unsigned)-1)
return SASL_RESP_BAD;
++j;
return sasl_authenticate_plain(ss, response->s+i, response->s+j);
(void)challenge;
}
int sasl_plain_start(struct sasl_state* ss,
const str* response, str* challenge)
{
if (response)
return response1(ss, response, challenge);
if (!str_truncate(challenge, 0))
return SASL_TEMP_FAIL;
ss->response = response1;
return SASL_CHALLENGE;
}
cvm-0.97/cvm-unix.html 0000644 0000764 0000764 00000001012 12463157763 014245 0 ustar bruce guenter
The cvm-unix Module
Synopsis:
UNIX/POSIX-standard module
Credentials:
- Pass phrase
Description:
This module uses the POSIX standard getpwnam and
crypt APIs to validate credentials. If the system has either
the getuserpw or the getspnam APIs, they will also
be used to locate the encrypted password.
Configuration Variables:
None
cvm-0.97/conf-ld 0000644 0000764 0000764 00000000127 12463157763 013064 0 ustar bruce guenter gcc -g -L/usr/local/lib
This will be used to link .o and .a files into an executable.
cvm-0.97/module.html 0000644 0000764 0000764 00000005657 12463157763 014007 0 ustar bruce guenter
CVM Module Library
To write a module using the CVM module library, you must provide
the following items:
- int cvm_module_init(void)
- This function is called once
when the CVM starts up.
- int cvm_module_lookup(void)
- This function is used to
retrieve the stored credentials for the named user. If the named user
does not exist, this function must return CVME_PERMFAIL (value
100). Before this function is called, the input request is read and the
account name is parsed into cvm_account_name, the domain name
into cvm_account_domain, and the credentials are parsed into
cvm_credentials.
- int cvm_module_authenticate(void)
- The main
authentication verification function. This function is not called when
the module is operating in lookup mode. If authentication fails, this
function must return CVME_PERMFAIL (value 100).
- int cvm_module_results(void)
- This function is used to
provide the lookup results to the client. All required facts must be
set by this function: cvm_fact_username,
cvm_fact_userid, cvm_fact_groupid,
cvm_fact_directory, and cvm_fact_shell. The following
facts may optional be set as well: cvm_fact_realname,
cvm_fact_groupname, cvm_fact_sys_username,
cvm_fact_sys_directory, and cvm_fact_domain. All of
these will be sent to the client automatically by the invoking module
framework, with the optional facts being sent only if they have been
set. If any other facts are to be returned to the client, send them in
this function with cvm_module_fact_str(unsigned number, const char*
data) or cvm_module_fact_uint(unsigned number, unsigned
data).
- void cvm_module_stop(void)
- This routine is called once
when the CVM is shut down.
If any function fails due to a temporary error (read error, out of
memory, connection failed, etc), it must return a non-zero error code (other than CVME_PERMFAIL).
Otherwise, return zero.
The credentials sent from the client are accessable through the
global cvm_credentials array (type str), which is
indexed by the credential type number.
NOTE: The functions supplied by the module must never exit
except on fatal errors. If any memory is allocated in the course of
processing a request, it must either be freed or reallocated on the next
invocation.
Each module will implement at least one type of credential validation
(ie plain text, CRAM, etc). Modules are not obligated to implement
multiple types of validation, but may do so by examinimg which types of
credentials are present in the input. The invoker will choose which
modules to invoke depending on what type of credentials it needs
validated.
cvm-0.97/module_output.c 0000644 0000764 0000764 00000005554 12463157763 014701 0 ustar bruce guenter /* cvm/module_output.c - Response formatting
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include "module.h"
#include "protocol.h"
unsigned char cvm_module_outbuffer[BUFSIZE];
unsigned cvm_module_outbuflen;
static unsigned char* outbufptr;
static int v1fact(unsigned number, const char* data, unsigned len)
{
/* Always leave room for a trailing NUL. */
if (cvm_module_outbuflen + len + 3 > BUFSIZE) {
cvm_module_outbuflen = BUFSIZE;
return 0;
}
cvm_module_outbuflen += len + 2;
*outbufptr++ = number;
memcpy(outbufptr, data, len);
outbufptr += len;
*outbufptr++ = 0;
return 1;
}
static int v2fact(unsigned number, const char* data, unsigned len)
{
/* Always leave room for a trailing zero type byte. */
if (cvm_module_outbuflen + len + 3 > BUFSIZE) {
cvm_module_outbuflen = BUFSIZE;
return 0;
}
cvm_module_outbuflen += len + 2;
*outbufptr++ = number;
*outbufptr++ = len;
memcpy(outbufptr, data, len);
outbufptr += len;
return 1;
}
static int (*fact)(unsigned,const char*,unsigned);
static void cvm1_fact_start(void)
{
fact = v1fact;
cvm_module_outbuflen = 1;
outbufptr = cvm_module_outbuffer + 1;
}
static void cvm2_fact_start(void)
{
fact = v2fact;
cvm_module_outbuflen = 0;
outbufptr = cvm_module_outbuffer;
v2fact(0, (char*)cvm_module_inbuffer+2, cvm_module_inbuffer[1]);
}
void cvm_module_fact_start(void)
{
if (cvm_module_inbuffer[0] == CVM2_PROTOCOL)
cvm2_fact_start();
else
cvm1_fact_start();
}
int cvm_module_fact_str(unsigned number, const char* data)
{
if (!data) return 0;
return fact(number, data, strlen(data));
}
void cvm_module_fact_end(unsigned code)
{
if (cvm_module_outbuflen >= BUFSIZE)
code = CVME_BAD_MODDATA;
cvm_module_outbuffer[0] = code;
*outbufptr++ = 0;
++cvm_module_outbuflen;
}
int cvm_module_fact_uint(unsigned number, unsigned long data)
{
char buf[64];
char* ptr;
if (!data)
return fact(number, "0", 1);
ptr = buf + 63;
*ptr-- = 0;
while (data) {
*ptr-- = (data % 10) + '0';
data /= 10;
}
++ptr;
return fact(number, ptr, buf+63-ptr);
}
cvm-0.97/FILES 0000644 0000764 0000764 00000003251 12463157763 012405 0 ustar bruce guenter ANNOUNCEMENT
AUTOFILES
COPYING
ChangeLog
ChangeLog.vmailmgr
FILES
INSTHIER
LIBVERSION
Makefile
NEWS
NEWS.sql
NEWS.vmailmgr
README
README.vchkpw
README.vmailmgr
SRCFILES
TARGETS
TODO
VERSION
client_domain.c
client_setenv.c
client_setugid.c
client_xfer_command.c
client_xfer_compat.c
client_xfer_local.c
client_xfer_udp.c
conf-bin
conf-cc
conf-include
conf-ld
conf-lib
credentials.h
credentials.html
cvm-0.97.spec
cvm-benchclient.c
cvm-benchclient.html
cvm-chain.c
cvm-chain.html
cvm-checkpassword.c
cvm-checkpassword.html
cvm-mysql-local.c
cvm-mysql-udp.c
cvm-mysql.c
cvm-mysql.html
cvm-pgsql-local.c
cvm-pgsql-udp.c
cvm-pgsql.c
cvm-pgsql.html
cvm-pwfile.c
cvm-pwfile.html
cvm-qmail.c
cvm-qmail.html
cvm-sqlite.c
cvm-sqlite.html
cvm-testclient.c
cvm-testclient.html
cvm-unix.c
cvm-unix.html
cvm-v1benchclient.c
cvm-v1checkpassword.c
cvm-v1testclient.c
cvm-vchkpw.c
cvm-vmailmgr-local.c
cvm-vmailmgr-udp.c
cvm-vmailmgr.c
cvm-vmailmgr.h
cvm-vmailmgr.html
cvm.html
errors.c
errors.h
errors.html
facts.c
facts.h
facts.html
getpwnam.c
module.h
module.html
module_command.c
module_command_main.c
module_local.c
module_local_main.c
module_log.c
module_main.c
module_output.c
module_request.c
module_udp.c
module_udp_main.c
protocol-1.html
protocol-2.html
protocol.h
qmail-domains.c
qmail-dotfile.c
qmail-init.c
qmail-lookup.c
qmail-users.c
qmail.h
random.c
random.h
rationale.html
sasl-auth-test.c
sasl.h
sasl.html
sasl_auth.c
sasl_authenticate.c
sasl_cram_md5.c
sasl_init.c
sasl_internal.h
sasl_login.c
sasl_plain.c
sasl_start.c
sql-auth.c
sql-query-test.c
sql-query.c
sql.h
sql.html
tests.sh
v1client.c
v1client.h
v1client.html
v2client.c
v2client.h
v2client.html
v2client_wrappers.c
vmautoconvert.c
vmlookup.c
cvm-0.97/client_xfer_command.c 0000644 0000764 0000764 00000006063 12463157763 015770 0 ustar bruce guenter /* cvm/client_xfer_command.c - CVM client command transmission library
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include "v1client.h"
static pid_t pid;
/* Command module execution **************************************************/
static int pipefork(const char* cmd, int pipes[2])
{
int pipe1[2];
int pipe2[2];
if (pipe(pipe1) == -1 || pipe(pipe2) == -2) return 0;
pid = fork();
switch (pid) {
case -1:
return 0;
case 0:
close(0);
close(pipe1[1]);
dup2(pipe1[0], 0);
close(pipe1[0]);
close(1);
close(pipe2[0]);
dup2(pipe2[1], 1);
close(pipe2[1]);
execlp(cmd, cmd, NULL);
exit(1);
default:
close(pipe1[0]);
pipes[0] = pipe1[1];
close(pipe2[1]);
pipes[1] = pipe2[0];
return 1;
}
}
static void killit(void)
{
if (pid != -1)
kill(pid, SIGTERM);
}
static int waitforit(void)
{
int status;
pid_t tmp;
while ((tmp = wait(&status)) != -1) {
if (tmp == pid)
return WIFEXITED(status) ? WEXITSTATUS(status) : -CVME_IO;
}
return -CVME_IO;
}
static int write_buffer(int fd, const unsigned char* buffer, unsigned buflen)
{
size_t wr;
while (buflen > 0) {
wr = write(fd, buffer, buflen);
if (wr == 0 || wr == (unsigned)-1) return 0;
buflen -= wr;
buffer += wr;
}
return 1;
}
static unsigned read_buffer(int fd, unsigned char* buffer)
{
size_t rd;
unsigned buflen;
for (buflen = 0; buflen < CVM_BUFSIZE; buffer += rd, buflen += rd) {
rd = read(fd, buffer, CVM_BUFSIZE-buflen);
if (rd == (unsigned)-1) return 0;
if (rd == 0) break;
}
return buflen;
}
unsigned cvm_xfer_command_packets(const char* module,
const struct cvm_packet* request,
struct cvm_packet* response)
{
int pipes[2];
int result;
if (!pipefork(module, pipes)) return CVME_IO;
if (!write_buffer(pipes[0], request->data, request->length) ||
close(pipes[0]) == -1 ||
(response->length = read_buffer(pipes[1], response->data)) == 0 ||
close(pipes[1]) == -1) {
killit();
if ((result = waitforit()) < 0)
return -result;
return CVME_IO;
}
if ((result = waitforit()) < 0)
return -result;
response->data[0] = result;
return 0;
}
cvm-0.97/v2client_wrappers.c 0000644 0000764 0000764 00000004374 12463157763 015444 0 ustar bruce guenter /* cvm/v2client_wrappers.c - CVM version 2 client library wrapper functions
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include "v2client.h"
#include "credentials.h"
static unsigned add(struct cvm_credential* creds,
unsigned i, unsigned type, const char* value)
{
if (value == 0)
return i;
if (value[0] == 0)
return i;
creds[i].type = type;
if (!str_copys(&creds[i].value, value))
return 0;
return i + 1;
}
static int doit(struct cvm_credential creds[],
const char* module,
const char* account,
const char* domain,
const char* password,
int split_account)
{
unsigned i;
creds[0].type = CVM_CRED_ACCOUNT;
if (!str_copys(&creds[0].value, account))
return CVME_IO;
if ((i = add(creds, 1, CVM_CRED_DOMAIN, domain)) == 0)
return CVME_IO;
if (split_account) {
cvm_client_split_account(&creds[0].value, &creds[1].value);
if (i == 1)
if ((i = add(creds, i, CVM_CRED_DOMAIN, creds[i].value.s)) == 0)
return CVME_IO;
}
if ((i = add(creds, i, CVM_CRED_PASSWORD, password)) == 0)
return CVME_IO;
return cvm_client_authenticate(module, i, creds);
}
int cvm_client_authenticate_password(const char* module,
const char* account,
const char* domain,
const char* password,
int split_account)
{
struct cvm_credential creds[3];
unsigned i;
int result;
memset(creds, 0, sizeof creds);
result = doit(creds, module, account, domain, password, split_account);
for (i = 0; i < 3; ++i)
str_free(&creds[i].value);
return result;
}
cvm-0.97/sasl-auth-test.c 0000644 0000764 0000764 00000001336 12463157763 014644 0 ustar bruce guenter #include
#include
#include
#include "sasl.h"
const char program[] = "sasl-auth-test";
const int msg_show_pid = 0;
struct sasl_auth sa = {
.prefix = "+ ",
.in = &inbuf,
.out = &outbuf,
};
int main(int argc, char* argv[])
{
static str s;
int i;
int j;
const char* msg;
if (argc != 2)
die3(1, "usage: ", program, " string");
if (!sasl_auth_init(&sa))
die1(1, "sasl_auth_init failed");
if (!sasl_auth_caps(&s))
die1(1, "sasl_auth_cap failed");
msg1(s.s);
str_copys(&s, argv[1]);
if ((i = sasl_auth1(&sa, &s)) != 0) {
j = i;
msg = sasl_auth_msg(&j);
dief(1, "{sasl_auth1 failed: }d{\n }d{ }s", i, j, msg);
}
return 0;
(void)argc;
}
cvm-0.97/sasl_authenticate.c 0000644 0000764 0000764 00000004157 12463157763 015472 0 ustar bruce guenter #include
#include "v2client.h"
#include "credentials.h"
#include "sasl.h"
#include "sasl_internal.h"
static int setup(int count,
struct cvm_credential* creds,
const char* account,
const char* domain)
{
memset(creds, 0, count * sizeof creds[0]);
creds[0].type = CVM_CRED_ACCOUNT;
if (!str_copys(&creds[0].value, account))
return 0;
if (domain == 0)
domain = "";
creds[1].type = CVM_CRED_DOMAIN;
if (!str_copys(&creds[1].value, domain))
return 0;
return cvm_client_split_account(&creds[0].value, &creds[1].value);
}
static void free_creds(int count, struct cvm_credential* creds)
{
while (count > 1)
str_free(&creds[--count].value);
}
static int authenticate_free(const char* cvm,
int count, struct cvm_credential* creds)
{
int result;
result = cvm_client_authenticate(cvm, count, creds);
free_creds(count, creds);
return result;
}
int sasl_authenticate_plain(struct sasl_state* ss,
const char* account, const char* password)
{
struct cvm_credential creds[3];
if (!setup(3, creds, account, ss->domain))
return SASL_TEMP_FAIL;
creds[2].type = CVM_CRED_PASSWORD;
if (!str_copys(&creds[2].value, password))
return SASL_TEMP_FAIL;
switch (authenticate_free(ss->mech->cvm, 3, creds)) {
case 0: return SASL_AUTH_OK;
case CVME_PERMFAIL: return SASL_AUTH_FAILED;
default: return SASL_TEMP_FAIL;
}
}
int sasl_authenticate_cram(struct sasl_state* ss,
const char* account, const char* cram_type,
const str* challenge, const str* response)
{
struct cvm_credential creds[5];
if (!setup(5, creds, account, ss->domain))
return SASL_TEMP_FAIL;
creds[2].type = CVM_CRED_CHALLENGE;
if (!str_copy(&creds[2].value, challenge))
return SASL_TEMP_FAIL;
creds[3].type = CVM_CRED_RESPONSE;
if (!str_copy(&creds[3].value, response))
return SASL_TEMP_FAIL;
creds[4].type = CVM_CRED_RESPONSE_TYPE;
if (!str_copys(&creds[4].value, cram_type))
return SASL_TEMP_FAIL;
switch (authenticate_free(ss->mech->cvm, 5, creds)) {
case 0: return SASL_AUTH_OK;
case CVME_PERMFAIL: return SASL_AUTH_FAILED;
default: return SASL_TEMP_FAIL;
}
}
cvm-0.97/cvm-mysql-udp.c 0000644 0000764 0000764 00000000000 12463157763 014467 0 ustar bruce guenter cvm-0.97/sasl_auth.c 0000644 0000764 0000764 00000007407 12463157763 013756 0 ustar bruce guenter #include
#include
#include
#include
#include
#include "sasl.h"
#include "v2client.h"
int sasl_auth_init(struct sasl_auth* sa)
{
if (sa->prefix == 0)
sa->prefix = "";
if (sa->suffix == 0)
sa->suffix = "\r\n";
if (sa->in == 0)
sa->in = &inbuf;
if (sa->out == 0)
sa->out = &outbuf;
return sasl_init(&sa->state);
}
int sasl_auth_caps(str* caps)
{
const struct sasl_mechanism* smech;
if (!sasl_mechanisms)
return 0;
if (!str_truncate(caps, 0) ||
!str_copys(caps, "AUTH"))
return -1;
for (smech = sasl_mechanisms; smech != 0; smech = smech->next)
if (!str_catc(caps, ' ') || !str_cats(caps, smech->name))
return -1;
return 1;
}
int sasl_auth2(struct sasl_auth* sa,
const char* mechanism,
const char* init_response)
{
str challenge = {0,0,0};
str challenge64 = {0,0,0};
str response = {0,0,0};
str response64 = {0,0,0};
int i;
str* iresponsestr;
if (init_response != 0) {
if (!str_truncate(&response, 0))
return -1;
if (!base64_decode_line(init_response, &response)) {
msg3("SASL AUTH ", mechanism, " failed: bad response");
str_free(&response);
return SASL_RESP_BAD;
}
iresponsestr = &response;
}
else
iresponsestr = 0;
i = sasl_start(&sa->state, mechanism, iresponsestr, &challenge);
while (i == SASL_CHALLENGE) {
i = -1;
if (str_truncate(&challenge64, 0)
&& base64_encode_line((const unsigned char*)challenge.s,
challenge.len, &challenge64)
&& obuf_puts(sa->out, sa->prefix)
&& obuf_putstr(sa->out, &challenge64)
&& obuf_putsflush(sa->out, sa->suffix)
&& ibuf_getstr_crlf(sa->in, &response64)) {
if (response64.len == 0 || response64.s[0] == '*') {
msg3("SASL AUTH ", mechanism, " failed: aborted");
i = SASL_AUTH_FAILED;
}
else if (!str_truncate(&response, 0) ||
!base64_decode_line(response64.s, &response)) {
msg3("SASL AUTH ", mechanism, " failed: bad response");
i = SASL_RESP_BAD;
}
else
i = sa->state.response(&sa->state, &response, &challenge);
}
else if (ibuf_eof(sa->in))
i = SASL_RESP_EOF;
}
if (i == SASL_AUTH_OK) {
str_truncate(&response, 0);
str_copys(&response, "username=");
str_cats(&response, cvm_fact_username);
if (cvm_fact_sys_username != 0) {
str_cats(&response, " sys_username=");
str_cats(&response, cvm_fact_sys_username);
}
if (cvm_fact_domain != 0 && cvm_fact_domain[0] != 0) {
str_cats(&response, " domain=");
str_cats(&response, cvm_fact_domain);
}
msg4("SASL AUTH ", mechanism, " ", response.s);
cvm_client_setenv();
}
else
msg3("SASL AUTH ", mechanism, " failed");
str_free(&response);
str_free(&response64);
str_free(&challenge);
str_free(&challenge64);
return i;
}
int sasl_auth1(struct sasl_auth* sa, const str* arg)
{
str mechanism = {0,0,0};
int s;
if ((s = str_findfirst(arg, ' ')) != -1) {
if (!str_copyb(&mechanism, arg->s, s))
return -1;
while (arg->s[s] == ' ')
++s;
s = sasl_auth2(sa, mechanism.s, arg->s+s);
str_free(&mechanism);
}
else
s = sasl_auth2(sa, arg->s, 0);
return s;
}
const char* sasl_auth_msg(int* code)
{
int newcode;
const char* msg;
#define R(C,M) newcode=C; msg=M; break
switch (*code) {
case SASL_AUTH_FAILED: R(501,"Authentication failed.");
case SASL_NO_MECH: R(504,"Unrecognized authentication mechanism.");
case SASL_RESP_REQUIRED: R(535,"Response was required but not given.");
case SASL_RESP_NOTALLOWED: R(535,"Initial response not allowed.");
case SASL_RESP_BAD: R(501,"Could not decode the response.");
case SASL_RESP_EOF: R(535,"End of file reached.");
default: R(451,"Internal error.");
}
*code = newcode;
return msg;
}
cvm-0.97/protocol-2.html 0000644 0000764 0000764 00000006107 12463157763 014511 0 ustar bruce guenter
CVM Version 2 Protocol
The version 2 protocol was built based on lessons learned while
working with the version 1 protocol. In particular, it is impossible to
pass binary data with the version 1 protocol without escaping to avoid
NUL bytes. It is also difficult to differentiate between different
types of credentials (ie secret vs. password vs. challenge/response)
since there is no indication given in the request packet what types of
credentials are being sent. Spoofing attacks are possible against
version 1 UDP clients, since an attacker may forge valid responses with
relative ease. This second version protocol retains the efficiency of
the original protocol while correcting these deficiencies.
General Packet Format
Input to and output from the module follows a similar packet format:
a packet identifier byte, a length byte L, L bytes of random data (used
to help prevent spoofing of UDP responses), followed by a series of
tagged strings and completed with a single NUL (zero) byte. The total
size of either the input or the output must not exceed 512 bytes. The
random data in the response is copied exactly from the request.
A tagged string consists of a tag byte T, a length byte L, and L
bytes of data. The tag byte identifies what credential (in the input request) or what fact (in the output response) is represented by
the data. Note that the initial random data in the packet may be viewed
as a tagged string that just differs in the tag value convention.
Input
The packet identifier in the input (request) packet is the protocol
version number (2). Example (all numbers are hexadecimal):
0000000: 0208 0102 0304 0506 0708 0108 7573 6572 ............user
0000010: 6e61 6d65 0209 6c6f 6361 6c68 6f73 7403 name..localhost.
0000020: 0870 6173 7377 6f72 6400 .password.
Output
The packet identifier in the output (response) packet is the error code value, with zero representing
successful validation.
Implementation Considerations
The module must report a temporary error if it detects malformed
input (incorrect credentials, etc.). Extra data following the final
NUL byte in the credentials is a fault in the invoking code, and must
be rejected by the module. Similarly, extra data following the final
NUL byte in the facts is a fault in the module code.
All data following an unsuccessful result status code must be
ignored by the invoking code. Modules should not produce any facts
when validation fails.
An executable module must exit 0 if authentication succeeds.
Non-zero exit codes from an executable module should be treated as a
temporary error.
The invoker of an executable module must assume a temporary error
if the module either fails to completely read its input or produces
incomplete output, even if the module exits without error.
cvm-0.97/cvm-pwfile.c 0000644 0000764 0000764 00000006035 12463157763 014040 0 ustar bruce guenter /* cvm/cvm-pwfile.c - Alternate passwd file CVM module
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include "module.h"
const char program[] = "cvm-pwfile";
static const char* pwfilename;
int cvm_module_init(void)
{
if ((pwfilename = getenv("CVM_PWFILE_PATH")) == 0) return CVME_CONFIG;
if (!pwcmp_start(getenv("CVM_PWFILE_PWCMP"))) return CVME_GENERAL;
return 0;
}
static int parse_rest(char* rest)
{
/* Format: "UID:GID:NAME,other:DIR:SHELL" */
char* tmp;
cvm_fact_userid = strtoul(rest, &tmp, 10);
if (*tmp != ':') return 0;
rest = tmp + 1;
cvm_fact_groupid = strtoul(rest, &tmp, 10);
if (*tmp != ':') return 0;
rest = tmp + 1;
cvm_fact_realname = rest;
if ((tmp = strchr(rest, ',')) != 0) {
*tmp++ = 0;
rest = tmp;
}
if ((tmp = strchr(rest, ':')) == 0) return 0;
*tmp++ = 0;
cvm_fact_directory = rest = tmp;
if ((tmp = strchr(rest, ':')) == 0) return 0;
*tmp++ = 0;
cvm_fact_shell = rest = tmp;
cvm_fact_groupname = 0;
return 1;
}
static char* passwd;
static char* rest;
static str line;
int cvm_module_lookup(void)
{
ibuf pwfile;
long namelen;
if (cvm_module_credentials[CVM_CRED_ACCOUNT].s == 0)
return CVME_NOCRED;
passwd = 0;
namelen = cvm_module_credentials[CVM_CRED_ACCOUNT].len;
if (!ibuf_open(&pwfile, pwfilename, 0)) return CVME_IO;
while (ibuf_getstr(&pwfile, &line, LF)) {
line.s[--line.len] = 0;
if (strncasecmp(cvm_module_credentials[CVM_CRED_ACCOUNT].s, line.s, namelen) == 0
&& line.s[namelen] == ':') {
passwd = line.s + namelen;
*passwd++ = 0;
break;
}
}
ibuf_close(&pwfile);
if (passwd == 0) return CVME_PERMFAIL;
if ((rest = strchr(passwd, ':')) == 0 || rest == passwd)
return CVME_PERMFAIL;
*rest++ = 0;
return 0;
}
int cvm_module_authenticate(void)
{
CVM_CRED_REQUIRED(PASSWORD);
switch (pwcmp_check(cvm_module_credentials[CVM_CRED_PASSWORD].s, passwd)) {
case 0: return 0;
case -1: return CVME_IO | CVME_FATAL;
default: return CVME_PERMFAIL;
}
}
int cvm_module_results(void)
{
cvm_fact_username = line.s;
if (!parse_rest(rest)) return CVME_CONFIG;
return 0;
}
void cvm_module_stop(void)
{
pwcmp_stop();
}
cvm-0.97/sasl_cram_md5.c 0000644 0000764 0000764 00000005114 12463157763 014475 0 ustar bruce guenter #include
#include
#include
#include
#include "v2client.h"
#include "sasl.h"
#include "sasl_internal.h"
static const unsigned char hex2bin[256] = {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 0-15 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 16-31 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 32-47 */
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, /* 48-63 */
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 64-79 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 80-95 */
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 96-111 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 112-127 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 128-143 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 144-159 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 160-175 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 176-191 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 192-207 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 208-223 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 224-239 */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 240-255 */
};
static int response1(struct sasl_state* ss,
const str* response, str* challenge)
{
char binresp[16];
const str binrespstr = { binresp, 16, 0 };
unsigned i;
unsigned j;
if (response->len == 0) return SASL_RESP_BAD;
if ((i = str_findfirst(response, ' ')) == (unsigned)-1
|| response->len - i != 33)
return SASL_RESP_BAD;
response->s[i] = 0;
for (j = 0; j < 32; j += 2)
binresp[j/2] = hex2bin[(unsigned char)response->s[i+j]] << 4
| hex2bin[(unsigned char)response->s[i+j+1]];
return sasl_authenticate_cram(ss, response->s, "CRAM-MD5",
&ss->init, &binrespstr);
(void)challenge;
}
int sasl_cram_md5_start(struct sasl_state* ss,
const str* response, str* challenge)
{
struct timeval tv;
const char* hostname;
if (response)
return SASL_RESP_NOTALLOWED;
ss->response = response1;
if ((hostname = cvm_client_ucspi_domain()) == 0)
hostname = "unknown";
if (gettimeofday(&tv, 0) == -1 ||
!str_copys(&ss->init, "<") ||
!str_cati(&ss->init, getpid()) ||
!str_catc(&ss->init, '.') ||
!str_catu(&ss->init, tv.tv_sec) ||
!str_catc(&ss->init, '.') ||
!str_catuw(&ss->init, tv.tv_usec, 6, '0') ||
!str_catc(&ss->init, '@') ||
!str_cats(&ss->init, hostname) ||
!str_catc(&ss->init, '>') ||
!str_copy(challenge, &ss->init))
return SASL_TEMP_FAIL;
return SASL_CHALLENGE;
}
cvm-0.97/cvm-vchkpw.c 0000644 0000764 0000764 00000003722 12463157763 014054 0 ustar bruce guenter /*
cvm-vchkpw.c
for authentication against vpopmail from http://www.inter7.com
add to conf-cc:
-I/usr/local/vpopmail/include
add to Makefile (mysql if vpopmail is compiled with mysql):
cvm-vchkpw: load cvm-vchkpw.o module.a crypt.lib shadow.lib s.lib socket.lib
./load cvm-vchkpw getpwnam.o module.a `cat crypt.lib` `cat shadow.lib` `cat s.lib` `cat socket.lib` -L/usr/local/vpopmail/lib -L/usr/local/lib/mysql -lbg -lvpopmail -lmysqlclient
cvm-vchkpw.o: compile cvm-vchkpw.c module.h facts.h errors.h
./compile cvm-vchkpw.c
and add cvm-vchkpw to the programs rule
*/
#include
#include
#include
#include
#include
#include
#include "module.h"
const char program[] = "cvm-vchkpw";
int cvm_module_init(void)
{
return 0;
}
void cvm_module_stop(void)
{
return;
}
static struct vqpasswd* mypw;
int cvm_lookup(void)
{
CVM_CRED_REQUIRED(DOMAIN);
if ((mypw = vauth_getpw(cvm_credentials[CVM_CRED_ACCOUNT].s,
cvm_credentials[CVM_CRED_DOMAIN].s)) == 0)
return CVME_PERMFAIL;
return 0;
}
int cvm_authenticate(void)
{
CVM_CRED_REQUIRED(PASSWORD);
if (vauth_crypt(cvm_credentials[CVM_CRED_ACCOUNT].s,
cvm_credentials[CVM_CRED_DOMAIN].s,
cvm_credentials[CVM_CRED_PASSWORD].s,
mypw) != 0)
return CVME_PERMFAIL;
return 0;
}
int cvm_results(void)
{
char* mailbox;
char* tmpstr;
uid_t uid;
gid_t gid;
const long dirlen = strlen(mypw->pw_dir);
tmpstr = vget_assign(cvm_credentials[CVM_CRED_DOMAIN].s, 0, 0, &uid, &gid);
mailbox = malloc(dirlen + 10);
memcpy(mailbox, mypw->pw_dir, dirlen);
memcpy(mailbox+dirlen, "/Maildir/", 10);
cvm_fact_username = mypw->pw_name;
cvm_fact_userid = uid;
cvm_fact_groupid = gid;
cvm_fact_realname = mypw->pw_gecos;
cvm_fact_directory = mypw->pw_dir;
cvm_fact_mailbox = mailbox;
cvm_fact_shell = mypw->pw_shell;
cvm_fact_domain = cvm_credentials[CVM_CRED_DOMAIN].s;
cvm_fact_groupname = 0;
return 0;
}
cvm-0.97/random.h 0000644 0000764 0000764 00000000235 12463157763 013250 0 ustar bruce guenter #ifndef CVM__RANDOM__H__
#define CVM__RANDOM__H__
extern void cvm_random_init(void);
extern void cvm_random_fill(unsigned char* buf, unsigned len);
#endif
cvm-0.97/v2client.c 0000644 0000764 0000764 00000017563 12463157763 013525 0 ustar bruce guenter /* cvm/client.c - CVM client library
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "v2client.h"
#include "credentials.h"
#include "protocol.h"
#include "random.h"
const char* cvm_client_account_split_chars = "@";
static struct cvm_packet request;
static struct cvm_packet response;
static struct
{
unsigned type;
unsigned start;
} offsets[CVM_BUFSIZE/2];
static str randombytes;
/* Packet management code ****************************************************/
static int parse_packet(struct cvm_packet* p)
{
unsigned i;
unsigned o;
if (p->length < 3)
return CVME_BAD_MODDATA;
if (p->data[1] != randombytes.len)
return CVME_BAD_MODDATA;
if (memcmp(p->data+2, randombytes.s, randombytes.len) != 0)
return CVME_BAD_MODDATA;
if (p->data[p->length-1] != 0)
return CVME_BAD_MODDATA;
/* This funny loop gives all the strings in the p->data NUL termination. */
for (i = 0, o = p->data[1] + 2;
o < sizeof p->data && p->data[o] != 0;
++i, o += p->data[o+1] + 2) {
offsets[i].type = p->data[o];
offsets[i].start = o+2;
p->data[o] = 0;
}
offsets[i].type = offsets[i].start = 0;
if (p->data[0] != 0)
return p->data[0];
/* Extract required and common facts. */
if (cvm_client_fact_str(CVM_FACT_USERNAME, &cvm_fact_username, &i) ||
cvm_client_fact_uint(CVM_FACT_USERID, &cvm_fact_userid) ||
cvm_client_fact_uint(CVM_FACT_GROUPID, &cvm_fact_groupid) ||
cvm_client_fact_str(CVM_FACT_DIRECTORY, &cvm_fact_directory, &i))
return CVME_BAD_MODDATA;
cvm_client_fact_str(CVM_FACT_SHELL, &cvm_fact_shell, &i);
cvm_client_fact_str(CVM_FACT_REALNAME, &cvm_fact_realname, &i);
cvm_client_fact_str(CVM_FACT_GROUPNAME, &cvm_fact_groupname, &i);
cvm_client_fact_str(CVM_FACT_SYS_USERNAME, &cvm_fact_sys_username, &i);
cvm_client_fact_str(CVM_FACT_SYS_DIRECTORY, &cvm_fact_sys_directory, &i);
cvm_client_fact_str(CVM_FACT_DOMAIN, &cvm_fact_domain, &i);
cvm_client_fact_str(CVM_FACT_MAILBOX, &cvm_fact_mailbox, &i);
return 0;
}
static unsigned packet_add(struct cvm_packet* p, unsigned type,
unsigned len, const char* data)
{
unsigned char* ptr;
if (p->length + len + 2 >= CVM_BUFSIZE-1)
return 0;
ptr = p->data + p->length;
*ptr++ = type;
*ptr++ = len;
memcpy(ptr, data, len);
p->length += len + 2;
return 1;
}
static void make_randombytes(void)
{
static int initialized = 0;
unsigned i;
const char *e;
if (!initialized) {
cvm_random_init();
if (randombytes.len == 0) {
if ((e = getenv("CVM_RANDOM_BYTES")) != 0)
i = atoi(e);
else
i = 8;
str_ready(&randombytes, i);
randombytes.len = i;
}
initialized = 1;
}
cvm_random_fill((unsigned char*)randombytes.s, randombytes.len);
}
static unsigned build_packet(struct cvm_packet* p,
unsigned count,
const struct cvm_credential* credentials,
int addrandom)
{
const char* env;
unsigned i;
int has_secret;
if (addrandom)
make_randombytes();
else
randombytes.len = 0;
p->length = 0;
if (!packet_add(p, CVM2_PROTOCOL, randombytes.len, randombytes.s))
return 0;
for (i = 0, has_secret = 0; i < count; ++i, ++credentials) {
if (credentials->type == CVM_CRED_SECRET)
has_secret = 1;
if (!packet_add(p, credentials->type,
credentials->value.len, credentials->value.s))
return 0;
}
if (!has_secret
&& (env = getenv("CVM_LOOKUP_SECRET")) != 0)
if (!packet_add(p, CVM_CRED_SECRET, strlen(env), env))
return 0;
p->data[p->length++] = 0;
return 1;
}
int cvm_client_fact_str(unsigned number, const char** data, unsigned* length)
{
static unsigned last_offset = 0;
static unsigned last_number = -1;
unsigned o;
int err = CVME_NOFACT;
o = (number != last_number || offsets[last_offset].type == 0)
? 0
: last_offset;
last_number = number;
while (offsets[o].type != 0) {
if (offsets[o++].type == number) {
*length = (*data = (char*)response.data + offsets[o-1].start)[-1];
err = 0;
break;
}
}
last_offset = o;
return err;
}
int cvm_client_fact_uint(unsigned number, unsigned long* data)
{
const char* ptr;
unsigned len;
unsigned long i;
int err;
if ((err = cvm_client_fact_str(number, &ptr, &len)) != 0) return err;
for (i = 0; len > 0 && *ptr >= '0' && *ptr <= '9'; ++ptr, --len) {
unsigned long tmp = i;
i = (i * 10) + (*ptr - '0');
if (i < tmp)
return CVME_BAD_MODDATA;
}
if (len > 0)
return CVME_BAD_MODDATA;
*data = i;
return 0;
}
int cvm_client_split_account(str* account, str* domain)
{
unsigned actlen;
char* actptr;
unsigned i;
const char* sc;
actlen = account->len;
actptr = account->s;
if ((sc = getenv("CVM_ACCOUNT_SPLIT_CHARS")) == 0)
sc = cvm_client_account_split_chars;
i = actlen;
while (i-- > 0) {
if (strchr(sc, actptr[i]) != 0) {
if (!str_copyb(domain, actptr + i + 1, actlen - i - 1))
return 0;
account->s[account->len = i] = 0;
break;
}
}
return 1;
}
/* Top-level wrapper *********************************************************/
int cvm_client_authenticate(const char* modules, unsigned count,
const struct cvm_credential* credentials)
{
int result;
void (*oldsig)(int);
int addrandom;
static str module_list;
striter i;
unsigned long u;
/* Make a copy of the module list so we can make the strings NUL
* terminated internally. */
if (!str_copys(&module_list, modules))
return CVME_IO | CVME_FATAL;
str_subst(&module_list, ',', '\0');
/* Set addrandom to true if any module uses UDP. */
addrandom = 0;
striter_loop(&i, &module_list, '\0') {
if (memcmp(i.startptr, "cvm-udp:", 8) == 0) {
addrandom = 1;
break;
}
}
if (!build_packet(&request, count, credentials, addrandom))
return CVME_GENERAL;
oldsig = signal(SIGPIPE, SIG_IGN);
/* Invoke each module in the list, exiting when any module produces a
* non-PERMFAIL result, or when it produces a PERMFAIL result with
* OUTOFSCOPE set to 0. */
striter_loop(&i, &module_list, '\0') {
if (!memcmp(i.startptr, "cvm-udp:", 8))
result = cvm_xfer_udp_packets(i.startptr+8, &request, &response);
else if (!memcmp(i.startptr, "cvm-local:", 10))
result = cvm_xfer_local_packets(i.startptr+10, &request, &response);
else {
if (!memcmp(i.startptr, "cvm-command:", 12))
i.startptr += 12;
result = cvm_xfer_command_packets(i.startptr, &request, &response);
}
/* Note: the result returned by cvm_xfer_* indicates if transmission
* succeeded, not the actual result of validation. The validation
* result is returned by parse_packet. */
if (result == 0)
result = parse_packet(&response);
/* Return success and temporary failures. */
if (result != CVME_PERMFAIL)
break;
/* Also return permanent failure if the result is in scope. */
if (cvm_client_fact_uint(CVM_FACT_OUTOFSCOPE, &u) == 0
&& u == 0)
break;
}
signal(SIGPIPE, oldsig);
return result;
}
cvm-0.97/sql.h 0000644 0000764 0000764 00000001114 12463157763 012564 0 ustar bruce guenter #ifndef CVM__SQL__H__
#define CVM__SQL__H__
#include
extern const char sql_query_default[];
extern int sql_query_validate(const char* template);
extern int sql_query_build(const char* template, str* q);
/* These routines must be defined by the SQL module */
extern const char sql_query_var[];
extern const char sql_pwcmp_var[];
extern const char sql_postq_var[];
extern int sql_auth_init(void);
extern int sql_auth_query(const str* query);
extern int sql_post_query(const str* query);
extern const char* sql_get_field(int field);
extern void sql_auth_stop(void);
#endif
cvm-0.97/COPYING 0000644 0000764 0000764 00000043110 12463157763 012651 0 ustar bruce guenter GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
cvm-0.97/getpwnam.c 0000644 0000764 0000764 00000004113 12463157763 013604 0 ustar bruce guenter /* cvm/getpwnam.c - Handles getpwnam+getspnam+getuserpw combinations
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include "module.h"
#ifdef HASSPNAM
#include
static struct spwd* spw;
#endif
#ifdef HASUSERPW
#include
static struct userpw* uwp;
#endif
static char* actbuf = 0;
static unsigned actlen = 0;
static const char* copyact(const char* account)
{
unsigned len;
char *ptr;
if ((len = strlen(account)) > actlen) {
if ((actbuf = realloc(actbuf, len+1)) == 0) return 0;
actlen = len;
}
for (ptr = actbuf; *account != 0; ++ptr, ++account)
*ptr = isupper(*account) ? tolower(*account) : *account;
*ptr = 0;
return actbuf;
}
int cvm_getpwnam(const char* account, struct passwd** pwp)
{
struct passwd* pw;
account = copyact(account);
if ((pw = getpwnam(account)) == 0)
return (errno == ETXTBSY) ? CVME_IO : CVME_PERMFAIL;
#ifdef HASUSERPW
if ((upw = getuserpw(account)) == 0) {
if (errno == ETXTBSY) return CVME_IO;
}
else if (upw->upw_passwd)
pw->pw_passwd = upw->upw_passwd;
#endif
#ifdef HASSPNAM
if ((spw = getspnam(account)) == 0) {
if (errno == ETXTBSY) return CVME_IO;
}
else if (spw->sp_pwdp)
pw->pw_passwd = spw->sp_pwdp;
#endif
*pwp = pw;
return 0;
}
cvm-0.97/v1client.html 0000644 0000764 0000764 00000011035 12463157763 014232 0 ustar bruce guenter
CVM Version 1 Client Library
The CVM version 1 client library defines the following functions:
- int cvm_client_authenticate(const char* module, const char*
account, const char* domain, const char** credentials, int
parse_account)
This is the main entry point to the library.
Simply set up the credentials as an array with a trailing NULL pointer
and call authenticate. If the domain parameter is a
NULL pointer, it will be treated as an empty string; no other parameter
may be NULL. The function will return 0 if authentication succeeded and
an error code otherwise.
If parse_account is true then account is searched
for the last instance of any character from
cvm_client_account_split_chars. If found, domain is
replaced with the portion of account following that character,
and account is truncated before that character.
cvm_client_account_split_chars defaults to "@", which
may be overridden by either setting it to a different string from the
client program or by setting the $CVM_ACCOUNT_SPLIT_CHARS
environment variable. Setting it to an empty string will effectively
prevent parsing of the account name, no matter what
parse_account may be set to.
If authentication succeeds, this routine automatically retrieves
cvm_fact_username, cvm_fact_userid,
cvm_fact_groupid, cvm_fact_directory, and
cvm_fact_shell. cvm_fact_realname,
cvm_fact_groupname, cvm_fact_sys_username,
cvm_fact_sys_directory, and cvm_fact_domain are also
set if they were present in the results.
The client should change directory to the named home directory and
drop root priviledges as soon as possible after successful
authentication. Where reasonable, the client should also chroot to
the directory for added protection.
- int cvm_client_fact_str(unsigned number, const char** data)
Retrieves a fact from the data returned
by the module as a NUL-terminated string. Returns zero if the fact was
present, and CVME_NOFACT otherwise. Successive calls to this
function with the same number return subsequent facts if more
than one instance of the fact was present.
- int cvm_client_fact_uint(unsigned number, unsigned long*
data)
Retrieves a fact from the
data returned by the module as an unsigned integer. Returns zero if the
fact was present and was an unsigned integer. Returns
CVME_BAD_MODDATA if the fact was present but was not an
unsigned integer. Successive calls to this function with the same
number return subsequent facts if more than one instance of the
fact was present.
- const char* cvm_client_ucspi_domain(void)
Retrieves
the UCSPI local domain from the environment variable named
${PROTO}LOCALHOST. Use this as the domain paramenter
to cvm_authenticate in all UCSPI servers that have no other
means of determining the domain name.
- int cvm_client_setenv(void)
Exports the following
environment variables based on their associated CVM fact. If the fact
was optional and was not present in the results from the module, the
environment variable will not be set or unset.
Variable | CVM Fact |
USER | CVM_FACT_USERNAME |
UID | CVM_FACT_USERID |
GID | CVM_FACT_GROUPID |
NAME | CVM_FACT_REALNAME |
HOME | CVM_FACT_DIRECTORY |
SHELL | CVM_FACT_SHELL |
GROUP | CVM_FACT_GROUPNAME |
DOMAIN | CVM_FACT_DOMAIN |
MAIL | CVM_FACT_MAILBOX |
MAILBOX | CVM_FACT_MAILBOX |
MAILDIR | CVM_FACT_MAILBOX |
- int cvm_client_setugid(void)
Calls chdir,
setgid and setuid with appropriate values based on the
data returned from the authentication. Returns zero if any of the calls
failed.
cvm-0.97/cvm-vmailmgr-local.c 0000644 0000764 0000764 00000000000 12463157763 015442 0 ustar bruce guenter cvm-0.97/facts.c 0000644 0000764 0000764 00000002324 12463157763 013064 0 ustar bruce guenter /* cvm/facts.c - Predefined credential facts
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "facts.h"
const char* cvm_fact_username = 0;
unsigned long cvm_fact_userid = 0;
unsigned long cvm_fact_groupid = 0;
const char* cvm_fact_realname = 0;
const char* cvm_fact_directory = 0;
const char* cvm_fact_shell = 0;
const char* cvm_fact_groupname = 0;
const char* cvm_fact_sys_username = 0;
const char* cvm_fact_sys_directory = 0;
const char* cvm_fact_domain = 0;
const char* cvm_fact_mailbox = 0;
cvm-0.97/SRCFILES 0000644 0000764 0000764 00000002127 12463157763 012756 0 ustar bruce guenter INSTHIER
client_domain.c
client_setenv.c
client_setugid.c
client_xfer_command.c
client_xfer_compat.c
client_xfer_local.c
client_xfer_udp.c
credentials.h
cvm-benchclient.c
cvm-chain.c
cvm-checkpassword.c
cvm-mysql-local.c
cvm-mysql-udp.c
cvm-mysql.c
cvm-pgsql-local.c
cvm-pgsql-udp.c
cvm-pgsql.c
cvm-pwfile.c
cvm-qmail.c
cvm-sqlite.c
cvm-testclient.c
cvm-unix.c
cvm-v1benchclient.c
cvm-v1checkpassword.c
cvm-v1testclient.c
cvm-vchkpw.c
cvm-vmailmgr-local.c
cvm-vmailmgr-udp.c
cvm-vmailmgr.c
cvm-vmailmgr.h
errors.c
errors.h
facts.c
facts.h
getpwnam.c
module.h
module_command.c
module_command_main.c
module_local.c
module_local_main.c
module_log.c
module_main.c
module_output.c
module_request.c
module_udp.c
module_udp_main.c
protocol.h
qmail-domains.c
qmail-dotfile.c
qmail-init.c
qmail-lookup.c
qmail-users.c
qmail.h
random.c
random.h
sasl-auth-test.c
sasl.h
sasl_auth.c
sasl_authenticate.c
sasl_cram_md5.c
sasl_init.c
sasl_internal.h
sasl_login.c
sasl_plain.c
sasl_start.c
sql-auth.c
sql-query-test.c
sql-query.c
sql.h
v1client.c
v1client.h
v2client.c
v2client.h
v2client_wrappers.c
vmautoconvert.c
vmlookup.c
cvm-0.97/cvm-pwfile.html 0000644 0000764 0000764 00000001620 12463157763 014555 0 ustar bruce guenter
The cvm-pwfile Module
Synopsis:
UNIX-style passwd file module
Credentials:
- Pass phrase
Description:
This module loads entries from an alternate password file using the
fgetpwent API, which requires the file to be formatted the
same as the UNIX /etc/passwd file. No group name lookups are
done.
Configuration Variables:
- $CVM_PWFILE_PATH
- the path to the passwd file
containing the credential information.
- $CVM_PWFILE_PWCMP (optional)
- The password comparison module to use. If it
is not set, the default password comparison mode is plain-text. To use
UNIX crypt style passwords, like /etc/passwd does, set this to
"crypt".
cvm-0.97/cvm-sqlite.html 0000644 0000764 0000764 00000004337 12463157763 014600 0 ustar bruce guenter
The cvm-sqlite Module
Synopsis:
SQLite module
Credentials:
- Pass phrase
Description:
This module queries an
SQLite
database for credential validation.
Configuration Variables:
The following environmental variables are required in the
execution environment of cvm-sqlite:
- $CVM_SQLITE_DB
- The full path to the credential database file.
- $CVM_SQLITE_QUERY
- The SQL query statement used to submit for credential validation.
- $CVM_SQLITE_PWCMP
- The password comparison module to use.
Set to one of two values:
- 'crypt', for passwords stored encrypted
- 'plain', for passwords stored unencrypted
Sample Schema
The following CREATE TABLE statement is shown as an example
for initializing an SQLite database for use with this CVM:
CREATE TABLE accounts (
username TEXT NOT NULL, -- required
domain TEXT NOT NULL DEFAULT '',
password TEXT NOT NULL, -- required
userid TEXT NOT NULL, -- required
groupid TEXT NOT NULL, -- required
realname TEXT, -- opt
directory TEXT NOT NULL, -- required
shell TEXT, -- opt
groupname TEXT, -- opt
sys_username TEXT, -- opt
sys_directory TEXT, -- opt
mailbox_path TEXT, -- opt
UNIQUE (username, domain)
);
Sample Query
The following example shows CVM_SQLITE_QUERY
defined with a query statement for use with the above schema:
CVM_SQLITE_QUERY='
SELECT
-- required:
password, username, userid, groupid, directory,
-- optional gecos:
realname, shell,
-- optional other:
groupname, domain, sys_username, sys_directory, mailbox_path
FROM accounts
WHERE username=$account
AND domain=$domain '
cvm-0.97/TODO 0000644 0000764 0000764 00000003136 12463157763 012312 0 ustar bruce guenter - Add a CVM suitable for anonymous FTP
- v1client dies if domain is NULL in cvm_client_authenticate
(can't reproduce this bug)
- Write tests for:
- cvm_client_split_account in v2client.c
- cvm_client_ucspi_domain and cvm_client_setugid (?)
- Add concurrent access support to cvm-local mode?
- Add cvm-tcp module code?
- Build a caching CVM proxy
- Two hash tables keyed on binary request string.
- First hash table for positive responses, holds raw response binary.
- Second hash table for negative responses, holds only response code.
- Caches positive response for $TTL seconds.
- Caches negative response for $TTL_BAD seconds.
- Do not cache temporary errors.
- Add support for allow/deny tables
- File based: if $CVM_ACCESS/deny/$USER exists, or if
$CVM_ACCESS/allow exists and $CVM_ACCESS/allow/$USER does not
exist, deny the user. Call a common function to test.
- SQL modules: add an extra required boolean column to the query.
- Write a module to do lookups from a CDB file, as well as a tool to
manipulate that file "cdbpasswd".
- Write cvm UDP-to-command and local-to-command relays:
- recv input block from socket
- spawn command
- write block
- read result
- send result back on socket
- Split into cvm (containing the main modules) and lib/cvm (containing
the client/module code).
cvm-*sql:
- Add hooks for prepare/execute in SQL modules.
cvm-vmailmgr:
- Add code to vmailmgr_auth to try to grab the password from /etc/passwd
if the main authentication fails.
- Write modules for authenticating against a vmailmgrd daemon, both
local and (TCP) remote.
cvm-0.97/cvm-testclient.c 0000644 0000764 0000764 00000005270 12463157763 014730 0 ustar bruce guenter /* cvm/cvm-testclient.c - Diagnostic CVM client
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include "v2client.h"
const char program[] = "cvm-testclient";
const int msg_show_pid = 0;
const char usage[] = "\n"
"usage: cvm-testclient cvmodule account domain\n"
" or: cvm-testclient cvmodule account domain password\n";
static void s(const char* name, const char* value)
{
obuf_puts(&outbuf, name);
obuf_puts(&outbuf, (value == 0) ? "(null)" : value);
obuf_endl(&outbuf);
}
static void u(const char* name, unsigned long value)
{
obuf_puts(&outbuf, name);
obuf_putu(&outbuf, value);
obuf_endl(&outbuf);
}
int main(int argc, char** argv)
{
int i;
unsigned long v;
char num[FMT_ULONG_LEN];
switch (argc) {
case 4:
i = cvm_client_authenticate_password(argv[1], argv[2], argv[3], 0, 1);
break;
case 5:
i = cvm_client_authenticate_password(argv[1], argv[2], argv[3], argv[4], 1);
break;
default:
die2(1, "Incorrect usage.", usage);
return 1;
}
if (i) {
num[fmt_udec(num, i)] = 0;
msg5("Authentication failed, error #", num, " (",
(i < cvm_nerr) ? cvm_errlist[i] : "Unknown error code", ")");
if (cvm_client_fact_uint(CVM_FACT_OUTOFSCOPE, &v) == 0)
u("out of scope: ", v);
return i;
}
s("user name: ", cvm_fact_username);
u("user ID: ", cvm_fact_userid);
u("group ID: ", cvm_fact_groupid);
s("real name: ", cvm_fact_realname);
s("directory: ", cvm_fact_directory);
s("shell: ", cvm_fact_shell);
s("group name: ", cvm_fact_groupname);
s("system user name: ", cvm_fact_sys_username);
s("system directory: ", cvm_fact_sys_directory);
s("domain: ", cvm_fact_domain);
s("mailbox path: ", cvm_fact_mailbox);
while (cvm_client_fact_uint(CVM_FACT_SUPP_GROUPID, &v) == 0)
u("supp. group ID: ", v);
return 0;
}
cvm-0.97/client_setugid.c 0000644 0000764 0000764 00000002114 12463157763 014763 0 ustar bruce guenter /* cvm/client_setugid.c - CVM client standard setuid/setgid call
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include "v1client.h"
int cvm_client_setugid(void)
{
if (setgid(cvm_fact_groupid) == -1) return 0;
if (setuid(cvm_fact_userid) == -1) return 0;
if (chdir(cvm_fact_directory) == -1) return 0;
return 1;
}
cvm-0.97/v1client.c 0000644 0000764 0000764 00000011707 12463157763 013516 0 ustar bruce guenter /* cvm/client.c - CVM client library
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "v1client.h"
#include "protocol.h"
const char* cvm_client_account_split_chars = "@";
static struct cvm_packet request;
static struct cvm_packet response;
/* Packet management code ****************************************************/
static int parse_packet(struct cvm_packet* p)
{
if (p->data[0] != 0)
return p->data[0];
if (p->length < 3
|| p->data[p->length-1] != 0
|| p->data[p->length-2] != 0)
return CVME_BAD_MODDATA;
if (cvm_client_fact_str(CVM_FACT_USERNAME, &cvm_fact_username) ||
cvm_client_fact_uint(CVM_FACT_USERID, &cvm_fact_userid) ||
cvm_client_fact_uint(CVM_FACT_GROUPID, &cvm_fact_groupid) ||
cvm_client_fact_str(CVM_FACT_DIRECTORY, &cvm_fact_directory))
return CVME_BAD_MODDATA;
cvm_client_fact_str(CVM_FACT_SHELL, &cvm_fact_shell);
cvm_client_fact_str(CVM_FACT_REALNAME, &cvm_fact_realname);
cvm_client_fact_str(CVM_FACT_GROUPNAME, &cvm_fact_groupname);
cvm_client_fact_str(CVM_FACT_SYS_USERNAME, &cvm_fact_sys_username);
cvm_client_fact_str(CVM_FACT_SYS_DIRECTORY, &cvm_fact_sys_directory);
cvm_client_fact_str(CVM_FACT_DOMAIN, &cvm_fact_domain);
cvm_client_fact_str(CVM_FACT_MAILBOX, &cvm_fact_mailbox);
return 0;
}
static int packet_add(struct cvm_packet* p,
const char* str, unsigned len)
{
unsigned char* ptr;
if (p->length + len + 1 >= CVM_BUFSIZE-1)
return 0;
ptr = p->data + p->length;
memcpy(ptr, str, len);
ptr[len] = 0;
p->length += len + 1;
return 1;
}
static unsigned build_packet(struct cvm_packet* p,
const char* account, const char* domain,
const char** credentials, int parse_domain)
{
unsigned i;
unsigned actlen;
p->data[0] = CVM1_PROTOCOL;
p->length = 1;
actlen = strlen(account);
if (parse_domain) {
const char* sc;
if ((sc = getenv("CVM_ACCOUNT_SPLIT_CHARS")) == 0)
sc = cvm_client_account_split_chars;
i = strlen(account);
while (i-- > 0) {
if (strchr(sc, account[i]) != 0) {
domain = account + i + 1;
actlen = i;
break;
}
}
}
if (!packet_add(p, account, actlen)) return 0;
if (!packet_add(p, domain, strlen(domain))) return 0;
for (i = 0; credentials[i] != 0; i++)
if (!packet_add(p, credentials[i], strlen(credentials[i])))
return 0;
p->data[p->length++] = 0;
return 1;
}
int cvm_client_fact_str(unsigned number, const char** data)
{
static unsigned char* ptr = 0;
static unsigned last_number = -1;
if (!ptr || number != last_number)
ptr = response.data+1;
last_number = number;
while (*ptr) {
unsigned char* tmp = ptr;
ptr += strlen((char*)ptr) + 1;
if (*tmp == number) {
*data = (char*)tmp + 1;
return 0;
}
}
return CVME_NOFACT;
}
int cvm_client_fact_uint(unsigned number, unsigned long* data)
{
const char* str;
unsigned long i;
int err;
if ((err = cvm_client_fact_str(number, &str)) != 0) return err;
for (i = 0; *str >= '0' && *str <= '9'; ++str) {
unsigned long tmp = i;
i = (i * 10) + (*str - '0');
if (i < tmp)
return CVME_BAD_MODDATA;
}
if (*str)
return CVME_BAD_MODDATA;
*data = i;
return 0;
}
/* Top-level wrapper *********************************************************/
int cvm_client_authenticate(const char* module, const char* account,
const char* domain, const char** credentials,
int parse_domain)
{
int result;
void (*oldsig)(int);
if (domain == 0) domain = "";
if (!build_packet(&request, account, domain, credentials, parse_domain))
return CVME_GENERAL;
oldsig = signal(SIGPIPE, SIG_IGN);
if (!memcmp(module, "cvm-udp:", 8))
result = cvm_xfer_udp_packets(module+8, &request, &response);
else if (!memcmp(module, "cvm-local:", 10))
result = cvm_xfer_local_packets(module+10, &request, &response);
else {
if (!memcmp(module, "cvm-command:", 12)) module += 12;
result = cvm_xfer_command_packets(module, &request, &response);
}
signal(SIGPIPE, oldsig);
if (result != 0) return result;
return parse_packet(&response);
}
cvm-0.97/cvm-benchclient.c 0000644 0000764 0000764 00000003460 12463157763 015027 0 ustar bruce guenter /* cvm/cvm-benchclient.c - CVM benchmark client
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include "v2client.h"
#include
#include
const char program[] = "cvm-benchclient";
const int msg_show_pid = 0;
const char usage[] = "\n"
"usage: cvm-benchclient count cvmodule account domain\n"
" or: cvm-benchclient count cvmodule account domain password\n";
int main(int argc, char** argv)
{
int a;
unsigned long count;
unsigned long i;
char* ptr;
char num[FMT_ULONG_LEN];
if (argc < 5)
die2(1, "Too few command-line arguments", usage);
if (argc > 6)
die2(1, "Too many command-line arguments", usage);
if ((count = strtoul(argv[1], &ptr, 10)) == 0 || *ptr)
die2(1, "Invalid number for count: ", argv[1]);
for (i = 0; i < count; i++) {
if ((a = cvm_client_authenticate_password(argv[2],
argv[3], argv[4], argv[5], 0)) != 0) {
num[fmt_udec(num, a)] = 0;
die5(a, "Authentication failed, error #", num, " (",
(a < cvm_nerr) ? cvm_errlist[i] : "Unknown error code", ")");
}
}
return 0;
}
cvm-0.97/client_setenv.c 0000644 0000764 0000764 00000005254 12463157763 014633 0 ustar bruce guenter /* cvm/client_setenv.c - CVM client standard setenv calls
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include "v1client.h"
static char* utoa_rec(unsigned i, char* buf)
{
if (i < 10)
*buf = i + '0';
else {
buf = utoa_rec(i / 10, buf);
*buf = (i % 10) + '0';
}
*++buf = 0;
return buf;
}
static char utoa_buf[32];
static char* utoa(unsigned i)
{
utoa_rec(i, utoa_buf);
return utoa_buf;
}
static int utoa_len(unsigned i)
{
return utoa_rec(i, utoa_buf) - utoa_buf;
}
static int set_gids(void)
{
unsigned long gid;
long len;
char* start;
char* ptr;
int result;
len = 0;
while (cvm_client_fact_uint(CVM_FACT_SUPP_GROUPID, &gid) == 0)
len += utoa_len(gid) + 1;
/* Don't set $GIDS if no supplementary group IDs were listed */
if (len == 0) return 1;
/* Reset to the start of facts list */
cvm_client_fact_uint(-1, &gid);
ptr = start = malloc(len);
while (cvm_client_fact_uint(CVM_FACT_SUPP_GROUPID, &gid) == 0) {
if (ptr > start) *ptr++ = ',';
ptr = utoa_rec(gid, ptr);
}
result = setenv("GIDS", start, 1) == 0;
free(start);
return result;
}
int cvm_client_setenv(void)
{
if (setenv("USER", cvm_fact_username, 1) != 0) return 0;
if (setenv("UID", utoa(cvm_fact_userid), 1) != 0) return 0;
if (setenv("GID", utoa(cvm_fact_groupid), 1) != 0) return 0;
if (cvm_fact_realname &&
setenv("NAME", cvm_fact_realname, 1) != 0) return 0;
if (setenv("HOME", cvm_fact_directory, 1) != 0) return 0;
if (cvm_fact_shell &&
setenv("SHELL", cvm_fact_shell, 1) != 0) return 0;
if (cvm_fact_groupname &&
setenv("GROUP", cvm_fact_groupname, 1) != 0) return 0;
if (cvm_fact_domain &&
setenv("DOMAIN", cvm_fact_domain, 1) != 0) return 0;
if (cvm_fact_mailbox &&
(setenv("MAIL", cvm_fact_mailbox, 1) != 0
|| setenv("MAILBOX", cvm_fact_mailbox, 1) != 0
|| setenv("MAILDIR", cvm_fact_mailbox, 1)))
return 0;
if (!set_gids()) return 0;
return 1;
}
cvm-0.97/cvm-0.97.spec 0000644 0000764 0000764 00000003626 12463157763 013662 0 ustar bruce guenter Name: cvm
Summary: Credential Validation Modules
Version: 0.97
Release: 1
License: GPL
Group: Utilities/System
Source: http://untroubled.org/cvm/cvm-0.97.tar.gz
BuildRoot: %{_tmppath}/cvm-buildroot
URL: http://untroubled.org/cvm/
Packager: Bruce Guenter
Requires: bglibs >= 1.103
BuildRequires: libtool
BuildRequires: bglibs-devel >= 1.103
BuildRequires: mysql-devel
BuildRequires: postgresql-devel
Obsoletes: cvm-vmailmgr
%description
This package implements the CVM interface as a client (cvm-testclient),
and as a module (cvm-unix, cvm-pwfile).
%package devel
Summary: Development libraries for CVM
Group: Development/Libraries
%description devel
This package includes all the development libraries and headers for
building CVM clients or modules.
%package mysql
Group: Utilities/System
Summary: MySQL Credential Validation Modules
%description mysql
Credential Validation Modules that authenticate against a MySQL server.
%package pgsql
Group: Utilities/System
Summary: PostgreSQL Credential Validation Modules
%description pgsql
Credential Validation Modules that authenticate against a PostgreSQL server.
%prep
%setup
%build
echo gcc "%{optflags}" -I%{_includedir}/pgsql >conf-cc
echo gcc -s -L%{_libdir}/mysql >conf-ld
echo %{_bindir} >conf-bin
echo %{_includedir} >conf-include
echo %{_libdir} >conf-lib
make libraries programs mysql pgsql
%install
rm -fr %{buildroot}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}
make install_prefix=%{buildroot} install
%clean
rm -rf %{buildroot}
%post
/sbin/ldconfig
%files
%defattr(-,root,root)
%doc COPYING NEWS README *.html
%{_bindir}/cvm-[^mp]*
%{_bindir}/cvm-pwfile
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/*.a
%{_libdir}/*.la
%{_libdir}/*.so
%files mysql
%defattr(-,root,root)
%{_bindir}/cvm-mysql*
%files pgsql
%defattr(-,root,root)
%{_bindir}/cvm-pgsql*
cvm-0.97/qmail-domains.c 0000644 0000764 0000764 00000007142 12463157763 014522 0 ustar bruce guenter /* qmail-domains.c - qmail locals/virtualdomains lookup routines
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include "qmail.h"
static dict vdomains;
static struct stat vdomains_stat;
static str vdomains_path;
static dict locals;
static struct stat locals_stat;
static str locals_path;
static int assume_local = 0;
static int map_lower(str* s)
{
str_lower(s);
return 1;
}
static int stat_changed(const char* path, const struct stat* orig,
struct stat* curr)
{
if (stat(path, curr) != 0)
return -1;
if (orig->st_mtime != curr->st_mtime
|| orig->st_ino != curr->st_ino
|| orig->st_size != curr->st_size)
return 1;
return 0;
}
static int load_dict(const char* path, struct stat* oldstat,
dict* dictp, void (*free_fn)(void*),
int (*load_fn)(void))
{
struct stat s;
switch (stat_changed(path, oldstat, &s)) {
case -1:
if (errno != ENOENT)
return 0;
oldstat->st_mtime = 0;
oldstat->st_ino = 0;
oldstat->st_size = 0;
dict_free(dictp, free_fn);
return 1;
case 0:
return 1;
}
// FIXME: obuf_putsflush(&errbuf, "Reloading *path*\n");
*oldstat = s;
dict_free(dictp, free_fn);
return load_fn();
}
static int _load_vdomains(void)
{
return dict_load_map(&vdomains, vdomains_path.s, 0, ':', map_lower, 0);
}
static int load_vdomains(void)
{
return load_dict(vdomains_path.s, &vdomains_stat, &vdomains, dict_str_free, _load_vdomains);
}
static int _load_locals(void)
{
return dict_load_list(&locals, locals_path.s, 0, map_lower);
}
static int load_locals(void)
{
return load_dict(locals_path.s, &locals_stat, &locals, 0, _load_locals);
}
int qmail_domains_reinit(void)
{
if (!load_locals()
|| !load_vdomains())
return -1;
return 0;
}
int qmail_domains_init(void)
{
assume_local = getenv("CVM_QMAIL_ASSUME_LOCAL") != 0;
if (!str_copy2s(&vdomains_path, qmail_root, "/control/virtualdomains")
|| !str_copy2s(&locals_path, qmail_root, "/control/locals"))
return -1;
if (!load_locals()
|| !load_vdomains())
return -1;
return 0;
}
int qmail_domains_lookup(const str* d, str* domain, str* prefix)
{
dict_entry* e;
if (!str_copy(domain, d))
return -1;
str_lower(domain);
if ((e = dict_get(&locals, domain)) != 0)
return str_copys(prefix, "") ? 1 : -1;
if ((e = dict_get(&vdomains, domain)) == 0) {
unsigned i;
while ((i = str_findnext(domain, '.', 1)) != (unsigned)-1) {
str_lcut(domain, i);
if ((e = dict_get(&vdomains, domain)) != 0)
break;
}
}
if (e == 0) {
if (assume_local) {
if (!str_copys(prefix, "")) return -1;
if (!str_copy(domain, d)) return -1;
str_lower(domain);
return 1;
}
return 0;
}
if (!str_copy(prefix, (str*)e->data))
return -1;
return 1;
}
cvm-0.97/qmail-init.c 0000644 0000764 0000764 00000004161 12463157763 014031 0 ustar bruce guenter /* qmailn.c - qmail initialization routines
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include "qmail.h"
const char* qmail_root = "/var/qmail";
const char* qmail_me = 0;
const char* qmail_envnoathost = 0;
static int read_control(const char* control,
const char** s,
str* path)
{
/* Hostnames are realistically limited to 256 bytes. This is overkill. */
char buf[4096];
int fd;
long rd;
char* nl;
char* news;
long len;
if (!str_copy3s(path, qmail_root, "/control/", control))
return -1;
if ((fd = open(path->s, O_RDONLY)) == -1)
return (errno == ENOENT) ? 0 : -1;
rd = read(fd, buf, sizeof buf);
close(fd);
if (rd <= 0)
return rd;
if ((nl = memchr(buf, '\n', rd)) == 0)
nl = buf + rd;
len = nl - buf;
if ((news = malloc(len + 1)) == 0)
return -1;
memcpy(news, buf, len);
news[len] = 0;
*s = news;
return 0;
}
int qmail_init(void)
{
str path = { 0,0,0 };
const char* tmp;
if ((tmp = getenv("QMAIL_ROOT")) != 0)
qmail_root = tmp;
if (read_control("envnoathost", &qmail_envnoathost, &path) != 0)
return -1;
if (read_control("me", &qmail_me, &path) != 0)
return -1;
if (qmail_envnoathost == 0)
qmail_envnoathost = (qmail_me == 0) ? "envnoathost" : qmail_me;
if (qmail_me == 0)
qmail_me = "me";
str_free(&path);
return 0;
}
cvm-0.97/module_local.c 0000644 0000764 0000764 00000011322 12463157763 014421 0 ustar bruce guenter /* cvm/module_local.c - Local CVM server module loop
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "module.h"
static const char* path;
static int sock;
static int conn;
static unsigned long timeout = 1000;
static int poll_timeout(int fd, int event, unsigned long* timeout_left)
{
struct timeval start;
struct timeval end;
iopoll_fd io;
int r;
io.fd = fd;
io.events = event;
gettimeofday(&start, 0);
r = iopoll_restart(&io, 1, *timeout_left);
gettimeofday(&end, 0);
*timeout_left -= (end.tv_usec - start.tv_usec) / 1000
+ (end.tv_sec - start.tv_sec) * 1000;
return r;
}
static int read_input(void)
{
unsigned rd;
unsigned long timeout_left;
if ((conn = socket_acceptu(sock)) == -1) return CVME_IO;
if (!nonblock_on(conn)) {
close(conn);
return CVME_IO;
}
for (cvm_module_inbuflen = 0, timeout_left = timeout;
cvm_module_inbuflen < BUFSIZE;
cvm_module_inbuflen += rd) {
switch (poll_timeout(conn, IOPOLL_READ, &timeout_left)) {
case 0:
case -1:
close(conn);
return CVME_IO;
}
if ((rd = read(conn, cvm_module_inbuffer+cvm_module_inbuflen,
BUFSIZE-cvm_module_inbuflen)) == 0)
break;
if (rd == (unsigned)-1) {
close(conn);
return CVME_IO;
}
}
return 0;
}
static void write_output(void)
{
unsigned wr;
unsigned written;
unsigned long timeout_left;
for (written = 0, timeout_left = timeout;
written < cvm_module_outbuflen;
written += wr) {
if (poll_timeout(conn, IOPOLL_WRITE, &timeout_left) != 1)
break;
if ((wr = write(conn, cvm_module_outbuffer+written,
cvm_module_outbuflen-written)) == 0)
break;
if (wr == (unsigned)-1) break;
}
close(conn);
}
static void exitfn()
{
unlink(path);
cvm_module_log_shutdown();
exit(0);
}
static int make_socket(void)
{
mode_t old_umask;
mode_t mode = 0777;
uid_t owner = -1;
gid_t group = -1;
const char* tmp;
char* end;
struct passwd* pw;
struct group* gr;
if ((tmp = getenv("CVM_SOCKET_MODE")) != 0)
mode = strtoul(tmp, 0, 8);
if ((tmp = getenv("CVM_SOCKET_OWNER")) != 0) {
owner = strtoul(tmp, &end, 10);
if (*end != 0) {
if ((pw = getpwnam(tmp)) == 0) {
error1sys("getpwnam failed");
return CVME_IO;
}
owner = pw->pw_uid;
group = pw->pw_gid;
}
}
if ((tmp = getenv("CVM_SOCKET_GROUP")) != 0) {
group = strtoul(tmp, &end, 10);
if (*end != 0) {
if ((gr = getgrnam(tmp)) == 0) {
error1sys("getgrnam failed");
return CVME_IO;
}
group = gr->gr_gid;
}
}
old_umask = umask((mode & 0777) ^ 0777);
if ((sock = socket_unixstr()) == -1)
error1sys("Could not create socket");
else if (!socket_bindu(sock, path))
error1sys("Could not bind socket");
else if (chmod(path, mode) == -1)
error1sys("Could not change socket permission");
else if (chown(path, owner, group) == -1)
error1sys("Could not change socket ownership");
else if (!socket_listen(sock, 1))
error1sys("Could not listen on socket");
else {
umask(old_umask);
return 0;
}
return CVME_IO;
}
extern void usage(void);
int local_main(const char* p)
{
int code;
const char* e;
path = p;
signal(SIGPIPE, SIG_IGN);
signal(SIGINT, exitfn);
signal(SIGTERM, exitfn);
if ((e = getenv("CVM_LOCAL_TIMEOUT")) == 0
|| (timeout = strtoul(e, (char**)&e, 10)) == 0
|| *e != 0)
timeout = DEFAULT_TIMEOUT;
if ((code = make_socket()) != 0) return code;
if ((code = cvm_module_init()) != 0) return code;
cvm_module_log_startup();
code = 0;
do {
if ((code = read_input()) != 0) continue;
code = cvm_module_handle_request();
cvm_module_fact_end(code & CVME_MASK);
cvm_module_log_request();
write_output();
} while ((code & CVME_FATAL) == 0);
cvm_module_stop();
return 0;
}
cvm-0.97/random.c 0000644 0000764 0000764 00000002670 12463157763 013250 0 ustar bruce guenter /* cvm/random.c - CVM random number generation
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Derived from dns_random.c from djbdns-1.05, which was made public
* domain as per http://cr.yp.to/distributors.html on 2007-12-28. */
#include
#include
#include
#include
#include
#include "random.h"
static struct surfrand state;
void cvm_random_init(void)
{
struct timeval tv;
uint32 data[32];
gettimeofday(&tv, 0);
data[0] += tv.tv_sec;
data[1] += tv.tv_usec;
data[2] = getpid();
data[3] = getppid();
surfrand_init(&state, data, 32);
}
void cvm_random_fill(unsigned char* buf, unsigned len)
{
surfrand_fill(&state, buf, len);
}
cvm-0.97/cvm-pgsql.html 0000644 0000764 0000764 00000002262 12463157763 014420 0 ustar bruce guenter
The cvm-pgsql Module
Synopsis:
PgSQL module
Credentials:
- Pass phrase
Description:
This module queries a PgSQL database for the account name, compares
the stored pass phrase with the given one using crypt.
Configuration Variables:
The server hostname, port, database, username, password, and
additional options can be controlled by setting $PGHOST,
$PGPORT, $PGDATABASE, $PGUSER,
$PGPASSWORD, and $PGOPTIONS respectively, which are
parsed by the PgSQL client library.
- $CVM_MYSQL_POSTQ (optional)
- The SQL query to execute after the credentials have been
validated.
- $CVM_PGSQL_PWCMP (optional)
- The password comparison module to use.
- $CVM_PGSQL_QUERY (optional)
- The SQL query to issue to retrieve the row containing
the account information from the database.
cvm-0.97/client_xfer_compat.c 0000644 0000764 0000764 00000004074 12463157763 015635 0 ustar bruce guenter /* cvm/client_xfer_compat.c - CVM client command transmission wrappers
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include "v1client.h"
static unsigned wrapper(const char* module,
unsigned char buffer[CVM_BUFSIZE],
unsigned* buflen,
unsigned (*fn)(const char* module,
const struct cvm_packet* request,
struct cvm_packet* response))
{
struct cvm_packet request;
struct cvm_packet response;
unsigned result;
memcpy(request.data, buffer, sizeof buffer);
request.length = *buflen;
result = fn(module, &request, &response);
memcpy(buffer, response.data, sizeof buffer);
*buflen = response.length;
return result;
}
unsigned cvm_xfer_command(const char* module,
unsigned char buffer[CVM_BUFSIZE],
unsigned* buflen)
{
return wrapper(module, buffer, buflen, cvm_xfer_command_packets);
}
unsigned cvm_xfer_local(const char* module,
unsigned char buffer[CVM_BUFSIZE],
unsigned* buflen)
{
return wrapper(module, buffer, buflen, cvm_xfer_local_packets);
}
unsigned cvm_xfer_udp(const char* module,
unsigned char buffer[CVM_BUFSIZE],
unsigned* buflen)
{
return wrapper(module, buffer, buflen, cvm_xfer_udp_packets);
}
cvm-0.97/sasl_start.c 0000644 0000764 0000764 00000000671 12463157763 014146 0 ustar bruce guenter #include
#include "sasl.h"
#include "sasl_internal.h"
int sasl_start(struct sasl_state* ss,
const char* mechanism, const str* initresponse, str* challenge)
{
const struct sasl_mechanism* mech;
for (mech = sasl_mechanisms; mech != 0; mech = mech->next) {
if (strcasecmp(mechanism, mech->name) == 0) {
ss->mech = mech;
return mech->start(ss, initresponse, challenge);
}
}
return SASL_NO_MECH;
}
cvm-0.97/cvm-mysql.html 0000644 0000764 0000764 00000003615 12463157763 014442 0 ustar bruce guenter
The cvm-mysql Module
Synopsis:
MySQL module
Credentials:
- Pass phrase
Description:
This module queries a MySQL database for the account name, compares
the stored pass phrase with the given one using crypt.
Configuration Variables:
- $CVM_MYSQL_DEFAULT_FILE
- The full path of the
defaults file to read if the following variable is set. If not set, the
file $HOME/.my.cnf will be read (the MySQL default).
- $CVM_MYSQL_DEFAULT_GROUP
- If set, the module will
read connection default options from the named group in the defaults
file as above.
- $CVM_MYSQL_HOST
- The hostname or IP of the MySQL
server. If not set, a connection to the local host is assumed.
- $CVM_MYSQL_USER
- The MySQL login ID to connect as.
If not set, the invoking user is assumed.
- $CVM_MYSQL_PASS
- The password for the above
user.
- $CVM_MYSQL_DB
- The database name, must be set.
- $CVM_MYSQL_PORT
- The port number for the TCP/IP
connection (only used if the server is not local).
- $CVM_MYSQL_POSTQ (optional)
- The SQL query to execute after the credentials have been
validated.
- $CVM_MYSQL_PWCMP (optional)
- The password comparison module to use.
- $CVM_MYSQL_SOCKET
- The path to the socket that
should be used for connections to a local server.
- $CVM_MYSQL_QUERY (optional)
- The SQL query to issue to retrieve the row containing
the account information from the database.
cvm-0.97/vmautoconvert.c 0000644 0000764 0000764 00000006516 12463157763 014707 0 ustar bruce guenter /* vmautoconvert.c - Automatically convert passwords for vmailmgr.
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "module.h"
#include "qmail.h"
#include "cvm-vmailmgr.h"
static int read_start(ibuf* in, uint32* end)
{
unsigned char buf[2048];
if (!ibuf_read(in, (char*)buf, sizeof buf))
return 0;
*end = uint32_get_lsb(buf);
return 1;
}
static int read_cdb_pair(ibuf* in, str* key, str* data)
{
unsigned char buf[8];
uint32 keylen;
uint32 datalen;
if (!ibuf_read(in, (char*)buf, sizeof buf))
return 0;
keylen = uint32_get_lsb(buf);
datalen = uint32_get_lsb(buf+4);
if (!str_ready(key, keylen)
|| !str_ready(data, datalen)
|| !ibuf_read(in, key->s, keylen)
|| !ibuf_read(in, data->s, datalen))
return 0;
key->s[key->len = keylen] = 0;
data->s[data->len = datalen] = 0;
return 1;
}
static str tmppwfile;
static str key;
static str data;
static int convert_data(void)
{
struct vpwentry vpw;
int status = 1;
memset(&vpw, 0, sizeof vpw);
if (!vpwentry_import(&vpw, &virtuser, &data))
return 0;
status = str_copyb(&vpw.pass, "$0$", 3)
&& str_cat(&vpw.pass, &cvm_module_credentials[CVM_CRED_PASSWORD])
&& vpwentry_export(&vpw, &data);
vpwentry_free(&vpw);
return status;
}
int vmailmgr_autoconvert(void)
{
int writefd = -1;
ibuf reader;
struct cdb_make writer;
int error = 0;
int readall = 0;
int writerr = 0;
if ((writefd = path_mktemp(pwfile, &tmppwfile)) != -1) {
if (cdb_make_start(&writer, writefd) != 0)
error = CVME_IO | CVME_FATAL;
else {
if (ibuf_open(&reader, pwfile, 0)) {
uint32 end;
struct stat st;
if (fstat(reader.io.fd, &st) == 0
&& fchmod(writefd, st.st_mode) == 0
&& fchown(writefd, st.st_uid, st.st_gid) == 0
&& read_start(&reader, &end)) {
while (ibuf_tell(&reader) < end) {
if (!read_cdb_pair(&reader, &key, &data))
break;
if (str_diff(&key, &virtuser) == 0)
if (!convert_data()) {
writerr = 1;
break;
}
if (cdb_make_add(&writer, key.s, key.len, data.s, data.len) != 0) {
writerr = 1;
break;
}
}
readall = ibuf_tell(&reader) == end;
}
ibuf_close(&reader);
}
if (cdb_make_finish(&writer) != 0)
error |= CVME_FATAL;
else
if (readall && !writerr)
rename(tmppwfile.s, pwfile);
}
close(writefd);
unlink(tmppwfile.s);
}
return error;
}
cvm-0.97/cvm-v1testclient.c 0000644 0000764 0000764 00000004653 12463157763 015203 0 ustar bruce guenter /* cvm/cvm-v1testclient.c - Diagnostic CVM client
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include "v1client.h"
const char program[] = "cvm-v1testclient";
const int msg_show_pid = 0;
static void s(const char* name, const char* value)
{
obuf_puts(&outbuf, name);
obuf_puts(&outbuf, (value == 0) ? "(null)" : value);
obuf_putc(&outbuf, '\n');
}
static void u(const char* name, unsigned long value)
{
obuf_puts(&outbuf, name);
obuf_putu(&outbuf, value);
obuf_putc(&outbuf, '\n');
}
int main(int argc, char** argv)
{
int i;
unsigned long v;
char num[FMT_ULONG_LEN];
if (argc < 4)
die1(1, "Incorrect usage.\n"
"usage: cvm-testclient cvmodule account domain [credential [credential ...]]\n");
i = cvm_client_authenticate(argv[1], argv[2], argv[3], (const char**)(argv+4), 0);
if (i) {
num[fmt_udec(num, i)] = 0;
die5(i, "Authentication failed, error #", num, " (",
(i < cvm_nerr) ? cvm_errlist[i] : "Unknown error code", ")");
}
s("user name: ", cvm_fact_username);
u("user ID: ", cvm_fact_userid);
u("group ID: ", cvm_fact_groupid);
s("real name: ", cvm_fact_realname);
s("directory: ", cvm_fact_directory);
s("shell: ", cvm_fact_shell);
s("group name: ", cvm_fact_groupname);
s("system user name: ", cvm_fact_sys_username);
s("system directory: ", cvm_fact_sys_directory);
s("domain: ", cvm_fact_domain);
s("mailbox path: ", cvm_fact_mailbox);
while (cvm_client_fact_uint(CVM_FACT_SUPP_GROUPID, &v) == 0)
u("supp. group ID: ", v);
obuf_flush(&outbuf);
return 0;
}
cvm-0.97/qmail-users.c 0000644 0000764 0000764 00000011716 12463157763 014233 0 ustar bruce guenter /* qmail-users.c - qmail users/cdb lookup routines
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "qmail.h"
static str users_path;
static int users_fd = -1;
static struct cdb users_cdb;
static struct stat users_stat;
int qmail_users_reinit(void)
{
struct stat s;
/* If we can see the users CDB file... */
if (stat(users_path.s, &s) != -1) {
/* If it was either not open or has changed since the last open... */
if (users_fd == -1 ||
s.st_ino != users_stat.st_ino ||
s.st_mtime != users_stat.st_mtime ||
s.st_size != users_stat.st_size) {
/* If it was previously open, close it */
if (users_fd != -1) {
close(users_fd);
cdb_free(&users_cdb);
}
/* And re-open it */
if ((users_fd = open(users_path.s, O_RDONLY)) != -1) {
fstat(users_fd, &users_stat);
cdb_init(&users_cdb, users_fd);
}
}
}
else if (users_fd != -1) {
close(users_fd);
cdb_free(&users_cdb);
users_fd = -1;
}
return 0;
}
int qmail_users_init(void)
{
if (!str_copy2s(&users_path, qmail_root, "/users/cdb"))
return -1;
return qmail_users_reinit();
}
static int lookup_userscdb(struct qmail_user* u,
str* name, char dash)
{
char* ptr;
const char* end;
const char* user;
const char* home;
int i;
if (!str_spliceb(name, 0, 0, "!", 1)
|| (name->len > 1 && !str_catc(name, dash))) {
errno = ENOMEM;
return -1;
}
if ((i = cdb_get(&users_cdb, name, name)) <= 0)
return i;
/* name now contains:
* user NUL uid NUL gid NUL home NUL dash NUL ext
*/
errno = EDOM;
ptr = name->s;
end = name->s + name->len;
user = ptr;
if ((ptr += strlen(ptr) + 1) >= end) return -1;
u->uid = strtoul(ptr, &ptr, 10);
if (*ptr++ != 0 || ptr >= end) return -1;
u->gid = strtoul(ptr, &ptr, 10);
if (*ptr++ != 0 || ptr >= end) return -1;
home = ptr;
if ((ptr += strlen(ptr) + 1) >= end) return -1;
if ((u->dash = *ptr) != 0) ++ptr;
if (*ptr++ != 0 || ptr > end) return -1;
if (!str_copys(&u->user, user)
|| !str_copys(&u->homedir, home)
|| !str_copyb(&u->ext, ptr, end-ptr)) {
errno = ENOMEM;
return -1;
}
return 1;
}
static int lookup_passwd(struct qmail_user* u, const str* namestr, char dash)
{
const struct passwd* pw;
const char* name;
if (*(name = namestr->s) == 0)
name = "alias";
if ((pw = getpwnam(name)) == 0)
return (errno == ETXTBSY) ? -1 : 0;
if (!str_copys(&u->user, pw->pw_name)
|| !str_copys(&u->homedir, pw->pw_dir)
|| !str_copys(&u->ext, "")) {
errno = ENOMEM;
return -1;
}
u->uid = pw->pw_uid;
u->gid = pw->pw_gid;
u->dash = dash;
return 1;
}
int qmail_users_lookup(struct qmail_user* u, const char* name, char dash)
{
static str lname;
if (!str_copys(&lname, name)){
errno = ENOMEM;
return -1;
}
str_lower(&lname);
if (users_fd != -1) {
switch (lookup_userscdb(u, &lname, dash)) {
case -1: return -1;
case 0: break;
default: return 1;
}
if (!str_copys(&lname, name)){
errno = ENOMEM;
return -1;
}
}
return lookup_passwd(u, &lname, dash);
}
int qmail_users_lookup_split(struct qmail_user* u, const char* name,
str* local, str* ext)
{
static str account;
int i;
/* Check if the name is a base UNIX user. */
if (!str_copys(local, name)) return -1;
if (!str_copys(ext, "")) return -1;
switch (qmail_users_lookup(u, name, 0)) {
case -1: return -1;
case 0: break;
default: return 1;
}
/* Now, look for increasingly shorter base-ext pairs */
if (!str_copy(&account, local)) return -1;
i = account.len;
while (i > 0 && (i = str_findprev(&account, '-', i-1)) != -1) {
if (!str_copyb(local, account.s, i)) return -1;
if (!str_copyb(ext, account.s+i+1, account.len-i-1)) return -1;
switch (qmail_users_lookup(u, local->s, '-')) {
case -1: return -1;
case 0: continue;
default: return 1;
}
}
switch (qmail_users_lookup(u, "", '-')) {
case -1: return -1;
case 0: return 0;
}
str_copyb(local, "", 0);
if (!str_copy(ext, &account)) return -1;
return 1;
}
cvm-0.97/cvm-qmail.html 0000644 0000764 0000764 00000006242 12463157763 014377 0 ustar bruce guenter
The cvm-qmail Module
Synopsis:
qmail configuration lookup module
Credentials:
None, only operates as a lookup module.
Description:
This module uses the standard qmail configuration files to determine
if an address is valid, using the same lookups that qmail would. It
first checks control/locals and then
control/virtualdomains to determine if the domain is valid, and
to determine the prefix to add to virtual domain usernames. If the
domain is not found, it fails with OUTOFSCOPE
set to true. It then looks up the resulting username
in users/cdb (or the system password table if the CDB does not
exist) to determine the correct home directory. If the address would
require a .qmail-something file, it ensures that that file
exists as well, doing -default checks as necessary. If the
address is not deliverable based on these checks, it fails
with OUTOFSCOPE set to false.
Configuration Variables:
- $CVM_QMAIL_ASSUME_LOCAL (optional)
- If set, all
domains not found in control/virtualdomains are assumed to be
local domains.
- $CVM_QMAIL_CHECK_PERMS (optional)
- If set, the CVM
will check that the .qmail file is accessible by temporarily
switching to the target user ID. If $CVM_QMAIL_CHECK_PERMS
starts with a "-" and the lookup fails because access was
denied, then the lookup is rejected with a permanent error, otherwise a
temporary I/O error is returned.
- $CVM_QMAIL_LOOKASIDE (optional)
- This variable
contains a list of program names, separated by spaces. If one of these
program names is found as a program delivery in the .qmail
file, cvm-qmail will fail the lookup with
OUTOFSCOPE set to true. This is useful for
chaining lookups to cvm-vmailmgr or
other modules that correspond to programs that are executed
from .qmail-default files.
- $CVM_QMAIL_MISSINGDOMAIN (optional)
- If this is set
and the domain name is not a local or virtual qmail domain, this domain
name is substituted and the lookup succeeds. This allows for setups
where domains listed in control/rcpthosts and
control/morercpthosts.cdb (which are accepted by the SMTP
receiver) are not listed as local or virtual domains. If this is set to
an empty value, "localhost" is substituted. This has no effect
if $CVM_QMAIL_ASSUME_LOCAL is set.
- $CVM_QMAIL_MISSINGUSER (optional)
- When missing
domain substitution is being done, the value of this variable is used to
replace the username. The value must exist as a valid system user.
Defaults to "alias" which will normally exist on all qmail
systems.
- $QMAIL_ROOT (optional)
- The root directory under
which all the qmail configuration files are expected to be found.
Defaults to "/var/qmail", which is the normal qmail install
path.
cvm-0.97/conf-bin 0000644 0000764 0000764 00000000076 12463157763 013240 0 ustar bruce guenter /usr/local/bin
Programs will be installed in this directory.
cvm-0.97/cvm.html 0000644 0000764 0000764 00000007663 12463157763 013306 0 ustar bruce guenter
CVM: Credential Validation Module
CVM Protocol Version 1 Description
CVM Protocol Version 2 Description
CVM Credential Definitions
CVM Fact Definitions
CVM Version 1 Client Library
CVM Version 2 Client Library
CVM Module Library
CVM SASL Library
CVM Error Values
CVM Design Rationale
The cvm-checkpassword Program
The cvm-testclient Program
The cvm-benchclient Program
The cvm-unix Module
The cvm-pwfile Module
The cvm-vmailmgr Module
The cvm-qmail Module
The cvm-mysql Module
The cvm-pgsql Module
The cvm-chain Module
CVM is a framework for validating a set of credentials against a
database using a filter program. The modules act as a filter, taking
a set of credentials as input and writing a set of facts as output if
those credentials are valid. Optional input is given to the module
through environment variables.
Some of the ideas for CVM came from experience with PAM (pluggable
authentication modules), the checkpassword interface used
by qmail-pop3d, and the "authmod" interface used by Courier
IMAP and POP3. This framework places fewer restrictions on the
invoking client than checkpassword does, and is much simpler to
implement on both sides than PAM and the authmod framework.
Contact Modes
CVM modules may be contacted by one of three modes:
- Command execution: Use a module name of
cvm-command:/path/to/command. The cvm-command:
prefix is optional.
- UNIX (or local) domain socket: Use a module name of
cvm-local:/path/to/socket.
- UDP: Use a module name of cvm-udp:hostname:port.
Modules may be chained in the client. To do so, specify the list of
modules separated by a comma. For example:
cvm-local:/path/to/socket,cvm-command:/path/to/module
The first module to either report success, a temporary failure, or
permanent failure with an in-scope result terminates the chain.
Module Invocation
CVM modules are invoked using a similar syntax to the above:
- UNIX (or local) domain server: Use a command-line argument of
cvm-local:/path/to/socket. If $CVM_SOCKET_MODE is
set, the created socket will have this mode (in octal, defaults to
777). If $CVM_SOCKET_OWNER or
$CVM_SOCKET_GROUP are set, the created socket will have its
UID/GID set appropriately. The module will wait a maximum of 1000ms for
complete input to be received from the client or to completely send the
response. This value may be overridden by $CVM_IO_TIMEOUT.
- UDP socket server: Use a command-line argument of
cvm-udp:hostname:port. The hostname argument
specifies the IP to bind the socket to. Normally this will be
0 to bind to all IPs.
If $CVM_LOOKUP_SECRET is set, the module operates in "lookup
mode". In this mode, the authentication function provided by the module
will not be called. Instead, the module library will handle
authentication internally, before the lookup happens. If the
secret is empty, the module will expect no credentials to be passed to
the module, otherwise one must be passed and it must match the
secret.
cvm-0.97/sasl.html 0000644 0000764 0000764 00000002114 12463157763 013445 0 ustar bruce guenter
cvm-sasl
Overview
cvm-sasl is a library for programs that need to do authentication
via SASL (RFC 2222). It provides a generic interface for doing the
authentication using CV modules.
Configuration
To configuration an application that uses cvm-sasl, set one or more
of the following environment variables to the name of a CVM that can
accept the indicated type of credentials:
Name | SASL Mechanism | CVM Credentials |
CVM_SASL_CRAM_MD5 | CRAM-MD5 (RFC 2195) | 2:
Challenge, Response |
CVM_SASL_LOGIN | LOGIN | 1: Plain text
password |
CVM_SASL_PLAIN | PLAIN (RFC 2595) and LOGIN |
1: Plain text password |
Note: as of this writing, there are no CRAM-MD5 CVMs, so that
functionality is completely untested. If $CVM_SASL_LOGIN is
set, it is overrides $CVM_SASL_PLAIN for LOGIN
authenticaiton.
cvm-0.97/sql-auth.c 0000644 0000764 0000764 00000005661 12463157763 013531 0 ustar bruce guenter /* cvm/sql-auth.c - Generic SQL authentication layer
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include "module.h"
#include "sql.h"
static const char* query;
static const char* postq;
int cvm_module_init(void)
{
int result;
if ((query = getenv(sql_query_var)) == 0) return CVME_CONFIG;
if (!sql_query_validate(query)) return CVME_CONFIG;
if ((postq = getenv(sql_postq_var)) != 0)
if (!sql_query_validate(postq)) return CVME_CONFIG;
if ((result = sql_auth_init()) != 0) return result;
if (!pwcmp_start(getenv(sql_pwcmp_var))) return CVME_GENERAL;
return 0;
}
static str q;
int cvm_module_lookup(void)
{
int i;
/* Query the database based on the custom query */
if (!sql_query_build(query, &q)) return CVME_GENERAL | CVME_FATAL;
if ((i = sql_auth_query(&q)) < 0) return -i;
/* If the result didn't produce a single row, fail the username */
return (i == 1) ? 0 : CVME_PERMFAIL;
}
int cvm_module_authenticate(void)
{
const char* cpw;
CVM_CRED_REQUIRED(PASSWORD);
/* If there is no password field, fail the password */
cpw = sql_get_field(0);
if (cpw == 0 || cpw[0] == 0) return CVME_PERMFAIL;
/* Finally, if the stored pass is not the same, fail the pass */
switch (pwcmp_check(cvm_module_credentials[CVM_CRED_PASSWORD].s, cpw)) {
case 0: return 0;
case -1: return CVME_IO | CVME_FATAL;
default: return CVME_PERMFAIL;
}
}
int cvm_module_results(void)
{
int i;
if (postq) {
if (!sql_query_build(postq, &q)) return CVME_GENERAL | CVME_FATAL;
if ((i = sql_post_query(&q)) != 0) return i;
}
/* Credentials accepted */
cvm_fact_username = sql_get_field(1);
cvm_fact_userid = strtol(sql_get_field(2), 0, 10);
cvm_fact_groupid = strtol(sql_get_field(3), 0, 10);
cvm_fact_directory = sql_get_field(4);
cvm_fact_realname = sql_get_field(5);
cvm_fact_shell = sql_get_field(6);
cvm_fact_groupname = sql_get_field(7);
cvm_fact_domain = sql_get_field(8);
cvm_fact_sys_username = sql_get_field(9);
cvm_fact_sys_directory = sql_get_field(10);
cvm_fact_mailbox = sql_get_field(11);
return 0;
}
void cvm_module_stop(void)
{
pwcmp_stop();
sql_auth_stop();
}
cvm-0.97/cvm-chain.c 0000644 0000764 0000764 00000003455 12463157763 013637 0 ustar bruce guenter #include
#include
#include
#include
#include
#include "module.h"
#include "v2client.h"
const char program[] = "cvm-chain";
const char* chains[10];
int chain_count;
static void cvm_chain_init()
{
cvm_fact_username = 0;
cvm_fact_userid = -1;
cvm_fact_groupid = -1;
cvm_fact_directory = 0;
cvm_fact_shell = 0;
cvm_fact_realname = 0;
cvm_fact_groupname = 0;
cvm_fact_sys_username = 0;
cvm_fact_sys_directory = 0;
cvm_fact_domain = 0;
cvm_fact_mailbox = 0;
}
int cvm_module_init(void)
{
int i;
char varname[] = "CVM_CHAIN#";
chain_count = 0;
for (i = 0; i <= 9; ++i) {
varname[9] = i + '0';
if ((chains[chain_count] = getenv(varname)) != 0)
++chain_count;
}
if (chain_count == 0)
return CVME_CONFIG | CVME_FATAL;
cvm_chain_init();
return 0;
}
int cvm_module_lookup(void)
{
int i;
int credcount;
int code;
unsigned long outofscope = 1;
int saw_outofscope = 0;
struct cvm_credential creds[CVM_CRED_MAX+1];
for (i = credcount = 0; i <= CVM_CRED_MAX; ++i) {
if (cvm_module_credentials[i].len > 0) {
creds[credcount].type = i;
creds[credcount].value = cvm_module_credentials[i];
++credcount;
}
}
for (code = i = 0; i < chain_count && ((code & CVME_FATAL) == 0); i++) {
cvm_chain_init();
code = cvm_client_authenticate(chains[i], credcount, creds);
if (code != CVME_PERMFAIL)
return code;
if (outofscope
&& cvm_client_fact_uint(CVM_FACT_OUTOFSCOPE, &outofscope) == 0)
saw_outofscope = 1;
}
if (saw_outofscope)
cvm_module_fact_uint(CVM_FACT_OUTOFSCOPE, outofscope);
return code;
}
int cvm_module_authenticate(void)
{
return 0;
}
int cvm_module_results(void)
{
cvm_client_setenv();
return 0;
}
void cvm_module_stop(void)
{
}
cvm-0.97/sasl_login.c 0000644 0000764 0000764 00000001670 12463157763 014121 0 ustar bruce guenter #include "sasl.h"
#include "sasl_internal.h"
static const char cusername[] = "Username:";
static const char cpassword[] = "Password:";
static int response2(struct sasl_state* ss,
const str* response, str* challenge)
{
if (response->len == 0)
return SASL_RESP_BAD;
return sasl_authenticate_plain(ss, ss->username.s, response->s);
(void)challenge;
}
static int response1(struct sasl_state* ss,
const str* response, str* challenge)
{
if (response->len == 0)
return SASL_RESP_BAD;
if (!str_copy(&ss->username, response) ||
!str_copys(challenge, cpassword))
return SASL_TEMP_FAIL;
ss->response = response2;
return SASL_CHALLENGE;
}
int sasl_login_start(struct sasl_state* ss,
const str* response, str* challenge)
{
if (response)
return response1(ss, response, challenge);
if (!str_copys(challenge, cusername))
return SASL_TEMP_FAIL;
ss->response = response1;
return SASL_CHALLENGE;
}
cvm-0.97/module_local_main.c 0000644 0000764 0000764 00000002306 12463157763 015427 0 ustar bruce guenter /* cvm/module_local_main.c - Local CVM server module main routine
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include "module.h"
const int msg_show_pid = 0;
void usage(void)
{
die3(1, "usage: ", program, "-local /PATH/TO/SOCKET");
}
extern int local_main(const char*);
int main(int argc, char** argv)
{
if (argc != 2) usage();
cvm_module_init_request();
return local_main(argv[1]);
}
cvm-0.97/client_xfer_local.c 0000644 0000764 0000764 00000003577 12463157763 015453 0 ustar bruce guenter /* cvm/client_xfer_local.c - CVM client local transmission library
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include "v1client.h"
#include "protocol.h"
/* UNIX local-domain socket module invocation ********************************/
unsigned cvm_xfer_local_packets(const char* path,
const struct cvm_packet* request,
struct cvm_packet* response)
{
int sock;
int result;
unsigned io;
unsigned done;
unsigned len;
result = CVME_IO;
response->length = 0;
if ((sock = socket_unixstr()) != -1 &&
socket_connectu(sock, path)) {
for (done = 0, len = request->length; done < len; done += io) {
if ((io = write(sock, request->data+done, len-done)) == 0) break;
if (io == (unsigned)-1) break;
}
socket_shutdown(sock, 0, 1);
if (done >= len) {
for (done = 0; done < CVM_BUFSIZE; done += io) {
if ((io = read(sock, response->data+done, CVM_BUFSIZE-done)) == 0)
break;
if (io == (unsigned)-1) done = CVM_BUFSIZE+1;
}
if (done <= CVM_BUFSIZE) {
response->length = done;
result = 0;
}
}
}
close(sock);
return result;
}
cvm-0.97/ANNOUNCEMENT 0000644 0000764 0000764 00000005633 12463157763 013443 0 ustar bruce guenter Version 0.97 of cvm is now available at:
http://untroubled.org/cvm/
------------------------------------------------------------------------------
Changes in version 0.97
- Updated for bglibs v2
Development of this version has been sponsored by FutureQuest, Inc.
ossi@FutureQuest.net http://www.FutureQuest.net/
-------------------------------------------------------------------------------
cvm
Credential Validation Modules
Bruce Guenter
Version 0.97
2015-01-31
This package contains:
- The reference source for the CVM interface.
- Diagnostic and benchmark CVM clients.
- A checkpassword interface CVM client.
- A UNIX/POSIX system module (uses getpwnam).
- A flat-file module.
- A vmailmgr module.
- MySQL, PgSQL, and SQLite modules.
- A library for client writers.
- A set of libraries for module writers.
A mailing list has been set up to discuss this and other packages.
To subscribe, send an email to:
bgware-subscribe@lists.untroubled.org
A mailing list archive is available at:
http://lists.untroubled.org/?list=bgware
Development versions of cvm are available at:
https://github.com/bruceg/cvm
Requirements:
- bglibs library package version 1.103 or later.
- The vmailmgr modules should work with all versions of vmailmgr that
use CDB password tables, introduced in vmailmgr version 0.89 (only
tested with version 0.96.9)
- libtool
Installation:
- Make sure the latest version of bglibs from
http://untroubled.org/bglibs/ is compiled and installed.
- Build the sources by running "make"
- After the package has been compiled, run the following commands as root:
make install
If you want to install in a different directory, run:
make install install_prefix=/prefix
vmailmgr Configuration:
- If your virtual domain password tables are stored in a file other than
passwd.cdb, set $VMAILMGR_PWFILE to that file name.
- Set $QMAIL_ROOT to the base qmail directory (defaults to "/var/qmail").
- Set $VMAILMGR_DEFAULT to the vmailmgr default username (defaults to "+").
- Set $DEBUG (to anything) to see debugging output.
- See http://untroubled.org/cvm/cvm.html for information on running
local or UDP server modules.
Development of this version has been sponsored by FutureQuest, Inc.
ossi@FutureQuest.net http://www.FutureQuest.net/
This program is Copyright(C) 2015 Bruce Guenter, and may be copied
according to the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 or a later
version. A copy of this license is included with this package. This
package comes with no warranty of any kind.
The cvm-vmailmgr project was initiated at FutureQuest, Inc. We are
releasing it as an open-source project because we felt it would be
useful to others, as well as to repay our debt of gratitude to the
larger open-source community for the excellent packages we have enjoyed.
For more details, you may contact FutureQuest, Inc. at:
FutureQuest, Inc.
PO BOX 623127
Oviedo FL 32762-3127 USA
http://www.FutureQuest.net/
cvm-0.97/protocol-1.html 0000644 0000764 0000764 00000005377 12463157763 014520 0 ustar bruce guenter
CVM Version 1 Protocol
Input
Input to the authenticator is as follows. All items except the
first, which is a single byte, are NUL-terminated strings. The total
length of the input must not exceed 512 bytes.
- Protocol number, 1.
- Account name base (ie user name).
- Account domain name.
- List of credentials.
- An empty string (ie a single NUL byte).
The credentials consist of one of the following:
- For plain login, the password.
- For APOP, the timestamp and MD5 digest.
- For CRAM-MD5 keyed hashing, as specified in RFC 2095, the
challenge and MD5 digest.
Output
If authentication succeeds, the output from the module is a single
byte success code followed by a list of facts
about the authenticator. The total size of the output must not exceed
512 bytes.
If authentication succeeded, the code byte will be 0. If the
credentials are accepted by this module, but are not valid, the code
will be 100 (permanent failure). Any other code indicates a temporary
error.
Each fact consists of a single byte identifying what type of fact
is being reported, followed by a sequence of zero or more non-NUL
bytes, terminated by a single NUL byte. A second NUL byte follows the
last fact and indicates the end of the list.
Environment Variables
The following environment variables may be set by the invoker:
- SERVICE
- The service name, to be used (for example) by
PAM modules to determine which configuration file to load.
Note: for non-command modules, the invoker is NOT the CVM
client. The CVM client has no control over the environment variables
of non-command modules.
Implementation Considerations
The module must report a temporary error if it detects malformed
input (incorrect credentials, etc.). Extra data following the final
NUL byte in the credentials is a fault in the invoking code, and must
be rejected by the module. Similarly, extra data following the final
NUL byte in the facts is a fault in the module code.
All data following an unsuccessful result status code must be
ignored by the invoking code. Modules should not produce any facts
when validation fails.
An executable module must exit 0 if authentication succeeds.
Non-zero exit codes from an executable module should be treated as a
temporary error.
The invoker of an executable module must assume a temporary error
if the module either fails to completely read its input or produces
incomplete output, even if the module exits without error.
cvm-0.97/errors.h 0000644 0000764 0000764 00000000744 12463157763 013311 0 ustar bruce guenter #ifndef CVM__ERRORS__H__
#define CVM__ERRORS__H__
#define CVME_GENERAL 1
#define CVME_BAD_CLIDATA 2
#define CVME_BAD_MODDATA 3
#define CVME_IO 4
#define CVME_NOFACT 5
#define CVME_CONFIG 6
#define CVME_NOCRED 7
#define CVME_PERMFAIL 100
/* This error code is only used by modules, to signal that the error
is fatal and should cause module shutdown. */
#define CVME_FATAL 0x100
#define CVME_MASK 0x0ff
extern const char* const cvm_errlist[];
extern const int cvm_nerr;
#endif
cvm-0.97/vmlookup.c 0000644 0000764 0000764 00000006555 12463157763 013652 0 ustar bruce guenter /* vmlookup.c - vmailmgr CVM lookup routines
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "module.h"
#include "qmail.h"
#include "cvm-vmailmgr.h"
static str account;
static str baseuser;
/* Results from looking up the user */
struct qmail_user vmuser;
int lookup_reinit(void)
{
return 0;
}
int lookup_init(void)
{
if (!str_truncate(&account, 0) ||
!str_truncate(&domain, 0) ||
!str_truncate(&baseuser, 0) ||
!str_truncate(&virtuser, 0))
return CVME_GENERAL;
if (qmail_lookup_init() != 0)
return CVME_IO;
return 0;
}
int lookup_virtuser(void)
{
int err;
int fd;
struct cdb cdb;
DEBUG("cvm domain = '", cvm_module_credentials[CVM_CRED_DOMAIN].s, "'");
switch (qmail_lookup_cvm(&vmuser, &domain, &baseuser, &virtuser)) {
case -1:
return CVME_IO;
case 0:
break;
default:
/* Either the domain was not found, or it was found pointing to a
* nonexistant user. In either case, there is no vmailmgr table to
* look up. */
cvm_module_fact_uint(CVM_FACT_OUTOFSCOPE, 1);
return CVME_PERMFAIL;
}
if (virtuser.len == 0) {
cvm_module_fact_uint(CVM_FACT_OUTOFSCOPE, 1);
return CVME_PERMFAIL;
}
memset(&cdb, 0, sizeof cdb);
str_lower(&virtuser);
/* Found a virtual user, authenticate it. */
if (chdir(vmuser.homedir.s) == -1) return CVME_IO;
if ((fd = open(pwfile, O_RDONLY)) == -1) {
if (errno == ENOENT) {
cvm_module_fact_uint(CVM_FACT_OUTOFSCOPE, 1);
return CVME_PERMFAIL;
}
return CVME_IO;
}
cdb_init(&cdb, fd);
switch (cdb_get(&cdb, &virtuser, &vpwdata)) {
case -1:
DEBUG("cdb_get returned error", 0, 0);
err = CVME_IO;
break;
case 0:
DEBUG("cdb_get failed", 0, 0);
/* Only handle the default user when in lookup mode, as
authenticating the default user shouldn't happen. */
if (cvm_module_lookup_secret != 0) {
switch (cdb_get(&cdb, &default_user, &vpwdata)) {
case -1:
DEBUG("cdb_get returned error", 0, 0);
err = CVME_IO;
break;
case 0:
DEBUG("cdb_get failed", 0, 0);
err = CVME_PERMFAIL;
break;
default:
err = 0;
}
}
else
err = CVME_PERMFAIL;
break;
default:
err = 0;
}
cdb_free(&cdb);
close(fd);
if (err == CVME_PERMFAIL)
cvm_module_fact_uint(CVM_FACT_OUTOFSCOPE, 0);
return err;
}
cvm-0.97/qmail-dotfile.c 0000644 0000764 0000764 00000003623 12463157763 014516 0 ustar bruce guenter /* qmail-dotfile.c - qmail dotfile ($HOME/.qmail*) lookup routines
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include "qmail.h"
int qmail_dotfile_exists(const struct qmail_user* user, const char* ext,
str* path)
{
struct stat st;
int split;
int baselen;
/* System users are not required to have a .qmail file */
if (user->dash == 0)
return ext == 0 || *ext == 0;
if (!str_copy(path, &user->homedir)) return -1;
if (!str_cats(path, "/.qmail")) return -1;
baselen = path->len;
if (!str_catc(path, user->dash)) return -1;
if (!str_cat(path, &user->ext)) return -1;
if (ext != 0) {
while (*ext) {
if (!str_catc(path, isupper(*ext)
? tolower(*ext)
: (*ext == '.')
? ':'
: *ext))
return -1;
++ext;
}
}
split = path->len;
for (;;) {
if (stat(path->s, &st) == 0)
return 1;
if (errno != ENOENT)
return -1;
if ((split = str_findprev(path, '-', split - 1)) == -1
|| split < baselen)
break;
path->len = split + 1;
if (!str_cats(path, "default")) return -1;
}
return 0;
}
cvm-0.97/cvm-v1benchclient.c 0000644 0000764 0000764 00000003205 12463157763 015273 0 ustar bruce guenter /* cvm/cvm-v1benchclient.c - CVM benchmark client
* Copyright (C) 2010 Bruce Guenter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include "v1client.h"
const char program[] = "cvm-v1benchclient";
const int msg_show_pid = 0;
int main(int argc, char** argv)
{
int a;
unsigned long count;
unsigned long i;
char* ptr;
char num[FMT_ULONG_LEN];
if (argc < 6)
die3(1, "usage: ", program, " count cvmodule account domain credential [credential ...]\n");
if ((count = strtoul(argv[1], &ptr, 10)) == 0 || *ptr)
die2(1, "Invalid number for count: ", argv[1]);
for (i = 0; i < count; i++) {
if ((a = cvm_client_authenticate(argv[2], argv[3], argv[4],
(const char**)(argv+5), 0)) != 0) {
num[fmt_udec(num, a)] = 0;
die5(a, "Authentication failed, error #", num, " (",
(a < cvm_nerr) ? cvm_errlist[i] : "Unknown error code", ")");
}
}
return 0;
}
cvm-0.97/cvm-checkpassword.html 0000644 0000764 0000764 00000001526 12463157763 016134 0 ustar bruce guenter
The cvm-checkpassword Program
cvm-checkpassword provides a checkpassword
interface for CVM modules.
Interface
cvm-checkpassword CVM Command [arguments ...]
See the above links for details on both the CVM and checkpassword
interfaces. To use this interface with qmail-pop3d, use the following
command line:
/var/qmail/bin/qmail-popup \
cvm-checkpassword cvm-unix \
/var/qmail/bin/qmail-pop3d ./Maildir/
Note: The default mode of operations for this module is to
attempt to split a domain name from the account name. If this is not
desirable, set $CVM_ACCOUNT_SPLIT_CHARS to an empty
string.
cvm-0.97/ChangeLog 0000644 0000764 0000764 00000605101 12463157763 013374 0 ustar bruce guenter commit 774d6ab7042e1396208c51b1136f2793829731c3
Author: Bruce Guenter
Date: Fri Jan 30 15:55:21 2015 -0600
Bump version to 0.97
NEWS | 4 ++++
VERSION | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
commit eb99f913562bcc93f83ff3f9a3102388881d423e
Author: Bruce Guenter
Date: Fri Jan 30 14:27:44 2015 -0600
Update #includes and libs for bglibs v2
NEWS | 2 ++
client_setenv.c | 2 +-
client_xfer_command.c | 2 +-
client_xfer_compat.c | 2 +-
client_xfer_local.c | 4 ++--
client_xfer_udp.c | 4 ++--
cvm-benchclient.c | 4 ++--
cvm-chain.c | 2 +-
cvm-checkpassword.c | 4 ++--
cvm-mysql.c | 2 +-
cvm-pgsql.c | 2 +-
cvm-pwfile.c | 6 +++---
cvm-qmail.c | 6 +++---
cvm-sqlite.c | 4 ++--
cvm-testclient.c | 8 ++++----
cvm-unix.c | 2 +-
cvm-v1benchclient.c | 4 ++--
cvm-v1checkpassword.c | 4 ++--
cvm-v1testclient.c | 8 ++++----
cvm-vmailmgr-local=x | 1 +
cvm-vmailmgr-udp=x | 1 +
cvm-vmailmgr.c | 14 +++++++-------
cvm-vmailmgr=x | 1 +
getpwnam.c | 2 +-
module.h | 2 +-
module_local.c | 6 +++---
module_local_main.c | 2 +-
module_main.c | 2 +-
module_udp.c | 4 ++--
module_udp_main.c | 2 +-
qmail-domains.c | 8 ++++----
qmail-dotfile.c | 4 ++--
qmail-lookup.c | 2 +-
qmail-users.c | 10 +++++-----
qmail.h | 2 +-
random.c | 6 +++---
sasl-auth-test.c | 6 +++---
sasl.h | 2 +-
sasl_auth.c | 8 ++++----
sasl_cram_md5.c | 2 +-
sasl_init.c | 2 +-
sql-auth.c | 2 +-
sql-query-test.c | 4 ++--
sql-query.c | 2 +-
sql.h | 2 +-
v1client.c | 4 ++--
v2client.c | 8 ++++----
v2client.h | 2 +-
vmautoconvert.c | 12 ++++++------
vmlookup.c | 14 +++++++-------
50 files changed, 108 insertions(+), 103 deletions(-)
commit d2b8a90683d3e2652c3d24d38b36e77f6f1ddf04
Author: Bruce Guenter
Date: Fri Jan 30 14:27:26 2015 -0600
Fixup for spac in Python3
programs.spac | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
commit f25821a43086466074a39baaca8b9a5f534b3e36
Author: Bruce Guenter
Date: Fri Jan 30 11:08:56 2015 -0600
README: Note development sources moved to github
README.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 0cd94285563cc1f82297720dd988d5c78cef541d
Author: Bruce Guenter
Date: Thu Jan 21 16:47:49 2010 -0600
Update copyright year to 2010
client_domain.c | 2 +-
client_setenv.c | 2 +-
client_setugid.c | 2 +-
client_xfer_command.c | 2 +-
client_xfer_compat.c | 2 +-
client_xfer_local.c | 2 +-
client_xfer_udp.c | 2 +-
cvm-benchclient.c | 2 +-
cvm-checkpassword.c | 2 +-
cvm-mysql.c | 2 +-
cvm-pgsql.c | 2 +-
cvm-pwfile.c | 2 +-
cvm-qmail.c | 2 +-
cvm-sqlite.c | 3 ++-
cvm-testclient.c | 2 +-
cvm-unix.c | 2 +-
cvm-v1benchclient.c | 2 +-
cvm-v1checkpassword.c | 2 +-
cvm-v1testclient.c | 2 +-
cvm-vmailmgr.c | 2 +-
errors.c | 2 +-
facts.c | 2 +-
getpwnam.c | 2 +-
module_command.c | 2 +-
module_command_main.c | 2 +-
module_local.c | 2 +-
module_local_main.c | 2 +-
module_log.c | 2 +-
module_main.c | 2 +-
module_output.c | 2 +-
module_request.c | 2 +-
module_udp.c | 2 +-
module_udp_main.c | 2 +-
qmail-domains.c | 2 +-
qmail-dotfile.c | 2 +-
qmail-init.c | 2 +-
qmail-lookup.c | 2 +-
qmail-users.c | 2 +-
random.c | 2 +-
sql-auth.c | 2 +-
sql-query.c | 2 +-
v1client.c | 2 +-
v2client.c | 2 +-
v2client_wrappers.c | 2 +-
vmautoconvert.c | 2 +-
vmlookup.c | 2 +-
46 files changed, 47 insertions(+), 46 deletions(-)
commit c37eb0fddec9541b9e388cf6b996e169e9e79648
Author: Bruce Guenter
Date: Thu Jan 21 16:38:13 2010 -0600
Add casts to eliminate pointer sign mismatch warnings
client_xfer_udp.c | 4 ++--
module_command.c | 2 +-
module_output.c | 2 +-
module_request.c | 4 ++--
module_udp.c | 5 +++--
sasl_auth.c | 3 ++-
v1client.c | 4 ++--
v2client.c | 2 +-
vmautoconvert.c | 4 ++--
9 files changed, 16 insertions(+), 14 deletions(-)
commit 97d65c1536a272b5bd003f13347b59c71bf6f404
Author: Bruce Guenter
Date: Thu Jan 21 16:34:53 2010 -0600
Ignore ltcompile instead of libcompile
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 558ac2703d56c0f37ab9b496a778a3c5a8db3ce4
Author: Bruce Guenter
Date: Thu Jan 21 13:43:54 2010 -0600
qmail-domains: Merge load_locals and load_vdomains
qmail-domains.c | 53 +++++++++++++++++++++++++++--------------------------
1 file changed, 27 insertions(+), 26 deletions(-)
commit 7445d974a86ea9b9e12754631b8750eb22ea603e
Author: Bruce Guenter
Date: Tue Jan 19 18:04:46 2010 -0600
qmail-domains: Fix reloading qmail locals/virtualdomains if they are deleted
TODO | 4 ----
qmail-domains.c | 24 ++++++++++++++++++++----
2 files changed, 20 insertions(+), 8 deletions(-)
commit 11377e2806a35a6a1b4e777e223a0ec38759000d
Author: Bruce Guenter
Date: Thu Jan 14 14:43:07 2010 -0600
qmail-domains: Fix to not die if control/locals is missing
NEWS | 2 ++
TODO | 4 ++++
qmail-domains.c | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
commit 5cca802019a21a964893d81147fe45258774b4e3
Author: Bruce Guenter
Date: Mon Jan 11 22:38:54 2010 -0600
Add support for I/O timeouts to local modules
NEWS | 2 ++
cvm.html | 4 +++-
module.h | 1 +
module_local.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
4 files changed, 54 insertions(+), 3 deletions(-)
commit 0021c0210799072b07627ebcfc703d7d302a09d6
Author: Bruce Guenter
Date: Mon Jan 11 11:06:38 2010 -0600
Add TODO note about SQL prepare/execute idea
TODO | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
commit fa31274aab5dd945ffa0afaf7d0fc14817c4f051
Author: Bruce Guenter
Date: Mon Jan 11 10:49:17 2010 -0600
cvm-qmail: Add permission checking with seteuid
NEWS | 3 +++
cvm-qmail.c | 26 +++++++++++++++++++++++++-
cvm-qmail.html | 7 +++++++
tests/qmail-lookup-perms | 40 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 75 insertions(+), 1 deletion(-)
create mode 100644 tests/qmail-lookup-perms
commit 7ef7b8205bae3da7ce939dc48bf7603d083eecb5
Author: Bruce Guenter
Date: Fri Jan 8 23:49:54 2010 -0600
Move the fake qmail home directory into a subdirectory in tests
tests.inc | 24 +++++++++++++---------
tests/chain-client | 6 +++---
tests/chain-module | 6 +++---
tests/qmail-lookup | 48 ++++++++++++++++++++++----------------------
tests/qmail-lookup-assume | 6 +++---
tests/qmail-lookup-lookaside | 8 ++++----
tests/qmail-lookup-nodomain | 6 +++---
tests/split | 30 +++++++++++++--------------
tests/vmailmgr-normal | 6 +++---
tests/vmailmgr-upper-domain | 6 +++---
tests/vmailmgr-upper-virt | 6 +++---
tests/vmailmgr-xconvert | 14 ++++++-------
tests/vmlookup-normal | 6 +++---
tests/vmlookup-notable | 8 ++++----
tests/vmlookup-pass | 6 +++---
tests/vmlookup-upper-domain | 6 +++---
tests/vmlookup-upper-virt | 6 +++---
17 files changed, 101 insertions(+), 97 deletions(-)
commit b27df59e84eb49d6ffc4400493b9aa4c1384bd6a
Author: Bruce Guenter
Date: Mon Feb 16 15:47:50 2009 -0600
Fix the SQLite module to copy the row data in the callback function.
NEWS | 2 ++
cvm-sqlite.c | 22 +++++++++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
commit c6d7cd76e97053ed121b2230d997ab8fb649baad
Author: Bruce Guenter
Date: Mon Feb 16 10:48:42 2009 -0600
Added note about SQLite module to the README.
README.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit da87c9476edbba5173ff7c7f66b1603a46222386
Author: Bruce Guenter
Date: Mon Feb 16 16:28:36 2009 -0600
Bumped version to 0.96
NEWS | 5 +++++
VERSION | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
commit bbecd1a5b5220844abc75f8efdb568f60618122f
Author: Bruce Guenter
Date: Tue Jan 13 22:50:30 2009 -0600
Bumped version to 0.95
NEWS | 2 +-
VERSION | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
commit 5e7732cf3d7d3e6b92a2606566600d33b3e36ece
Author: Bruce Guenter
Date: Tue Jan 13 22:49:45 2009 -0600
Added note about cvm-sqlite to the NEWS file.
NEWS | 2 ++
1 file changed, 2 insertions(+)
commit 897a02f57ab67b9c2ed14b08d06ef5c3eb7d7496
Author: Bruce Guenter
Date: Tue Jan 13 22:47:20 2009 -0600
Wayne placed cvm-sqlite in the public domain; I added some slight touchups.
Date: Tue, 13 Jan 2009 10:02:55 +0000
From: Wayne Marshall
To: Bruce Guenter
Subject: Re: cvm-sqlite
Message-ID: <20090113100255.162456ba@alloy.copperisle.com>
Hi Bruce,
>
> I was just going to push out a new version of cvm, and noticed I hadn't
> merged the SQLite module yet. I noticed the sources I had downloaded
> from your site don't have any copyright notice on them. Please publish
> a version that has a copyright compatible with the GPLv2, or send me a
> note assigning copyright to me, so I can include this in the main cvm
> package.
>
Please consider the sources as public domain.
Best regards,
Wayne
cvm-sqlite.c | 36 +++++++++++++++++++-----------------
cvm-sqlite.html | 21 +++++----------------
2 files changed, 24 insertions(+), 33 deletions(-)
commit 94de1ef0deca5d6ae5ae3b84d91a8f3e209fa123
Author: Bruce Guenter
Date: Tue Jan 13 22:45:02 2009 -0600
Added self tests for the SQLite CVM.
tests.inc | 28 ++++++++++++++++++++++++++++
tests/sqlite | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+)
create mode 100644 tests/sqlite
commit e0d62ae6da1642506c20ce38bce27be7b501b4fe
Author: Bruce Guenter
Date: Mon Jan 12 14:39:59 2009 -0600
Skip cvm-sqlite in the main "programs" target.
programs.spac | 1 +
1 file changed, 1 insertion(+)
commit c125a76f2e75ca7a39c7ce69d3ccdc871b7ab4fa
Author: Bruce Guenter
Date: Mon Jan 12 14:39:27 2009 -0600
Fixed some compiler warnings about unused parameters in cvm-sqlite.c
cvm-sqlite.c | 3 +++
1 file changed, 3 insertions(+)
commit ab212c65db311f7cd756924caba051c86297e979
Author: Bruce Guenter
Date: Mon Jan 12 14:32:20 2009 -0600
Removed a trailing space in the SQLite CVM.
cvm-sqlite.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 27dbfda73d826a4be4947462d557dac572ff58f1
Author: Bruce Guenter
Date: Mon Apr 14 17:25:04 2008 -0600
Added cvm-sqlite implementation from Wayne Marshall
INSTHIER | 1 +
TOP.spac | 2 +-
cvm-sqlite.c | 131 ++++++++++++++++++++++++++++++++++++++++++++
cvm-sqlite.html | 107 ++++++++++++++++++++++++++++++++++++
cvm-pgsql=x => cvm-sqlite=x | 2 +-
sqlite.spac | 1 +
6 files changed, 242 insertions(+), 2 deletions(-)
create mode 100644 cvm-sqlite.c
create mode 100644 cvm-sqlite.html
copy cvm-pgsql=x => cvm-sqlite=x (65%)
create mode 100644 sqlite.spac
commit 47d7a8d49ef3bd3a049bce3ef7444e975ba11b52
Author: Bruce Guenter
Date: Mon Jan 12 15:56:35 2009 -0600
Touched up the documentation for $CVM_QMAIL_LOOKASIDE.
cvm-qmail.html | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
commit 68715f891e7876fbb8fa916bbe0d1dcad8eb3a40
Author: Bruce Guenter
Date: Fri Apr 18 17:06:07 2008 -0600
Added a "lookaside" mode to cvm-qmail, to assist with proper chaining
to cvm-vmailmgr or other modules.
NEWS | 3 ++
cvm-qmail.c | 81 +++++++++++++++++++++++++++++++++++++++-----
cvm-qmail.html | 9 +++++
tests/qmail-lookup-lookaside | 50 +++++++++++++++++++++++++++
4 files changed, 135 insertions(+), 8 deletions(-)
create mode 100644 tests/qmail-lookup-lookaside
commit 35e06ba21b4d8292d3c3ea6729c4674acc7e205c
Author: Bruce Guenter
Date: Fri Apr 18 15:48:00 2008 -0600
Made qmail_dotfile_exists output the path to the .qmail file to the caller.
cvm-qmail.c | 3 ++-
qmail-dotfile.c | 26 +++++++++++++-------------
qmail.h | 3 ++-
3 files changed, 17 insertions(+), 15 deletions(-)
commit 56499ed5b2c5db9cdd6fb3cc9c8eb7d80fdd9be8
Author: Bruce Guenter
Date: Mon Jan 12 14:30:47 2009 -0600
Added some TODO notes.
TODO | 5 +++++
1 file changed, 5 insertions(+)
commit cc61e88b1c2572739146ae72162eaa5ba993d436
Author: Bruce Guenter
Date: Fri Jan 9 11:08:14 2009 -0600
Fix a compiler warning with a NULL in pipefork.
client_xfer_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 20a7ce2a37c48ebb55416845bbb66276ab7a9771
Author: Bruce Guenter
Date: Fri Jan 9 11:07:42 2009 -0600
Eliminate an unused variable in cvm_random_init.
random.c | 1 -
1 file changed, 1 deletion(-)
commit de65cb868de4dbe0c0da3f8b0f309811e62f1b2f
Author: Bruce Guenter
Date: Fri Apr 18 17:35:42 2008 -0600
Added notes about OUTOFSCOPE to the HTML documentation.
cvm-qmail.html | 15 +++++++++------
cvm-vmailmgr.html | 4 +++-
2 files changed, 12 insertions(+), 7 deletions(-)
commit e6898800e15f53d9bc805346ab41bfab05f979b3
Author: Bruce Guenter
Date: Fri Apr 18 17:32:41 2008 -0600
Make vmlookup fail with OUTOFSCOPE=1 when the password table is not there.
Previously, cvm-vmailmgr would fail with an I/O error when the virtual
password table was missing. This would cause problems for chaining
properly with other modules.
NEWS | 4 ++++
tests/vmlookup-notable | 15 +++++++++++++++
vmlookup.c | 8 +++++++-
3 files changed, 26 insertions(+), 1 deletion(-)
create mode 100644 tests/vmlookup-notable
commit 3eec484b9ba9eec1fb12b3d891d2a5bfbf20a18a
Author: Bruce Guenter
Date: Mon Apr 14 17:26:07 2008 -0600
Fixed portability problem in tests/qmail-lookup-nodomain
Thanks Gerrit Pape
tests/qmail-lookup-nodomain | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit c1b8f4eb8f53e129dc7a8862112b06c53f34d961
Author: Bruce Guenter
Date: Mon Apr 14 17:02:50 2008 -0600
Fixed client.h symlink to point to v2client.h to match the library.
INSTHIER | 2 +-
NEWS | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
commit 0afc023c43090c1a24a45f089ccccb4d38ff1309
Author: Bruce Guenter
Date: Mon Apr 14 16:15:46 2008 -0600
Fixed failure in cvm-qmail when virtualdomains did not exist.
NEWS | 1 +
qmail-domains.c | 3 ++-
tests/qmail-lookup-novirtualdomains | 10 ++++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
create mode 100644 tests/qmail-lookup-novirtualdomains
commit 9ee2e1dc01882f019a24795717cde7ece3b4749c
Author: Bruce Guenter
Date: Mon Apr 14 16:14:52 2008 -0600
Bumped version to 0.91
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit b3e870f546807d5d5f5bf27edbb659dda704e05a
Author: Bruce Guenter
Date: Fri Apr 11 21:01:47 2008 -0600
Fixed Require/BuildRequires for bglibs in the spec.
spec | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
commit d9527c62c479318bc07fce5752889902e1c6fa8c
Author: Bruce Guenter
Date: Fri Apr 11 21:01:34 2008 -0600
Fixed requirement for bglibs version 1.103 in the README.
README.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit a5e5853cc3373e37e80a85028caa2b6bdd8d3de5
Author: Bruce Guenter
Date: Fri Apr 11 17:51:59 2008 -0600
Bumped LIBVERSION and VERSION in preparation for release.
LIBVERSION | 2 +-
NEWS | 2 +-
VERSION | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
commit 4cd773bb274e9d4b0f4f9a2df3c91bc0ae0f997e
Author: Bruce Guenter
Date: Fri Apr 11 17:49:51 2008 -0600
Added compatibility wrapper functions to the client_xfer_* functions.
The actual functions are renamed to a new name of client_xfer_*_packets,
and wrapper functions were added with the original names and signatures.
This is done to prevent requiring a major version bump to LIBVERSION,
which would break all clients that linked to the shared library.
client_xfer_command.c | 6 ++---
client_xfer_compat.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++
client_xfer_local.c | 6 ++---
client_xfer_udp.c | 6 ++---
libcvm-v1client=l | 1 +
libcvm-v2client=l | 1 +
v1client.c | 6 ++---
v1client.h | 23 ++++++++++++-----
v2client.c | 6 ++---
v2client.h | 23 ++++++++++++-----
10 files changed, 120 insertions(+), 27 deletions(-)
create mode 100644 client_xfer_compat.c
commit e9c90d275972753f6abf8437399adda448b3d84f
Author: Bruce Guenter
Date: Fri Apr 11 17:22:48 2008 -0600
Added two tests that were missing from the previous commits.
tests/chain-client | 38 ++++++++++++++++++++++++++++++++++++++
tests/chain-module | 44 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+)
create mode 100644 tests/chain-client
create mode 100644 tests/chain-module
commit 5838d329188acbb974f21b034036b2073f49992e
Author: Bruce Guenter
Date: Fri Apr 11 17:21:36 2008 -0600
Moved the note about the random tag into the v2 client documentation.
cvm.html | 5 -----
v2client.html | 4 ++++
2 files changed, 4 insertions(+), 5 deletions(-)
commit 6ab3f46136798c4f64198d63e8297c97fe82a6e4
Author: Bruce Guenter
Date: Fri Apr 11 17:19:56 2008 -0600
Added support for chaining modules in the v2 library.
NEWS | 8 ++++++++
TODO | 5 -----
cvm-chain.html | 3 ++-
cvm.html | 8 ++++++++
tests/chain | 44 ----------------------------------------
v2client.c | 64 ++++++++++++++++++++++++++++++++++++++++++++--------------
6 files changed, 67 insertions(+), 65 deletions(-)
delete mode 100644 tests/chain
commit bae2ac68954b1d19020771ff28c5f920e3b71cd8
Author: Bruce Guenter
Date: Fri Apr 11 16:24:02 2008 -0600
Seperate the single xfer packet into request and response packets.
This again breaks the previous ABI, and requires a LIBVERSION bump.
client_xfer_command.c | 11 ++++++-----
client_xfer_local.c | 15 ++++++++-------
client_xfer_udp.c | 18 ++++++++++--------
v1client.c | 15 ++++++++-------
v1client.h | 9 ++++++---
v2client.c | 16 +++++++++-------
v2client.h | 9 ++++++---
7 files changed, 53 insertions(+), 40 deletions(-)
commit 3028400e3141622aca2603daa0f6779430b377d7
Author: Bruce Guenter
Date: Fri Apr 11 16:06:53 2008 -0600
Introduced struct cvm_packet, and modified many client functions to use it.
This will require a major bump to the library version, as all the
client_xfer_* functions are now incompatible with the previous versions.
client_xfer_command.c | 9 +++----
client_xfer_local.c | 13 +++++-----
client_xfer_udp.c | 16 ++++++------
v1client.c | 57 +++++++++++++++++++++-------------------
v1client.h | 15 ++++++-----
v2client.c | 72 ++++++++++++++++++++++++---------------------------
v2client.h | 15 ++++++-----
7 files changed, 101 insertions(+), 96 deletions(-)
commit eba511388ab210394cdc1648a9e4a7c6b46dc353
Author: Bruce Guenter
Date: Fri Apr 11 14:14:16 2008 -0600
Moved the client buffer data into a structure.
This is the start of preparation for having both an input and output
buffer, which is required for transferring multiple packets in the
client.
v2client.c | 71 ++++++++++++++++++++++++++++++++++----------------------------
1 file changed, 39 insertions(+), 32 deletions(-)
commit ea954c8b67a725ea7788da2ef8861db4c664afce
Author: Bruce Guenter
Date: Fri Apr 11 13:03:20 2008 -0600
Clarify the semantics of the return path of cvm_client_authenticate.
v2client.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
commit 08579e77b0768e426f655bbcfe67c2a822b1cb68
Author: Bruce Guenter
Date: Fri Apr 11 11:19:31 2008 -0600
Simplified the logic in cvm-chain slightly.
cvm-chain.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
commit bbfbe51f1d3e860d6c7a88c741a43c9d60973348
Author: Bruce Guenter
Date: Thu Apr 10 13:10:54 2008 -0600
Added notes to NEWS about which modules handle OUTOFSCOPE.
NEWS | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
commit 4069686096f6942788aa4236b87f78a90820d87a
Author: Bruce Guenter
Date: Thu Apr 10 13:09:38 2008 -0600
Handle the OUTOFSCOPE fact in cvm-chain by passing it through.
cvm-chain.c | 8 ++++++++
cvm-chain.html | 6 ++++++
tests/chain | 2 ++
3 files changed, 16 insertions(+)
commit f00e590a59c0b6baf71abcdb7c0dd0e05a7188aa
Author: Bruce Guenter
Date: Thu Apr 10 11:40:02 2008 -0600
Bumped the revision number in LIBVERSION in preparation for release.
LIBVERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 4c123d75f0a650a427bf02754ab03da91f517ddf
Author: Bruce Guenter
Date: Thu Apr 10 10:34:20 2008 -0600
Added two missing vmailmgr lookup self-tests.
tests/{qmail-lookup-baddomain => vmlookup-baddomain} | 5 ++---
tests/{vmailmgr-upper-pass => vmlookup-baduser} | 3 ++-
2 files changed, 4 insertions(+), 4 deletions(-)
copy tests/{qmail-lookup-baddomain => vmlookup-baddomain} (53%)
copy tests/{vmailmgr-upper-pass => vmlookup-baduser} (53%)
commit 645465c10c46dda4ba9ab88802a63d439dc2dc56
Author: Bruce Guenter
Date: Thu Apr 10 10:34:00 2008 -0600
Fixed up some HTML bugs in the documentation.
credentials.html | 10 ++++++----
cvm.html | 22 +++++++++++++---------
errors.html | 7 +++++--
facts.html | 14 ++++++++------
module.html | 11 ++++++++---
protocol-1.html | 18 ++++++++++++------
protocol-2.html | 3 +--
rationale.html | 3 +++
sasl.html | 6 ++++--
sql.html | 4 ++--
v1client.html | 8 ++++++--
v2client.html | 9 +++++++--
12 files changed, 75 insertions(+), 40 deletions(-)
commit f9e6280122f07d3f6447951cabf2954680e50c4a
Author: Bruce Guenter
Date: Thu Apr 10 10:25:01 2008 -0600
Added a note about $CVM_RANDOM_BYTES to the HTML documentation.
cvm.html | 5 +++++
1 file changed, 5 insertions(+)
commit 834fe8834f5dca529701a89d60522b5b73453bd4
Author: Bruce Guenter
Date: Thu Apr 10 10:11:01 2008 -0600
Fixed make_randombytes to only initialize once.
v2client.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
commit ed54d4afe40a84e16fe7de148231f20f56a1d2a3
Author: Bruce Guenter
Date: Thu Apr 10 09:56:45 2008 -0600
Switched to using the new surfrand in bglibs to generate random data.
random.c | 58 ++++++++++------------------------------------------------
random.h | 2 +-
spec | 2 +-
v2client.c | 3 +--
4 files changed, 13 insertions(+), 52 deletions(-)
commit 0762fd93ae6e62d7eb6856f4336a6c47acf04b93
Author: Bruce Guenter
Date: Thu Apr 10 09:44:55 2008 -0600
Add OUTOFSCOPE facts in all PERMFAIL exits in qmail and vmailmgr CVMs.
cvm-qmail.c | 4 +++-
cvm-vmailmgr.c | 3 +++
tests/qmail-lookup | 4 ++++
tests/vmailmgr-normal | 1 +
tests/vmailmgr-upper-pass | 1 +
tests/vmlookup-badpass | 1 +
vmlookup.c | 2 ++
7 files changed, 15 insertions(+), 1 deletion(-)
commit 592c52683bf9fc7061684ec787cc8d42d7b4de7b
Author: Bruce Guenter
Date: Sun Mar 30 22:01:34 2008 -0600
Only add the random tag when transmitting over UDP.
v2client.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
commit a6f11de73eaf6a2ed37cc109f9629f1794e179ed
Author: Bruce Guenter
Date: Sun Mar 30 14:59:45 2008 -0600
Let the random tag length be set by $CVM_RANDOM_BYTES.
NEWS | 3 +++
v2client.c | 11 ++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
commit c756cc0335b6f515c1ca7f1642fb60641825ac7a
Author: Bruce Guenter
Date: Sun Mar 30 14:56:27 2008 -0600
Add 8 bytes of random data to client requests.
libcvm-v2client=l | 1 +
random.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
random.h | 7 +++++
v2client.c | 20 ++++++++++++-
4 files changed, 114 insertions(+), 1 deletion(-)
create mode 100644 random.c
create mode 100644 random.h
commit 3bcf5c4b86aebe260fe03b590621d289f1dc8a1a
Author: Bruce Guenter
Date: Sat Mar 29 23:42:30 2008 -0600
Output the out of scope fact in qmail and vmailmgr CVMs
When a qmail lookup is done on a domain that does not exist in
virtualdomains, no determination can be made about users in that domain,
so the result is "out of scope". Similarly, vmailmgr treats any failed
qmail lookup as "out of scope", since it can't then do its virtual user
lookup.
This fact is also reported on error in cvm-testclient.
Also bumped the version to 0.85, due to the significance of this change.
NEWS | 6 +++++-
TODO | 2 ++
VERSION | 2 +-
cvm-qmail.c | 7 ++++++-
cvm-testclient.c | 7 ++++---
qmail-lookup.c | 14 ++++++++++----
tests/chain | 4 ++++
tests/qmail-lookup-assume | 1 +
tests/qmail-lookup-baddomain | 6 ++++++
tests/split | 4 ++++
tests/vmailmgr-normal | 4 ++++
vmlookup.c | 18 ++++++++++++++----
12 files changed, 61 insertions(+), 14 deletions(-)
create mode 100644 tests/qmail-lookup-baddomain
commit e0d65bdc3ab9ba2be5d389cb50d16c4a10f30693
Author: Bruce Guenter
Date: Sat Mar 29 18:55:44 2008 -0600
Changed the fatal error in cvm-testclient to a message.
cvm-testclient.c | 3 ++-
tests/chain | 2 +-
tests/command-bad-password | 2 +-
tests/command-bad-username | 2 +-
tests/lookup | 4 ++--
tests/pwfile-bad-password | 2 +-
tests/pwfile-local-bad-password | 2 +-
tests/pwfile-udp-bad-password | 2 +-
tests/qmail-lookup | 8 ++++----
tests/qmail-lookup-assume | 2 +-
tests/split | 8 ++++----
tests/vmailmgr-upper-pass | 2 +-
tests/vmlookup-badpass | 2 +-
13 files changed, 21 insertions(+), 20 deletions(-)
commit 48d4f28acbec04698d70fb333af8706c202f3bdb
Author: Bruce Guenter
Date: Fri Mar 28 17:48:51 2008 -0600
Add an "out of scope" fact, to be used on permanent failures.
facts.h | 1 +
facts.html | 11 +++++++++++
2 files changed, 12 insertions(+)
commit 2f0bfb87ae2347bbd1306eee8a4451ab376cb6f6
Author: Bruce Guenter
Date: Fri Mar 28 17:16:13 2008 -0600
The v2 protocol will now allow facts in the response packet.
protocol-2.html | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
commit ec467434975b61b37545da501d14ec56cd5ccef7
Author: Bruce Guenter
Date: Fri Mar 28 17:04:29 2008 -0600
Always do a minimal parse on the input buffer in v2client.
v2client.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
commit 8d1d10d71ac199584e5d2671215dcfefffa2ec83
Author: Bruce Guenter
Date: Fri Mar 28 17:01:22 2008 -0600
Don't truncate the module output when the result code is not zero.
module_output.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
commit 2730e859f2e67f1031427c77934a2fa8ae5cdd39
Author: Bruce Guenter
Date: Fri Mar 28 16:47:21 2008 -0600
Added a test for a bad password with pwfile in command mode.
tests/{command-bad-username => pwfile-bad-password} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
copy tests/{command-bad-username => pwfile-bad-password} (64%)
commit c2734cee638eb109caa004247d21da0b673b8b82
Author: Bruce Guenter
Date: Fri Mar 28 15:58:36 2008 -0600
Make command mode transfers work the same as other transfers.
The local and UDP transfer functions both return the status of the
transfer itself. The command mode returns CVME_IO if the transfer
failed, but if the module failed it also would return that error code.
This modification stuffs the result code into the buffer as expected and
returns 0 if the transfer succeeded.
client_xfer_command.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
commit e7ba58ea3627c97133b4b1c892bce4803379c922
Author: Bruce Guenter
Date: Fri Mar 28 15:49:30 2008 -0600
Rewrote several constant return values to use CVME_* macros.
client_xfer_command.c | 6 +++---
client_xfer_udp.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
commit 8f038d92c5268c19f7cd9cb9fa15a183a6bc1bb1
Author: Bruce Guenter
Date: Thu Mar 20 14:44:19 2008 -0600
Point to the GIT repository for development versions.
README.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit dc58a1d308d23232007e20e68bc2603f2ecc29f0
Author: Bruce Guenter
Date: Thu Mar 20 14:43:57 2008 -0600
Ignore most automatically generated files.
.gitignore | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 .gitignore
commit 1377a540163964a4688f338e3df851e243672d29
Author: Bruce Guenter
Date: Fri Jan 5 19:30:07 2007 +0000
Fixed a bug that caused the domain output to be set incorrectly when
doing qmail lookups with a domain not in the control files with
$CVM_QMAIL_ASSUME_LOCAL set.
NEWS | 3 +++
qmail-domains.c | 13 +++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
commit f9b79ae998564f07a56c83092a5af8070136daf9
Author: Bruce Guenter
Date: Thu Jan 4 08:38:10 2007 +0000
Bumped version to 0.83
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit 2cb0b2a8c0b844218d05cd3b3797292174d26aec
Author: Bruce Guenter
Date: Wed Aug 30 23:55:33 2006 +0000
Bumped the library revision number.
LIBVERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 9aef171e9359bde6a8ac7f3524d7f1e976fdfae5
Author: Bruce Guenter
Date: Wed Aug 30 23:09:45 2006 +0000
Fixed handling of user/domain name splitting in the client library
when the caller doesn't initially provide a domain name.
NEWS | 3 ++
tests/split | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++
v2client_wrappers.c | 40 +++++++++++++++++----------
3 files changed, 109 insertions(+), 14 deletions(-)
create mode 100644 tests/split
commit 7f564868aeeaa34aa17ff26711740f35cdc02c51
Author: Bruce Guenter
Date: Wed Aug 30 23:09:37 2006 +0000
Split domain names from the username in the test client (for testing).
cvm-testclient.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 1d5fde08b81cbf6cb42cec5e5fe646a8d999db0e
Author: Bruce Guenter
Date: Wed Aug 30 21:56:35 2006 +0000
Added a note in the documentation about $MAIL and $MAILDIR.
v1client.html | 4 ++++
v2client.html | 4 ++++
2 files changed, 8 insertions(+)
commit 0e780bc64e3a55d0c1c94655fcfa31db3629be5e
Author: Bruce Guenter
Date: Wed Aug 30 21:55:16 2006 +0000
Set $MAILDIR in cvm_client_setenv
NEWS | 1 +
client_setenv.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
commit 9776ace0e914f0ac23cf91ee17ab711a319e007b
Author: Bruce Guenter
Date: Wed Aug 30 21:53:13 2006 +0000
Bumped version to 0.82
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit 42a707d7dc5cd5c6d068c21a4503f4ec8ca682ae
Author: Bruce Guenter
Date: Sun Jul 30 22:27:44 2006 +0000
Fixed a typo in the INSTHIER file that caused incomplete installations.
INSTHIER | 2 ++
NEWS | 2 ++
2 files changed, 4 insertions(+)
commit 4f7e1a3edd5be264ec24350bcee7beac6f9f5c94
Author: Bruce Guenter
Date: Sun Jul 30 20:41:17 2006 +0000
Bumped version to 0.81
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit 3e502f88f59e3e333803f45fe0d63a32c58f849b
Author: Bruce Guenter
Date: Fri Jul 28 22:23:55 2006 +0000
Fixed up the README documentation.
README.in | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
commit 716a6b0605672e834adeba75446f1e36bfe04012
Author: Bruce Guenter
Date: Fri Jul 28 22:21:57 2006 +0000
Fixed up the spec for the shared library install.
spec | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
commit ef9f5dda256090f45683bafa5987db013709c077
Author: Bruce Guenter
Date: Fri Jul 28 22:21:38 2006 +0000
Added note about shared library change to NEWS.
NEWS | 2 ++
1 file changed, 2 insertions(+)
commit e11fe9d45051bcd2cd743db3fed609f0e5d75b9e
Author: Bruce Guenter
Date: Fri Jul 28 22:20:49 2006 +0000
The installed libraries need to be made executable.
INSTHIER | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
commit cf16e001345f1ea069f564e3bd81e7a203a65464
Author: Bruce Guenter
Date: Fri Jul 28 04:51:55 2006 +0000
Bumped version to 0.80
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit e629bb2a5e581b74620f7b8c30d9c02e89dca08d
Author: Bruce Guenter
Date: Fri Jul 28 04:51:14 2006 +0000
Rewrote the remaining em.ca addresses to untroubled.org.
client_domain.c | 2 +-
client_setenv.c | 2 +-
client_setugid.c | 2 +-
client_xfer_command.c | 2 +-
client_xfer_local.c | 2 +-
client_xfer_udp.c | 2 +-
cvm-benchclient.c | 2 +-
cvm-checkpassword.c | 2 +-
cvm-mysql.c | 2 +-
cvm-pgsql.c | 2 +-
cvm-pwfile.c | 2 +-
cvm-qmail.c | 2 +-
cvm-testclient.c | 2 +-
cvm-unix.c | 2 +-
cvm-v1benchclient.c | 2 +-
cvm-v1checkpassword.c | 2 +-
cvm-v1testclient.c | 2 +-
cvm-vmailmgr.c | 2 +-
errors.c | 2 +-
facts.c | 2 +-
getpwnam.c | 2 +-
module_command.c | 2 +-
module_command_main.c | 2 +-
module_local.c | 2 +-
module_local_main.c | 2 +-
module_log.c | 2 +-
module_main.c | 2 +-
module_output.c | 2 +-
module_request.c | 2 +-
module_udp.c | 2 +-
module_udp_main.c | 2 +-
qmail-domains.c | 2 +-
qmail-dotfile.c | 2 +-
qmail-init.c | 2 +-
qmail-lookup.c | 2 +-
qmail-users.c | 2 +-
spec | 4 ++--
sql-auth.c | 2 +-
sql-query.c | 2 +-
v1client.c | 2 +-
v2client.c | 2 +-
v2client_wrappers.c | 2 +-
vmautoconvert.c | 2 +-
vmlookup.c | 2 +-
44 files changed, 45 insertions(+), 45 deletions(-)
commit dd3a793d80c251a5bd443342cd8b7066ec051661
Author: Bruce Guenter
Date: Fri Jul 28 04:48:43 2006 +0000
Create, link, and install shared libraries.
INSTHIER | 62 ++++++++++++++++++++++++++-------------------------
LIBVERSION | 1 +
cvm-benchclient=x | 2 +-
cvm-chain=x | 4 ++--
cvm-checkpassword=x | 2 +-
cvm-mysql-local=x | 4 ++--
cvm-mysql-udp=x | 4 ++--
cvm-mysql=x | 4 ++--
cvm-pgsql-local=x | 4 ++--
cvm-pgsql-udp=x | 4 ++--
cvm-pgsql=x | 4 ++--
cvm-pwfile=x | 2 +-
cvm-qmail=x | 4 ++--
cvm-testclient=x | 2 +-
cvm-unix=x | 2 +-
cvm-v1benchclient=x | 2 +-
cvm-v1checkpassword=x | 2 +-
cvm-v1testclient=x | 2 +-
cvm-vchkpw=x | 2 +-
cvm-vmailmgr-local=x | 4 ++--
cvm-vmailmgr-udp=x | 4 ++--
cvm-vmailmgr=x | 4 ++--
sasl-auth-test=x | 4 ++--
23 files changed, 66 insertions(+), 63 deletions(-)
create mode 100644 LIBVERSION
commit 6746aeec1bfbaf2103e4a3fea10e82bbd4f4267e
Author: Bruce Guenter
Date: Fri Jul 28 04:46:51 2006 +0000
Fixed the old em.ca email address.
README.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 0fdea6d9c1493ebebd3c8475adf3adb6262e2157
Author: Bruce Guenter
Date: Wed Jul 26 14:56:32 2006 +0000
Renamed all the libraries to have their target libcvm- prefix.
INSTHIER | 16 ++++++++--------
cvm-benchclient=x | 2 +-
cvm-chain=x | 4 ++--
cvm-checkpassword=x | 2 +-
cvm-mysql-local=x | 4 ++--
cvm-mysql-udp=x | 4 ++--
cvm-mysql=x | 4 ++--
cvm-pgsql-local=x | 4 ++--
cvm-pgsql-udp=x | 4 ++--
cvm-pgsql=x | 4 ++--
cvm-pwfile=x | 2 +-
cvm-qmail=x | 4 ++--
cvm-testclient=x | 2 +-
cvm-unix=x | 2 +-
cvm-v1benchclient=x | 2 +-
cvm-v1checkpassword=x | 2 +-
cvm-v1testclient=x | 2 +-
cvm-vchkpw=x | 2 +-
cvm-vmailmgr-local=x | 4 ++--
cvm-vmailmgr-udp=x | 4 ++--
cvm-vmailmgr=x | 4 ++--
command=l => libcvm-command=l | 0
local=l => libcvm-local=l | 0
module=l => libcvm-module=l | 0
qmail=l => libcvm-qmail=l | 0
sasl=l => libcvm-sasl=l | 0
sql=l => libcvm-sql=l | 0
udp=l => libcvm-udp=l | 0
v1client=l => libcvm-v1client=l | 0
v2client=l => libcvm-v2client=l | 0
sasl-auth-test=x | 4 ++--
31 files changed, 41 insertions(+), 41 deletions(-)
rename command=l => libcvm-command=l (100%)
rename local=l => libcvm-local=l (100%)
rename module=l => libcvm-module=l (100%)
rename qmail=l => libcvm-qmail=l (100%)
rename sasl=l => libcvm-sasl=l (100%)
rename sql=l => libcvm-sql=l (100%)
rename udp=l => libcvm-udp=l (100%)
rename v1client=l => libcvm-v1client=l (100%)
rename v2client=l => libcvm-v2client=l (100%)
commit 674b8fdadc9bb2076d5af548e89dfa5d30f123ed
Author: Bruce Guenter
Date: Mon Aug 29 16:02:41 2005 +0000
Documentation touch-ups: make reference to cvm-qmail in cvm-vmailmgr
config variables, and properly alphabetize the variable names.
cvm-qmail.html | 11 ++++++-----
cvm-vmailmgr.html | 26 ++++++++++++--------------
2 files changed, 18 insertions(+), 19 deletions(-)
commit b022e652256b321679ff53103bc803d9c82143d6
Author: Bruce Guenter
Date: Mon Aug 29 15:55:32 2005 +0000
Added a feature to all qmail-based modules to treat all domains as local
if $CVM_QMAIL_ASSUME_LOCAL is set.
NEWS | 3 +++
cvm-qmail.html | 4 ++++
qmail-domains.c | 8 +++++++-
tests/qmail-lookup-assume | 22 ++++++++++++++++++++++
4 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 tests/qmail-lookup-assume
commit 69f2b82e3609c48aa5d8bacdcd175f21684eafad
Author: Bruce Guenter
Date: Sun Aug 28 21:41:50 2005 +0000
Fixed a missing-escaped-$ typo on the vmailmgr-xconvert test.
tests/vmailmgr-xconvert | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 4911f9350b69ecd51fc80a30aaf2ad81ac979d30
Author: Bruce Guenter
Date: Sun Aug 28 21:40:43 2005 +0000
Fixed the autoconvert feature of cvm-vmailmgr to set the permissions
and ownership of the created password table to that of the original.
NEWS | 2 ++
vmautoconvert.c | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
commit 1d0459b3de1c3714ac4c305018e737a9fd590317
Author: Bruce Guenter
Date: Sun Aug 28 21:28:05 2005 +0000
Bumped version to 0.76
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit 91a69ac3169874fe5db088ea56a21daacffc455a
Author: Bruce Guenter
Date: Sat Aug 27 06:46:41 2005 +0000
Use cdbget to dump the converted record in a more useful format.
tests/vmailmgr-xconvert | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
commit e379c4e4e3cd0e925c4d91a749e088e9526cc224
Author: Bruce Guenter
Date: Tue Aug 23 19:35:46 2005 +0000
Fixed up printf invocations to make them work around the bugs in ash's
builtin printf.
tests.inc | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
commit 752c8899cae14a6ad835e075d06a5f2acbc43c6d
Author: Bruce Guenter
Date: Tue Aug 23 18:22:48 2005 +0000
Bumped version number to 0.75, just because.
NEWS | 2 +-
VERSION | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
commit fe38b19c2405f8f08fab02f50614116acd95cf37
Author: Bruce Guenter
Date: Fri Aug 19 23:35:32 2005 +0000
Documented the new $VMAILMGR_AUTOCONVERT environment variable.
NEWS | 3 ++-
cvm-vmailmgr.html | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
commit 0325b7c841ac1cd359e96ec073798c2b2fd071eb
Author: Bruce Guenter
Date: Fri Aug 19 22:42:17 2005 +0000
The previous cvm-vmailmgr autoconvert fix requires a patch only present
in bglibs 1.027.
spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 25834b571395cc91513a7ebb834c81854fb468fb
Author: Bruce Guenter
Date: Fri Aug 19 22:40:49 2005 +0000
Added an "autoconvert" mode to cvm-vmailmgr, which converts encrypted
passwords to plain-text on successful authentication.
NEWS | 2 +
TODO | 12 ++---
cvm-vmailmgr-local=x | 1 +
cvm-vmailmgr-udp=x | 1 +
cvm-vmailmgr.c | 8 +++-
cvm-vmailmgr.h | 1 +
cvm-vmailmgr=x | 1 +
tests.inc | 12 ++---
tests/vmailmgr-xconvert | 35 ++++++++++++++
vmautoconvert.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 181 insertions(+), 16 deletions(-)
create mode 100644 tests/vmailmgr-xconvert
create mode 100644 vmautoconvert.c
commit 29f315139b80cc69e6b4ddbb0e8289c034580902
Author: Bruce Guenter
Date: Fri Aug 19 21:00:18 2005 +0000
Since there is no more cvm-vmlookup module, merge vmmain.c back into
cvm-vmailmgr.c (and adjust cvm-vmailmgr.h to match).
cvm-vmailmgr-local=x | 1 -
cvm-vmailmgr-udp=x | 1 -
cvm-vmailmgr.c | 93 ++++++++++++++++++++++++++++++++++++++++-
cvm-vmailmgr.h | 3 --
cvm-vmailmgr=x | 1 -
vmmain.c | 114 ---------------------------------------------------
6 files changed, 91 insertions(+), 122 deletions(-)
delete mode 100644 vmmain.c
commit 06b0b0db32ccde56163763637cf29074d6bfa049
Author: Bruce Guenter
Date: Fri Aug 19 20:53:11 2005 +0000
Converted to use bg-installer for installation.
INSTHIER | 44 +++++++++++++++++++++++++++++++++++++++++
insthier.c | 66 --------------------------------------------------------------
spec | 17 +++++++---------
3 files changed, 51 insertions(+), 76 deletions(-)
create mode 100644 INSTHIER
delete mode 100644 insthier.c
commit 82f676a1b8ee8add2c3d585e1ea5ad77a384eec8
Author: Bruce Guenter
Date: Fri Aug 19 20:43:24 2005 +0000
Bumped version to 0.72
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit 4010efebcaa073b7115816b669c1d35887a429a7
Author: Bruce Guenter
Date: Thu Jun 2 04:55:07 2005 +0000
Add the ChangeLog to the list of "extra" website files.
makedist.py | 1 +
1 file changed, 1 insertion(+)
commit 4f76b66b4bff655dcd0137e7d6b2092e40642678
Author: Bruce Guenter
Date: Thu Jun 2 04:20:11 2005 +0000
Updated the cvm-vchkpw module. It now compiles, and should work
but remains completely untested.
NEWS | 2 ++
TOP.spac | 2 +-
cvm-vchkpw.c | 44 ++++++++++++++++++++++----------------------
cvm-vchkpw=x | 11 +++++++++++
programs.spac | 4 +++-
5 files changed, 39 insertions(+), 24 deletions(-)
create mode 100644 cvm-vchkpw=x
commit bbca084e8ec365dc385db2a3883074b72fddab10
Author: Bruce Guenter
Date: Thu Jun 2 04:02:23 2005 +0000
Initial commit of sasl_auth.c source.
sasl_auth.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 141 insertions(+)
create mode 100644 sasl_auth.c
commit 0a0918380b5147a82877524b8ad282ea95429e11
Author: Bruce Guenter
Date: Thu Jun 2 03:59:43 2005 +0000
Initial commit of the cvm-chain.html documentation page.
cvm-chain.html | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 cvm-chain.html
commit 2efdbbcb67c128bad5fe013e5075e9b979788c3c
Author: Bruce Guenter
Date: Thu Jun 2 01:39:19 2005 +0000
Set PROTO to make UCSPI variables work.
tests.inc | 1 +
1 file changed, 1 insertion(+)
commit 18612d50590bab463a4aabdea6dbda27116fefb2
Author: Bruce Guenter
Date: Thu Jun 2 01:39:00 2005 +0000
Use %{_includedir} for locaing the PostgreSQL headers.
spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 219600cc1bd52dffb347e9d3f03af0f2ec0b6621
Author: Bruce Guenter
Date: Thu Jun 2 01:38:32 2005 +0000
Added a to do note about auto-converting passwords.
TODO | 4 ++++
1 file changed, 4 insertions(+)
commit 7e8fa37fcb0358fe4f8069879cf11bc551129f33
Author: Bruce Guenter
Date: Thu Jun 2 01:38:12 2005 +0000
Rewrote v2client_wrappers to avoid static strings.
TODO | 2 --
v2client_wrappers.c | 33 +++++++++++++++++++++------------
2 files changed, 21 insertions(+), 14 deletions(-)
commit aa63ca143b93bb8251baadc102fad0ecbab474cc
Author: Bruce Guenter
Date: Thu Jun 2 01:19:28 2005 +0000
Bumped version to 0.71 for several brown-paper-bag bug fixes.
NEWS | 7 +++++++
VERSION | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
commit 6d64e106eef170a61f325e360208f172f8627e2e
Author: Bruce Guenter
Date: Thu Jun 2 01:18:49 2005 +0000
If no domain is present, use an empty one instead of crashing.
sasl_authenticate.c | 2 ++
1 file changed, 2 insertions(+)
commit aa8b6f855c7222d4f00e2f33cc8148e824bc8b85
Author: Bruce Guenter
Date: Thu Jun 2 01:17:34 2005 +0000
Use ucspi_localhost() instead of getenv("TCPLOCALHOST") to determine the
local host name.
cvm-checkpassword.c | 6 ++++--
cvm-v1checkpassword.c | 5 +++--
sasl_init.c | 3 ++-
3 files changed, 9 insertions(+), 5 deletions(-)
commit e52561c6d6e660c886ad2e8a0570330881d42b9e
Author: Bruce Guenter
Date: Thu Jun 2 01:13:21 2005 +0000
Only set sa->response if no initial response is present.
sasl_login.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit d67f1120638fe6ce754aeae5e34c7c0c1582085f
Author: Bruce Guenter
Date: Thu Jun 2 01:12:59 2005 +0000
Switched to a static response function.
sasl_plain.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
commit 0739385948e7403a10f531f0b50b3970e5c9b0ee
Author: Bruce Guenter
Date: Thu Jun 2 01:12:30 2005 +0000
Switched to a static response function.
sasl_cram_md5.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
commit 8219f9631ed20b46064345788cc383067b51d3b8
Author: Bruce Guenter
Date: Thu Jun 2 01:09:46 2005 +0000
Use multiple response functions instead of keeping state based on the
length of sa->username.
sasl_login.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
commit 6b1da0761bf8cf921f9c37d3bff95a792e58890e
Author: Bruce Guenter
Date: Thu Jun 2 01:04:26 2005 +0000
Make sure to set the username empty before starting the login process,
otherwise all logins after the first will fail.
sasl_login.c | 1 +
1 file changed, 1 insertion(+)
commit 6ebc2be95a6696485566d475987fbb8ea64cec88
Author: Bruce Guenter
Date: Wed Jun 1 23:16:14 2005 +0000
Make sure the "install" target is in the local TOP spac rule.
TOP.spac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit b063ada4d54addfb8b3b69b995256e1983b07b83
Author: Bruce Guenter
Date: Wed Jun 1 22:48:45 2005 +0000
Now requires bglibs-1.020 (format strings).
README.in | 2 +-
spec | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
commit c1eb15c2d7f38754b5737cef5a1ad2e87ccebda0
Author: Bruce Guenter
Date: Wed Jun 1 20:11:07 2005 +0000
Rewrote SASL API to eliminate static data, making it reentrant.
Bumped version up to 0.70 as a result.
NEWS | 10 +++++++---
VERSION | 2 +-
sasl.h | 25 ++++++++++++++++--------
sasl_authenticate.c | 24 +++++++++++++----------
sasl_cram_md5.c | 56 ++++++++++++++++++++++++++++-------------------------
sasl_init.c | 34 +++++++++++++++-----------------
sasl_internal.h | 20 +++++++------------
sasl_login.c | 39 +++++++++++++++++++++----------------
sasl_plain.c | 32 ++++++++++++++++++------------
sasl_start.c | 13 +++++--------
10 files changed, 139 insertions(+), 116 deletions(-)
commit 77c2a25ab6c4d21df8429e5cd00f9983012d14f3
Author: Bruce Guenter
Date: Wed Jun 1 19:42:26 2005 +0000
Added SASL generic text I/O authentication framework from mailfront.
NEWS | 2 ++
TODO | 2 ++
sasl-auth-test.c | 36 +++++++++++++++++++
cvm-benchclient=x => sasl-auth-test=x | 2 +-
sasl.h | 19 ++++++++++
sasl=l | 1 +
sasl_authenticate.c | 65 ++++++++++++++++++++++++++++++++---
tests.inc | 9 +++++
tests/sasl-eof | 8 +++++
tests/sasl-login1 | 10 ++++++
tests/sasl-login2 | 8 +++++
tests/sasl-nomech | 7 ++++
tests/sasl-plain-fail | 7 ++++
tests/sasl-plain1 | 8 +++++
tests/sasl-plain2 | 5 +++
15 files changed, 184 insertions(+), 5 deletions(-)
create mode 100644 sasl-auth-test.c
copy cvm-benchclient=x => sasl-auth-test=x (59%)
create mode 100644 tests/sasl-eof
create mode 100644 tests/sasl-login1
create mode 100644 tests/sasl-login2
create mode 100644 tests/sasl-nomech
create mode 100644 tests/sasl-plain-fail
create mode 100644 tests/sasl-plain1
create mode 100644 tests/sasl-plain2
commit 54ec21b2e76d3fa6a65e0cb49e4f3a1cc19cfe29
Author: Bruce Guenter
Date: Tue May 31 19:28:03 2005 +0000
Fixed up the SASL library to use the v2 client library.
NEWS | 1 +
1 file changed, 1 insertion(+)
commit 1be3087d15c36e58a580e77f7063bab9c319f34d
Author: Bruce Guenter
Date: Tue May 31 19:27:53 2005 +0000
Fixed up the SASL library to use the v2 client library.
sasl_cram_md5.c | 37 ++++++++++++++++++++++++++++++-------
sasl_internal.h | 4 +++-
sasl_login.c | 5 +----
sasl_plain.c | 5 +----
4 files changed, 35 insertions(+), 16 deletions(-)
commit 5f02201c047e639c0e2c97c6350af21de5f6d81b
Author: Bruce Guenter
Date: Tue May 31 19:26:54 2005 +0000
Bumped version to 0.65
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit f040a31d8142979328903171a5361c0587e120e0
Author: Bruce Guenter
Date: Tue May 31 16:51:07 2005 +0000
Clarified the CVM_CRED_RESPONSE_TYPE value semantics.
credentials.html | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
commit bede08a08b9947ad2f397bab252a9766b3122158
Author: Bruce Guenter
Date: Tue May 31 15:37:56 2005 +0000
Make the credentials parameter const, as it is not modified.
v2client.c | 4 ++--
v2client.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
commit 74e0647cc53f89d3baab50c83b4327e73fe847c2
Author: Bruce Guenter
Date: Mon May 30 05:46:34 2005 +0000
Move #include to the first in the list, as BSD needs this.
client_xfer_command.c | 2 +-
client_xfer_udp.c | 2 +-
cvm-chain.c | 2 +-
cvm-unix.c | 2 +-
cvm-vchkpw.c | 2 +-
cvm-vmailmgr.c | 2 +-
module_output.c | 2 +-
sasl_cram_md5.c | 2 +-
v1client.c | 2 +-
v2client.c | 2 +-
vmlookup.c | 2 +-
vmmain.c | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
commit 07b4a7cdfa8019c30e24c386f2e3dc1906fbe739
Author: Bruce Guenter
Date: Sun May 29 22:41:13 2005 +0000
Added test for cvm-chain.
TODO | 4 ++--
tests/chain | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 2 deletions(-)
create mode 100644 tests/chain
commit 98428778ca68ae9ecf0093b4835ed6604e5f9a82
Author: Bruce Guenter
Date: Fri May 27 23:01:19 2005 +0000
Added cvm-chain combination client/module program
(adapted from code contributed by Dale Woolridge).
NEWS | 3 ++
cvm-chain.c | 87 ++++++++++++++++++++++++++++++++++++++++
cvm-benchclient=x => cvm-chain=x | 4 +-
cvm.html | 1 +
insthier.c | 1 +
5 files changed, 95 insertions(+), 1 deletion(-)
create mode 100644 cvm-chain.c
copy cvm-benchclient=x => cvm-chain=x (64%)
commit 53b6c7ca58ba768b3c68ddfd923e5a0be057cff1
Author: Bruce Guenter
Date: Fri May 27 17:55:05 2005 +0000
Renamed client and module library symbols in the documentation.
module.html | 43 +++++++++++++++++----------------
v1client.html | 66 +++++++++++++++++++++++++-------------------------
v2client.html | 77 ++++++++++++++++++++++++++++-------------------------------
3 files changed, 92 insertions(+), 94 deletions(-)
commit b655f048ef2acc8a1e66c4aa454010a47ccd5ed8
Author: Bruce Guenter
Date: Fri May 27 17:54:43 2005 +0000
Renamed cvm_ucspi_domain to match other cvm client library functions.
client_domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 4f8789466c717d611ea7e27345e150e2dd14e218
Author: Bruce Guenter
Date: Wed May 25 23:52:01 2005 +0000
Added an #ifdef in the headers to prevent the definition of the
compatibility macros.
module.h | 2 +-
v1client.h | 2 +-
v2client.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
commit 5cd904868cbdd7d92f3fa4f4b02836854ca53f0b
Author: Bruce Guenter
Date: Wed May 25 23:37:52 2005 +0000
Major API change, bumping up the version number to 0.60.
- All module symbols are named cvm_module_*
- All client symbols are named cvm_client_*
NEWS | 10 ++++--
VERSION | 2 +-
client_setenv.c | 8 ++---
client_setugid.c | 2 +-
credentials.h | 2 +-
cvm-benchclient.c | 2 +-
cvm-checkpassword.c | 6 ++--
cvm-pwfile.c | 14 ++++----
cvm-qmail.c | 6 ++--
cvm-testclient.c | 6 ++--
cvm-unix.c | 14 ++++----
cvm-v1benchclient.c | 2 +-
cvm-v1checkpassword.c | 6 ++--
cvm-v1testclient.c | 4 +--
cvm-vmailmgr.c | 4 +--
module.h | 75 +++++++++++++++++++++++++++-------------
module_command.c | 20 +++++++----
module_local.c | 24 ++++++++-----
module_local_main.c | 2 +-
module_log.c | 24 ++++++-------
module_main.c | 2 +-
module_output.c | 48 +++++++++++++-------------
module_request.c | 95 +++++++++++++++++++++++++++------------------------
module_udp.c | 19 ++++++-----
module_udp_main.c | 2 +-
qmail-lookup.c | 11 +++---
sasl_authenticate.c | 2 +-
sasl_cram_md5.c | 2 +-
sql-auth.c | 8 ++---
sql-query-test.c | 8 ++---
sql-query.c | 8 ++---
v1client.c | 38 ++++++++++-----------
v1client.h | 39 ++++++++++++++++-----
v2client.c | 38 ++++++++++-----------
v2client.h | 51 +++++++++++++++++++--------
v2client_wrappers.c | 6 ++--
vmlookup.c | 4 +--
vmmain.c | 4 +--
38 files changed, 358 insertions(+), 260 deletions(-)
commit 81f619e2fac8c012658d42ff2915d1418a2815ff
Author: Bruce Guenter
Date: Wed May 25 19:24:31 2005 +0000
Renamed cvm_auth_{init,stop} to cvm_module_{init,stop}.
NEWS | 1 +
cvm-pwfile.c | 4 ++--
cvm-qmail.c | 4 ++--
cvm-unix.c | 4 ++--
cvm-vchkpw.c | 4 ++--
module.h | 4 ++--
module.html | 4 ++--
module_command.c | 6 +++---
module_local.c | 4 ++--
module_udp.c | 4 ++--
sql-auth.c | 4 ++--
vmmain.c | 4 ++--
12 files changed, 24 insertions(+), 23 deletions(-)
commit 736d03654370bb57b19571ed5de067b6a0a4eef2
Author: Bruce Guenter
Date: Wed May 25 18:32:20 2005 +0000
Bumped version to 0.51
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit 767a19e47b683e12b620baae6bf8ea3a8eed0c26
Author: Bruce Guenter
Date: Wed May 11 19:56:16 2005 +0000
Authenticating against cvm-qmail is nonsense, so make cvm-qmail work
only in lookup mode.
cvm-qmail.c | 3 +--
tests/qmail-lookup | 3 ++-
2 files changed, 3 insertions(+), 3 deletions(-)
commit 87a19f4f5652af4d13e37adf31012fd8a509ac8b
Author: Bruce Guenter
Date: Tue May 10 22:38:11 2005 +0000
Clear the memory for cvm_credentials just like the module code does.
sql-query-test.c | 2 ++
1 file changed, 2 insertions(+)
commit d829df457bb4f88b757dc2f92f6a1912800fb463
Author: Bruce Guenter
Date: Tue May 10 22:36:59 2005 +0000
Switched completely away from using stdio.
TODO | 4 ---
cvm-benchclient.c | 31 +++++++++--------
cvm-checkpassword.c | 11 ++++---
cvm-pwfile.c | 29 ++++++++--------
cvm-testclient.c | 67 +++++++++++++++++++++++--------------
cvm-v1benchclient.c | 31 ++++++++---------
cvm-v1checkpassword.c | 15 +++++----
cvm-v1testclient.c | 73 +++++++++++++++++++++++++----------------
module_command_main.c | 4 ++-
module_local.c | 18 +++++-----
module_local_main.c | 10 +++---
module_main.c | 13 +++++---
module_udp.c | 15 ++++++---
module_udp_main.c | 10 +++---
sql-query-test.c | 27 ++++++++-------
tests/command-bad-password | 2 +-
tests/command-bad-username | 2 +-
tests/lookup | 4 +--
tests/pwfile-local-bad-password | 2 +-
tests/pwfile-udp-bad-password | 2 +-
tests/qmail-lookup | 8 ++---
tests/v1lookup | 4 +--
tests/vmailmgr-upper-pass | 2 +-
tests/vmlookup-badpass | 2 +-
24 files changed, 219 insertions(+), 167 deletions(-)
commit c5b1c6c4c04592df71a03f3f821a4abd8efd9495
Author: Bruce Guenter
Date: Tue May 10 17:39:00 2005 +0000
Split conf-home control into conf-bin/include/lib, to help deal with
systems on which the different directories are in non-obvious places.
insthier.c | 11 ++++++-----
spec | 21 ++++++++++++---------
2 files changed, 18 insertions(+), 14 deletions(-)
commit f50028e7ae2932400a566b916539d7ce3543ba01
Author: Bruce Guenter
Date: Tue May 10 17:27:41 2005 +0000
Added notes about the rationale behind the version 2 protocol.
protocol-2.html | 11 +++++++++++
1 file changed, 11 insertions(+)
commit 93294165b14e63b866710f1526cbad25d6ceeca9
Author: Bruce Guenter
Date: Tue May 10 17:07:04 2005 +0000
Fixed some missing details in the v2client API documentation.
v2client.html | 13 +++++++++++++
1 file changed, 13 insertions(+)
commit 0fb99a401ab494a024d60e519aee785e5a01837d
Author: Bruce Guenter
Date: Tue May 10 17:06:43 2005 +0000
Updated the notes about the changes in this release.
NEWS | 11 +++++++++--
TODO | 12 +++++-------
2 files changed, 14 insertions(+), 9 deletions(-)
commit 9c2e34f23e1cf11ff83ab1f14cd7e2620a1b0a84
Author: Bruce Guenter
Date: Tue May 10 16:58:18 2005 +0000
Removed the unreferenced client.html documentation.
client.html | 101 ------------------------------------------------------------
1 file changed, 101 deletions(-)
delete mode 100644 client.html
commit e77ce356c9d5e33a8381f1023b9291b3a8591e66
Author: Bruce Guenter
Date: Tue May 10 16:58:02 2005 +0000
Updated the module API documentation.
module.html | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
commit 9aa5cc5d2e2491e878f299f07c0ca1bdb3f3125d
Author: Bruce Guenter
Date: Tue May 10 16:56:29 2005 +0000
Added tests of the v1 module compatibility mode.
tests/stop-pwfile-local | 2 +-
tests/stop-pwfile-udp | 2 +-
tests/{pwfile-local => v1local} | 2 +-
tests/{lookup => v1lookup} | 8 +++-----
tests/{pwfile-udp => v1udp} | 2 +-
5 files changed, 7 insertions(+), 9 deletions(-)
copy tests/{pwfile-local => v1local} (84%)
copy tests/{lookup => v1lookup} (88%)
copy tests/{pwfile-udp => v1udp} (84%)
commit 091a2c2901302f2fe004f0a4e2229762cd5015ab
Author: Bruce Guenter
Date: Tue May 10 16:50:42 2005 +0000
Documented the new Version 2 API.
cvm.html | 3 ++-
client.html => v1client.html | 4 ++--
client.html => v2client.html | 48 ++++++++++++++++++++++++--------------------
3 files changed, 30 insertions(+), 25 deletions(-)
copy client.html => v1client.html (97%)
copy client.html => v2client.html (71%)
commit 5cf4f41981ec93910a49ed5dcbe86ff967ff1956
Author: Bruce Guenter
Date: Tue May 10 16:43:05 2005 +0000
Modified the API for cvm_split_account to be a little more reasonable.
v2client.c | 31 +++++++++++++------------------
v2client.h | 3 +--
v2client_wrappers.c | 2 +-
3 files changed, 15 insertions(+), 21 deletions(-)
commit 53f2d9832186737773447e5408ccc5d20b05e40a
Author: Bruce Guenter
Date: Tue May 10 06:02:00 2005 +0000
Converted cvm-benchclient to the v2 API.
cvm-benchclient.c | 16 ++++++++++------
cvm-benchclient=x | 2 +-
cvm-benchclient.c => cvm-v1benchclient.c | 0
cvm-v1testclient=x => cvm-v1benchclient=x | 0
insthier.c | 3 ++-
5 files changed, 13 insertions(+), 8 deletions(-)
copy cvm-benchclient.c => cvm-v1benchclient.c (100%)
copy cvm-v1testclient=x => cvm-v1benchclient=x (100%)
commit e39e77437d4b28a0f313dea348ead810f3ddcc6f
Author: Bruce Guenter
Date: Tue May 10 05:53:09 2005 +0000
Added missing test.
tests/qmail-lookup-nodomain | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 tests/qmail-lookup-nodomain
commit 22d97b1da5173c8be71b25397dcb42fca5dfa89d
Author: Bruce Guenter
Date: Tue May 10 05:51:53 2005 +0000
Converted cvm-checkpassword to the version 2 API.
cvm-checkpassword.c | 9 +++++----
cvm-checkpassword=x | 2 +-
cvm-checkpassword.c => cvm-v1checkpassword.c | 0
cvm-v1testclient=x => cvm-v1checkpassword=x | 0
insthier.c | 1 +
5 files changed, 7 insertions(+), 5 deletions(-)
copy cvm-checkpassword.c => cvm-v1checkpassword.c (100%)
copy cvm-v1testclient=x => cvm-v1checkpassword=x (100%)
commit f5c4c7e77a7d73152ad329a1368fd139d184a0ac
Author: Bruce Guenter
Date: Mon May 9 23:39:39 2005 +0000
Dropped the now redundant cvm_authenticate_lookup wrapper function.
cvm-testclient.c | 2 +-
v2client.h | 4 ----
v2client_wrappers.c | 16 ----------------
3 files changed, 1 insertion(+), 21 deletions(-)
commit f7461c43f748d7a0979d4bdd2c966386202b35b0
Author: Bruce Guenter
Date: Mon May 9 23:38:42 2005 +0000
Modified the wrapper functions to only send across the credentials that
are not NULL or empty.
tests/pwfile-local | 2 +-
tests/pwfile-local-bad-password | 2 +-
tests/pwfile-udp | 2 +-
tests/pwfile-udp-bad-password | 2 +-
tests/stop-pwfile-local | 2 +-
tests/stop-pwfile-udp | 2 +-
v2client_wrappers.c | 37 ++++++++++++++++++++++++++-----------
7 files changed, 32 insertions(+), 17 deletions(-)
commit bf2b641e7b22a1658702d29670cbfcd887d89176
Author: Bruce Guenter
Date: Mon May 9 23:32:09 2005 +0000
Split out the API for splitting a domain name from the account name into
a seperate function.
v2client.c | 58 ++++++++++++++++++++++++++---------------------------
v2client.h | 5 +++--
v2client_wrappers.c | 11 +++++++---
3 files changed, 39 insertions(+), 35 deletions(-)
commit 37eba429fe14e62e99fd46d05d17e66c0da40ca1
Author: Bruce Guenter
Date: Mon May 9 23:16:40 2005 +0000
Fixed up tests to match current behavior.
tests.inc | 21 ++++++++++++++++++---
tests/command-bad-password | 2 +-
tests/command-bad-username | 2 +-
tests/command-case | 2 +-
tests/command-no-prefix | 2 +-
tests/command-prefix | 2 +-
tests/lookup | 18 +++++++++++++++---
tests/pwfile | 2 +-
tests/pwfile-crypt | 2 +-
tests/pwfile-local | 4 ++--
tests/pwfile-local-bad-password | 4 ++--
tests/pwfile-udp | 4 ++--
tests/pwfile-udp-bad-password | 4 ++--
tests/qmail-lookup | 2 +-
tests/start-pwfile-local | 2 +-
tests/start-pwfile-udp | 2 +-
tests/stop-pwfile-local | 2 +-
tests/stop-pwfile-udp | 2 +-
tests/vmailmgr-normal | 2 +-
tests/vmailmgr-upper-domain | 2 +-
tests/vmailmgr-upper-pass | 2 +-
tests/vmailmgr-upper-virt | 2 +-
tests/vmlookup-badpass | 4 ++--
tests/vmlookup-normal | 3 ++-
tests/vmlookup-pass | 3 ++-
tests/vmlookup-upper-domain | 3 ++-
tests/vmlookup-upper-virt | 3 ++-
27 files changed, 67 insertions(+), 36 deletions(-)
commit 6b14b418af4267265e3aca380cfd0ffb95e46533
Author: Bruce Guenter
Date: Mon May 9 23:06:43 2005 +0000
Since qmail_lookup_cvm handles the case where the domain credential is
missing, it shouldn't be marked as required in the module.
cvm-qmail.c | 1 -
1 file changed, 1 deletion(-)
commit bf7a94d39ad09bb01ae8c43f6422d1178baad16b
Author: Bruce Guenter
Date: Mon May 9 19:50:08 2005 +0000
Fixed a bug in module output where error packets would always be sent in
version 1 protocol format.
module_output.c | 11 +++++------
module_request.c | 2 +-
2 files changed, 6 insertions(+), 7 deletions(-)
commit 56c1845596833f5a9494567514d40f62f046e5fe
Author: Bruce Guenter
Date: Mon May 9 18:52:11 2005 +0000
Added plain lookup wrapper for cvm_authenticate.
cvm-testclient.c | 18 ++++++++++++++----
v2client.h | 10 +++++-----
v2client_wrappers.c | 12 ++++++++++++
3 files changed, 31 insertions(+), 9 deletions(-)
commit 8c838917f8d32cbb359300cd263ac76b4a2963f2
Author: Bruce Guenter
Date: Mon May 9 18:51:52 2005 +0000
Fixed bug with parsing the length byte in cvm_fact_str.
v2client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 08f35c9d69b233ccc681b4f5b42fb58a6450435e
Author: Bruce Guenter
Date: Mon May 9 18:19:29 2005 +0000
Fixed bug introduced with the $CVM_LOOKUP_SECRET variable.
v2client.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
commit f9356a1b18b604569897de18f505b6786a704117
Author: Bruce Guenter
Date: Mon May 9 17:49:56 2005 +0000
If $CVM_LOOKUP_SECRET is set, and no CVM_CRED_SECRET credential is
present, automatically add it to the set of credentials sent by the
client.
v2client.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
commit eb0e36bf0f92068db6a977ae2f8eb669db0b3bac
Author: Bruce Guenter
Date: Mon May 9 05:15:57 2005 +0000
Since I have committed actual code for the v2 protocol, it no longer is
really a "work in progress".
cvm.html | 3 ++-
protocol-2.html | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
commit b269b79cb813f71aa771d0742cf47614a7d2c447
Author: Bruce Guenter
Date: Mon May 9 05:11:26 2005 +0000
Added initial support for protocol v2 to client library;
fixed some related bugs in the module library.
cvm-testclient.c | 10 +-
module_output.c | 3 +-
module_request.c | 2 +-
v2client.c | 166 +++++++++++++++++++++------------
v2client.h | 27 +++++-
v2client=l | 1 +
client_domain.c => v2client_wrappers.c | 37 ++++----
7 files changed, 153 insertions(+), 93 deletions(-)
copy client_domain.c => v2client_wrappers.c (51%)
commit 18d5cc1c09796c59e86ee7c0241b2bf35982bdba
Author: Bruce Guenter
Date: Mon May 9 04:28:04 2005 +0000
Fixed potential problem with overflowing unsigned numbers.
v1client.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
commit 74b0822d6996a39db773b0bbe8086ab7973823a3
Author: Bruce Guenter
Date: Sun May 8 06:11:57 2005 +0000
Use global CVM_BUFSIZE constant.
v1client.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
commit 0495d3318fa478a084d2cbaab655cc64a856775f
Author: Bruce Guenter
Date: Sun May 8 06:09:48 2005 +0000
Move parsing the result code in the buffer into the parse_buffer routine.
v1client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 01d1f682eba537c3c5aae886e4142aea7e4adaa7
Author: Bruce Guenter
Date: Sun May 8 06:08:33 2005 +0000
Don't try to interpret the buffer in the transfer code.
client_xfer_udp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 19196d4f03c2396de81d07fdcf06da4c8536f315
Author: Bruce Guenter
Date: Sun May 8 05:57:48 2005 +0000
Renamed the soon-to-be version 2 client library to v2client, and put in
compatibility links to the version 1 client library, to allow existing
software to compile properly.
client_domain.c | 2 +-
client_setenv.c | 2 +-
client_setugid.c | 2 +-
client_xfer_command.c | 2 +-
client_xfer_local.c | 2 +-
client_xfer_udp.c | 2 +-
cvm-benchclient.c | 2 +-
cvm-benchclient=x | 2 +-
cvm-checkpassword.c | 2 +-
cvm-checkpassword=x | 2 +-
cvm-testclient.c | 2 +-
cvm-testclient=x | 2 +-
insthier.c | 6 ++++--
sasl_authenticate.c | 2 +-
sasl_cram_md5.c | 2 +-
client.c => v2client.c | 2 +-
client.h => v2client.h | 4 ++--
client=l => v2client=l | 2 +-
18 files changed, 22 insertions(+), 20 deletions(-)
rename client.c => v2client.c (99%)
rename client.h => v2client.h (94%)
rename client=l => v2client=l (91%)
commit 4acd0b6f3055a0705d3347ff5811b538b04dee9e
Author: Bruce Guenter
Date: Sun May 8 05:41:00 2005 +0000
Fixed another signed char* instance.
v1client.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
commit 38f6e8b60b02bdc203c17604c3922d5fef6cf0b5
Author: Bruce Guenter
Date: Sun May 8 05:36:11 2005 +0000
Fixed usage of global "str" type as variable name.
client_setenv.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
commit 396111a60d3efa2892b21005b3e5023698258497
Author: Bruce Guenter
Date: Sun May 8 05:02:38 2005 +0000
Broke out the command/local/UDP client-module transmission code, as this
will be identical in both protocols.
client.c | 176 +-------------------------------------------------
client.h | 12 ++++
client=l | 3 +
client_xfer_command.c | 125 +++++++++++++++++++++++++++++++++++
client_xfer_local.c | 59 +++++++++++++++++
client_xfer_udp.c | 81 +++++++++++++++++++++++
v1client.c | 176 +-------------------------------------------------
v1client.h | 16 ++++-
v1client=l | 3 +
9 files changed, 303 insertions(+), 348 deletions(-)
create mode 100644 client_xfer_command.c
create mode 100644 client_xfer_local.c
create mode 100644 client_xfer_udp.c
commit 05adb704cad84e467ec418ecfb12f0a34eec0990
Author: Bruce Guenter
Date: Sun May 8 03:43:45 2005 +0000
Saved a copy of the v1 protocol clients and API for compatibility
testing.
cvm-testclient.c => cvm-v1testclient.c | 2 +-
cvm-benchclient=x => cvm-v1testclient=x | 2 +-
insthier.c | 3 +++
client.c => v1client.c | 2 +-
client.h => v1client.h | 0
client=l => v1client=l | 2 +-
6 files changed, 7 insertions(+), 4 deletions(-)
copy cvm-testclient.c => cvm-v1testclient.c (98%)
copy cvm-benchclient=x => cvm-v1testclient=x (59%)
copy client.c => v1client.c (99%)
copy client.h => v1client.h (100%)
copy client=l => v1client=l (85%)
commit 74e38a89b8eb807734ab3d6356db8b5ac4587900
Author: Bruce Guenter
Date: Sat May 7 19:25:14 2005 +0000
Rewrote the module code to handle both v2 and v1 protocols.
NEWS | 8 +++++
VERSION | 2 +-
credentials.h | 2 ++
cvm-pwfile.c | 16 ++++-----
cvm-qmail.c | 4 +--
cvm-unix.c | 10 +++---
cvm-vmailmgr.c | 24 +++++++------
cvm.html | 2 +-
insthier.c | 3 +-
module.h | 13 ++++---
module_log.c | 17 ++++++---
module_output.c | 47 ++++++++++++++++++++----
module_request.c | 79 +++++++++++++++++++++++++++++------------
protocol-2.html | 2 ++
qmail-domains.c | 4 +--
qmail-lookup.c | 10 +++---
qmail.h | 2 +-
sql-auth.c | 9 +++--
sql-query-test.c | 8 ++---
sql-query.c | 30 +++++++++++-----
tests/lookup | 26 ++++++++++++--
tests/pwfile-local | 2 +-
tests/pwfile-local-bad-password | 2 +-
tests/pwfile-udp | 2 +-
tests/pwfile-udp-bad-password | 2 +-
tests/stop-pwfile-local | 2 +-
tests/stop-pwfile-udp | 2 +-
vmlookup.c | 2 +-
28 files changed, 231 insertions(+), 101 deletions(-)
commit bfc6a4406dd320a97b7fe57fc81ae6bd026b8cf1
Author: Bruce Guenter
Date: Fri May 6 23:04:33 2005 +0000
Rewrote the version 2 protocol to be more like version 1, for efficiency
and ease of implementation.
cvm.html | 2 +-
protocol.html => protocol-1.html | 5 ++-
protocol-2.html | 71 ++++++++++++++++++++--------------------
protocol.h | 8 +----
4 files changed, 40 insertions(+), 46 deletions(-)
rename protocol.html => protocol-1.html (98%)
commit cd6f05f25b006f6590a420c3f94ca7def0396400
Author: Bruce Guenter
Date: Fri May 6 22:54:08 2005 +0000
Cleaned up some formatting, expanded details.
errors.html | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
commit c5260923e8b7ff5d4a55125ad9215f0ed165fd63
Author: Bruce Guenter
Date: Fri May 6 22:53:26 2005 +0000
Fixed up some formatting and clarified the contents of strings.
facts.html | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
commit e415d738ad6877ecba9948f3bf7b2751d1b52582
Author: Bruce Guenter
Date: Fri May 6 07:16:55 2005 +0000
Fact numbers are effectively unsigned, so the API should match everywhere.
client.c | 18 +++++++++---------
client.h | 4 ++--
client.html | 4 ++--
module.h | 6 +++---
module.html | 4 ++--
module_output.c | 10 +++++-----
6 files changed, 23 insertions(+), 23 deletions(-)
commit 49aa052f31547f1cd3cbcc28a8669c3e9ff68b3d
Author: Bruce Guenter
Date: Fri May 6 07:00:39 2005 +0000
Missed changing one pointer to the output buffer to unsigned char type.
module_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 527c6b14792100fcc33a08ce2372ee6ed9ade23d
Author: Bruce Guenter
Date: Fri May 6 06:55:41 2005 +0000
Converted the input and output module buffers to unsigned char type.
module.h | 4 ++--
module_output.c | 2 +-
module_request.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
commit 7e503b872085d87fc284a0771d3f42291b1d6d6e
Author: Bruce Guenter
Date: Thu May 5 23:55:30 2005 +0000
Added a response type credential, to distinguish between different
challenge-response mechanisms (APOP, CRAM-MD5, etc).
credentials.h | 12 +++---------
credentials.html | 16 ++++++++++++----
2 files changed, 15 insertions(+), 13 deletions(-)
commit e33bc1355444793d49ea51b5411663e96e86de27
Author: Bruce Guenter
Date: Thu May 5 22:28:01 2005 +0000
Missed a closing ` on the load line in the comments of cvm-vchkpw.c
cvm-vchkpw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit c064fc4a83033bf7d1549199701778552f76bc8c
Author: Bruce Guenter
Date: Thu May 5 16:42:22 2005 +0000
Moved the protocol definitions into a shared header file,
in preparation for CVM2.
client.c | 5 +++--
client.h | 2 --
module.h | 2 --
module_request.c | 5 +++--
protocol.h | 13 +++++++++++++
5 files changed, 19 insertions(+), 8 deletions(-)
create mode 100644 protocol.h
commit c388ed3bd9d99fb2ee72a63740edf6e5a88cf7e4
Author: Bruce Guenter
Date: Thu May 5 15:31:55 2005 +0000
Reorganized the credentials slightly. More reorganization is on the way
to fully provide support for all challenge-response mechanisms.
credentials.h | 6 +++---
credentials.html | 32 ++++++++++++++++----------------
2 files changed, 19 insertions(+), 19 deletions(-)
commit d6516b1cd71793109abb037513095e7d3cfbc95a
Author: Bruce Guenter
Date: Thu May 5 06:12:59 2005 +0000
Renamed "str" to simply "s" to avoid conflicts with the "str" data type.
module_log.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
commit c1c2cf402c0656c44fe2a4fc0af373ca052b85b7
Author: Bruce Guenter
Date: Thu May 5 05:51:37 2005 +0000
Adjusted tests to account for the getpwnam fallback after CDB lookup
failure.
tests.inc | 2 ++
1 file changed, 2 insertions(+)
commit c3642488922acd713db7a719d98a9bfe346d3b10
Author: Bruce Guenter
Date: Thu May 5 04:21:03 2005 +0000
Fixed the cvm-pwfile documentation to say that the default password
comparison mode was plain-text instead of UNIX crypt.
cvm-pwfile.html | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
commit d8045af6afbf597dd2a3d7d32cc37b1eb82ea1bb
Author: Bruce Guenter
Date: Thu May 5 03:58:46 2005 +0000
Fixed handling qmail lookups when cdb/users exists but does not
contain all users. Thanks Dale Woolridge.
NEWS | 3 +++
qmail-users.c | 17 +++++++++++++----
2 files changed, 16 insertions(+), 4 deletions(-)
commit 37e8e6f60c95687f4f7397a8103ddc99dcdda979
Author: Bruce Guenter
Date: Wed May 4 23:23:08 2005 +0000
Fixed handling qmail lookups with missing domains by reading
control/me and control/envnoathost.
NEWS | 3 +++
qmail-init.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
qmail-lookup.c | 3 +++
qmail.h | 2 ++
tests.inc | 2 ++
5 files changed, 57 insertions(+), 1 deletion(-)
commit c84081ca55cf585e6e79facc86df06f6054d7c25
Author: Bruce Guenter
Date: Wed May 4 22:44:35 2005 +0000
Fixed handling qmail lookups of extensions containing periods.
NEWS | 2 ++
qmail-dotfile.c | 14 +++++++++-----
tests.inc | 2 ++
tests/qmail-lookup | 29 ++++++++++++++++++++++++++++-
4 files changed, 41 insertions(+), 6 deletions(-)
commit 85aace1b002eada8ce9c3816e7fb9cab4dd7fbea
Author: Bruce Guenter
Date: Wed May 4 22:12:39 2005 +0000
Added error strings analogous to sys_errlist.
client=l | 1 +
cvm-benchclient.c | 5 +++--
cvm-testclient.c | 5 +++--
errors.c | 45 +++++++++++++++++++++++++++++++++++++++++
errors.h | 3 +++
tests/command-bad-password | 2 +-
tests/command-bad-username | 2 +-
tests/lookup | 8 ++++----
tests/pwfile-local-bad-password | 2 +-
tests/pwfile-udp-bad-password | 2 +-
tests/qmail-lookup | 8 ++++----
tests/vmailmgr-upper-pass | 2 +-
tests/vmlookup-badpass | 2 +-
13 files changed, 69 insertions(+), 18 deletions(-)
create mode 100644 errors.c
commit 3464a89eae81252385281180ed5dab3948a2ecf9
Author: Bruce Guenter
Date: Tue May 3 20:53:27 2005 +0000
Conditionally install cvm-vchkpw, just like cvm-mysql and friends.
Thanks Peter Palmreuther
insthier.c | 4 ++++
1 file changed, 4 insertions(+)
commit acc529aa20cebb8d67bb26b109b9382f56644b44
Author: Bruce Guenter
Date: Tue May 3 20:51:04 2005 +0000
Added compile fix for cvm-vchkpw.
Thanks Peter Palmreuther
NEWS | 1 +
cvm-vchkpw.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
commit 75970418242f7c8df2bc1caa768003b80ae48b00
Author: Bruce Guenter
Date: Tue May 3 20:45:58 2005 +0000
Bumped up version to 0.33.
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit a1da5d34f10ba8a894ccdc5c6a826ebfbce766b6
Author: Bruce Guenter
Date: Fri Jan 14 22:09:36 2005 +0000
Also lower-case the user name when looking it up, just like qmail-local does.
NEWS | 4 ++--
qmail-users.c | 30 +++++++++++++++++-------------
tests/qmail-lookup | 27 +++++++++++++++++++++++++--
3 files changed, 44 insertions(+), 17 deletions(-)
commit 3f45e53655b5f2087ed2fae5f7710be4d4f02b16
Author: Bruce Guenter
Date: Fri Jan 14 20:47:03 2005 +0000
Fixed the .qmail-ext lookup in cvm-qmail to lower-case the "-ext" part
just like qmail-local does.
NEWS | 2 ++
qmail-dotfile.c | 10 ++++++++--
tests/qmail-lookup | 18 +++++++++++++++++-
3 files changed, 27 insertions(+), 3 deletions(-)
commit f91eda1a3db547df1f03f99ce0548f48fe9d3338
Author: Bruce Guenter
Date: Fri Jan 14 20:06:32 2005 +0000
Bumped version to 0.32
NEWS | 6 ++++++
VERSION | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit 1b727854defa0ede65046100cef9ec4f0fdaa7af
Author: Bruce Guenter
Date: Fri Jan 14 20:04:33 2005 +0000
Bumped year to 2005.
README.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit c6cf60fa4376e9e9425a10155b4626c442261961
Author: Bruce Guenter
Date: Thu Dec 2 05:29:35 2004 +0000
Rewrote and expanded the module documentation, fixing the lack of
documentation on cvm_results()
module.html | 59 +++++++++++++++++++++++++++++++++--------------------------
1 file changed, 33 insertions(+), 26 deletions(-)
commit 7e8c05c2db3f07adf9525829905185cca8c78deb
Author: Bruce Guenter
Date: Mon Nov 15 20:18:16 2004 +0000
Changed error code in the qmail code from EBADMSG to EDOM to allow
compilation on *BSD systems.
NEWS | 6 ++++++
qmail-users.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
commit ca33033de5e98a9870f817e08c568752b82da820
Author: Bruce Guenter
Date: Mon Nov 15 20:06:41 2004 +0000
Bumped version to 0.31
NEWS | 5 +++++
VERSION | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
commit 09b77ea63facb8b46cace2a42922d0a0a0222cd3
Author: Bruce Guenter
Date: Fri Nov 12 16:53:15 2004 +0000
Add distribution of the extra README files into EXTRADIST.
EXTRADIST | 2 ++
doc.dist | 1 -
2 files changed, 2 insertions(+), 1 deletion(-)
commit 3427d8e06e21a296f1cf365237d2602ea3411ab1
Author: Bruce Guenter
Date: Wed Nov 10 23:09:07 2004 +0000
Modified the behavior of lookup mode slightly: if the lookup secret is
empty, it is treated as indicating that no password is needed but still
operate in lookup mode.
cvm.html | 7 +++++--
module_request.c | 14 +++++++++-----
tests/lookup | 36 ++++++++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+), 7 deletions(-)
create mode 100644 tests/lookup
commit b6a1414f8fce90cc0e543f75dfd218d5c74cf3b6
Author: Bruce Guenter
Date: Wed Nov 10 20:36:54 2004 +0000
Updated the tests to use/test the new generic lookup mode.
tests.inc | 4 ++--
tests/qmail-lookup | 5 +----
tests/vmlookup-badpass | 2 --
tests/vmlookup-normal | 2 +-
tests/vmlookup-pass | 4 +---
tests/vmlookup-upper-domain | 2 +-
tests/vmlookup-upper-virt | 2 +-
7 files changed, 7 insertions(+), 14 deletions(-)
commit cc5f7eb0c013ea0b4922bd3238c793f27f011d63
Author: Bruce Guenter
Date: Wed Nov 10 20:36:27 2004 +0000
Updated the executable linking files and the spec to use the new unified
bglibs file.
README.in | 5 +----
cvm-benchclient=x | 2 +-
cvm-checkpassword=x | 2 +-
cvm-mysql-local=x | 3 +--
cvm-mysql-udp=x | 3 +--
cvm-mysql=x | 3 +--
cvm-pgsql-local=x | 3 +--
cvm-pgsql-udp=x | 3 +--
cvm-pgsql=x | 3 +--
cvm-pwfile=x | 2 +-
cvm-testclient=x | 2 +-
cvm-unix=x | 2 +-
cvm-vmailmgr-local=x | 14 ++------------
cvm-vmailmgr-udp=x | 14 ++------------
cvm-vmailmgr=x | 11 ++---------
spec | 2 +-
sql-query-test=x | 2 +-
17 files changed, 20 insertions(+), 56 deletions(-)
commit 7ce7718ace78ab9a64c87afd01c6632c78b4400d
Author: Bruce Guenter
Date: Wed Nov 10 20:13:31 2004 +0000
Removed the now obsoleted cvm-vmlookup lookup-only module.
NEWS | 2 ++
cvm-vmlookup.c | 35 -----------------------------------
cvm-vmlookup=x | 15 ---------------
insthier.c | 1 -
4 files changed, 2 insertions(+), 51 deletions(-)
delete mode 100644 cvm-vmlookup.c
delete mode 100644 cvm-vmlookup=x
commit 08996123e728f95509d92c969170f989df1b9629
Author: Bruce Guenter
Date: Wed Nov 10 20:12:30 2004 +0000
Replaced the "try_default" global, which is only set when doing lookups,
with the new cvm_lookup_secret run-time flag.
cvm-vmailmgr.c | 3 +--
cvm-vmailmgr.h | 1 -
vmlookup.c | 4 +++-
3 files changed, 4 insertions(+), 4 deletions(-)
commit 3e5429e0198aa299b2a0f50b0bc98fce5ee1e40d
Author: Bruce Guenter
Date: Wed Nov 10 20:11:18 2004 +0000
Made the lookup secret value an exported symbol so that modules can
adjust their behavior dependant on if lookup mode is enabled.
module.h | 1 +
module_request.c | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
commit e8bdf6f96ceb081a9a97f405dfc1c4e8a3435349
Author: Bruce Guenter
Date: Wed Nov 10 18:48:43 2004 +0000
Added documentation for the qmail and vmailmgr modules.
cvm-qmail.html | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
cvm-vmailmgr.html | 43 +++++++++++++++++++++++++++++++++++++++++++
cvm.html | 2 ++
3 files changed, 98 insertions(+)
create mode 100644 cvm-qmail.html
create mode 100644 cvm-vmailmgr.html
commit 0bc8fe5adc068b1e76f2c1442214d43d85614405
Author: Bruce Guenter
Date: Wed Nov 10 18:33:15 2004 +0000
Reformatted the "Configuration Variables" sections to be more readable.
cvm-mysql.html | 51 ++++++++++++++++++++++++++-------------------------
cvm-pgsql.html | 28 ++++++++++++++--------------
cvm-pwfile.html | 12 ++++++------
cvm-unix.html | 4 +++-
4 files changed, 49 insertions(+), 46 deletions(-)
commit b67c60695e01d557019b2f2b686f152f1a1dfc2a
Author: Bruce Guenter
Date: Wed Nov 10 17:50:05 2004 +0000
Added the README file from vmailmgr to the repository.
README.vmailmgr | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
create mode 100644 README.vmailmgr
commit f902711cc661ed54a9ec5b42d1b7a8f86d6f9454
Author: Bruce Guenter
Date: Wed Nov 10 16:41:30 2004 +0000
Added "lookup mode" common code, available in all modules.
Renamed cvm-qmaillookup to cvm-qmail, since it is no longer
lookup-specific.
Bumped the version to 0.30, as this is a major internal change.
NEWS | 10 ++++++----
VERSION | 2 +-
command=l | 1 -
cvm-qmaillookup.c => cvm-qmail.c | 15 ++-------------
cvm-qmaillookup=x => cvm-qmail=x | 0
cvm-vmailmgr.h | 1 -
cvm-vmlookup.c | 10 +---------
cvm.html | 5 +++++
insthier.c | 2 +-
local=l | 1 -
module.h | 2 +-
module.html | 21 ++++++---------------
module=l | 1 -
module_local_main.c | 3 ++-
module_main.c | 3 ++-
module_preauth.c | 6 ------
module_request.c | 33 +++++++++++++++++++++++++++------
module_udp_main.c | 3 ++-
tests.inc | 2 +-
tests/{qmaillookup => qmail-lookup} | 4 ++++
tests/vmlookup-badpass | 6 +++---
tests/vmlookup-pass | 4 ++--
udp=l | 1 -
vmmain.c | 4 +---
24 files changed, 67 insertions(+), 73 deletions(-)
rename cvm-qmaillookup.c => cvm-qmail.c (86%)
rename cvm-qmaillookup=x => cvm-qmail=x (100%)
delete mode 100644 module_preauth.c
rename tests/{qmaillookup => qmail-lookup} (97%)
commit 211c62cd9c3918d14928be2f9270715293d6444c
Author: Bruce Guenter
Date: Wed Nov 10 04:24:52 2004 +0000
The *SQL modules are no longer in a seperate package.
cvm.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 61d44c49f27fa561fb6a5ecdc97290d0dca5613b
Author: Bruce Guenter
Date: Wed Nov 10 04:24:18 2004 +0000
Added the cvm_auth_stop function and expanded the note about not exiting
to encompass all module supplied functions.
module.html | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
commit 22abecb8343490178a113da7611fbb36c6c8576b
Author: Bruce Guenter
Date: Wed Nov 10 04:22:20 2004 +0000
Make sure the HTML files get included in the tarball.
doc.dist | 1 +
1 file changed, 1 insertion(+)
commit 1ddd424d14df4a96aa3a45dbf237973f6f3b9efa
Author: Bruce Guenter
Date: Wed Nov 10 04:03:18 2004 +0000
Fixed obsoleted URL.
TODO | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 7e429d7a9335b0a2aa7735882df17095732d30a3
Author: Bruce Guenter
Date: Tue Nov 9 20:48:21 2004 +0000
Add support for substituting a predetermined domain name and user if the
given domain isn't found in locals or virtualdomains. This allows
lookups where the domain is in (more)rcpthosts to succeed even if they
aren't local domains (for cases where the server is acting as a
secondary etc).
qmail-lookup.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
commit 013f6bacf16b4fb8f091a35e0c3b126a4d1edd97
Author: Bruce Guenter
Date: Tue Nov 9 16:57:37 2004 +0000
Since these modules all call the qmail_lookup_cvm code, use the
associated qmail_lookup_init for initialization.
cvm-qmaillookup.c | 4 +---
vmlookup.c | 4 +---
vmmain.c | 1 -
3 files changed, 2 insertions(+), 7 deletions(-)
commit ed3a6b65f17426a1cc5f247a3daad98146ea9588
Author: Bruce Guenter
Date: Tue Nov 9 04:07:22 2004 +0000
Make sure the new cvm-qmaillookup module gets installed too.
spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 31262fd78802da8d4e224b8589525decf12f855e
Author: Bruce Guenter
Date: Mon Nov 8 19:51:36 2004 +0000
Added cvm-qmaillookup to installed modules.
insthier.c | 1 +
1 file changed, 1 insertion(+)
commit a8bc5300d208a4143d15114cef565cd42a124738
Author: Bruce Guenter
Date: Mon Nov 8 18:47:08 2004 +0000
Reworked the tests framework for vmailmgr,
and added tests for cvm-qmaillookup
tests.inc | 34 +++++++++++++++--
tests/build-qmail | 22 -----------
tests/del-qmail | 5 ---
tests/qmaillookup | 93 +++++++++++++++++++++++++++++++++++++++++++++
tests/vmailmgr-normal | 11 +++---
tests/vmailmgr-upper-domain | 11 +++---
tests/vmailmgr-upper-pass | 1 -
tests/vmailmgr-upper-virt | 11 +++---
tests/vmlookup-badpass | 1 -
tests/vmlookup-normal | 11 +++---
tests/vmlookup-pass | 11 +++---
tests/vmlookup-upper-domain | 11 +++---
tests/vmlookup-upper-virt | 11 +++---
13 files changed, 159 insertions(+), 74 deletions(-)
delete mode 100644 tests/build-qmail
delete mode 100644 tests/del-qmail
create mode 100644 tests/qmaillookup
commit 0c3c04ba05cd75d548f0bfc9b921799762425a70
Author: Bruce Guenter
Date: Mon Nov 8 18:39:28 2004 +0000
System users (as indicated by not having a "dash" in the users
structure) do not need a .qmail file to be considered to exist.
However, it is invalid to try to add an extension to them.
qmail-dotfile.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
commit 84cd09336f932a0d28e243c2cc8e8a1d30f97c03
Author: Bruce Guenter
Date: Mon Nov 8 17:30:12 2004 +0000
Add the README.vmailmgr and README.vchkpw files to the distribution
archive.
doc.dist | 1 +
1 file changed, 1 insertion(+)
create mode 100644 doc.dist
commit 7f25e38bdbc685470a87718742db2f6061ecc8e9
Author: Bruce Guenter
Date: Sat Nov 6 15:42:12 2004 +0000
Added note about the qmail code rewrite.
NEWS | 3 +++
1 file changed, 3 insertions(+)
commit 2415672df56a03f5206b1c3e7bef5c489dfb909e
Author: Bruce Guenter
Date: Sat Nov 6 15:41:03 2004 +0000
Added new cvm-qmaillookup module, which can be used to verify validity
of recipient addresses on qmail systems.
NEWS | 3 ++
cvm-qmaillookup.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
cvm-qmaillookup=x | 5 +++
3 files changed, 105 insertions(+)
create mode 100644 cvm-qmaillookup.c
create mode 100644 cvm-qmaillookup=x
commit d1429b400cf07d6a7ad2262287d3abfde3728701
Author: Bruce Guenter
Date: Sat Nov 6 15:37:44 2004 +0000
Add support for default/alias delivery.
qmail-users.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
commit a77360c91eef3572517f17d62dba8627bbfa1847
Author: Bruce Guenter
Date: Sat Nov 6 15:36:51 2004 +0000
Renamed qmail_vdomains_* to qmail_domains_* and added control/local
lookups, which makes the qmail looks completely compliant with qmail.
qmail-vdomains.c => qmail-domains.c | 71 ++++++++++++++++++++++++++-----------
qmail-lookup.c | 19 +++++-----
qmail.h | 6 ++--
qmail=l | 2 +-
tests/build-qmail | 1 +
vmlookup.c | 2 +-
6 files changed, 67 insertions(+), 34 deletions(-)
rename qmail-vdomains.c => qmail-domains.c (56%)
commit b83b55a0578a56a8b5d7632ab38cca3f803c48ac
Author: Bruce Guenter
Date: Sat Nov 6 15:35:40 2004 +0000
Added error checking on str_* return codes.
qmail-dotfile.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
commit e671bf836a845c126601c03d166ad41016233a04
Author: Bruce Guenter
Date: Fri Nov 5 22:44:05 2004 +0000
Rewrote the lookup_reinit, lookup_domain, lookup_baseuser, and
lookup_virtuser to use the newly created qmail_lookup_cvm routine.
cvm-vmailmgr.h | 3 ---
vmlookup.c | 43 ++++++++-----------------------------------
vmmain.c | 3 ---
3 files changed, 8 insertions(+), 41 deletions(-)
commit 87e85153257f5bd26f76de8ad1f2035452dc0179
Author: Bruce Guenter
Date: Fri Nov 5 22:35:08 2004 +0000
Instead of calling vpwentry_auth from within the (custom) qmail lookup
code, use a cvm_preauth routine to specifically handle the lookup module
case (for cvm-vmlookup, unneeded in cvm-vmailmgr).
cvm-vmailmgr.c | 11 ++++-------
cvm-vmailmgr.h | 3 +--
cvm-vmlookup.c | 9 ++++++---
vmlookup.c | 8 ++++----
vmmain.c | 8 ++------
5 files changed, 17 insertions(+), 22 deletions(-)
commit 39efd003bf6d26f24f91b1108d4b5d87cdd85514
Author: Bruce Guenter
Date: Fri Nov 5 22:17:33 2004 +0000
Updated this documentation to reflect the current calling sequence.
module.html | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
commit ebda35bbc3309c46b20f260301d60224b018fdd7
Author: Bruce Guenter
Date: Fri Nov 5 22:16:35 2004 +0000
Added an optional cvm_preauth call before doing account lookups.
command=l | 1 +
local=l | 1 +
module.h | 1 +
module.html | 9 +++++++++
module=l | 1 +
module_preauth.c | 6 ++++++
module_request.c | 1 +
udp=l | 1 +
8 files changed, 21 insertions(+)
create mode 100644 module_preauth.c
commit dd1f24db82f1c27152925aba3f1dc405f67e0b64
Author: Bruce Guenter
Date: Fri Nov 5 18:39:21 2004 +0000
Added qmail dotfile ($HOME/.qmail*) and generic lookup functions.
qmail-dotfile.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
qmail-lookup.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
qmail.h | 8 +++++++
qmail=l | 2 ++
4 files changed, 140 insertions(+)
create mode 100644 qmail-dotfile.c
create mode 100644 qmail-lookup.c
commit a16a4478e9ed60ce346dc0e622d7cf3c6f8515b5
Author: Bruce Guenter
Date: Fri Nov 5 18:38:19 2004 +0000
Updated file header comments.
vmlookup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit ba5f465937e0b1575df012484e5a51f6aed22d69
Author: Bruce Guenter
Date: Fri Nov 5 04:21:48 2004 +0000
Broke the vmailmgr lookup code into three parts:
1) qmail virtualdomains lookups
2) qmail users/cdb lookups
3) vmailmgr password table lookups
cvm-vmailmgr-local=x | 1 +
cvm-vmailmgr-udp=x | 1 +
cvm-vmailmgr.h | 5 +-
cvm-vmailmgr=x | 1 +
cvm-vmlookup=x | 1 +
module_command_main.c => qmail-init.c | 17 ++-
qmail-users.c | 178 +++++++++++++++++++++++++++
qmail-vdomains.c | 94 +++++++++++++++
qmail.h | 29 +++++
qmail=l | 3 +
vmlookup.c | 218 +++++-----------------------------
vmmain.c | 15 ++-
12 files changed, 356 insertions(+), 207 deletions(-)
copy module_command_main.c => qmail-init.c (71%)
create mode 100644 qmail-users.c
create mode 100644 qmail-vdomains.c
create mode 100644 qmail.h
create mode 100644 qmail=l
commit 7450c7ec570c6d48ed491c2a4dbf31e79b88304b
Author: Bruce Guenter
Date: Thu Nov 4 18:06:06 2004 +0000
Fixed cvm/module.h header file include problem.
Thanks Paul Jarc for pointing this out.
NEWS | 3 +++
cvm-vmailmgr.c | 2 +-
cvm-vmlookup.c | 2 +-
sql-auth.c | 2 +-
sql-query.c | 4 ++--
vmlookup.c | 2 +-
vmmain.c | 2 +-
7 files changed, 10 insertions(+), 7 deletions(-)
commit d07f47f56f4dfd1b88c44af11b5448ddb973d12f
Author: Bruce Guenter
Date: Thu Nov 4 16:47:24 2004 +0000
Bumped version to 0.25
NEWS | 5 +++++
VERSION | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
commit b85ac56c4ac89121c3313f5c561ea6943f7a378f
Author: Bruce Guenter
Date: Thu Nov 4 03:47:55 2004 +0000
Added -I/usr/include/pgsql flag needed in some build environments.
spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 7647fe0a48f24a0da5b36e810261b9346e3d26e7
Author: Bruce Guenter
Date: Thu Nov 4 00:13:39 2004 +0000
Switch to newer "tail -n #" usage.
tests/pwfile-local | 2 +-
tests/pwfile-local-bad-password | 2 +-
tests/pwfile-udp | 2 +-
tests/pwfile-udp-bad-password | 2 +-
tests/stop-pwfile-local | 2 +-
tests/stop-pwfile-udp | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
commit 43d99f307354c1f31eb25f0af8717eff4b34a9b0
Author: Bruce Guenter
Date: Sat Feb 21 05:36:17 2004 +0000
Fixed a bug in client.c that prevented at least OpenBSD from using UDP
modules. Thanks Balazs Nagy.
NEWS | 3 +++
client.c | 3 +--
2 files changed, 4 insertions(+), 2 deletions(-)
commit d03ce34cad3e7ab64b66a2cc7af7280b97d58b06
Author: Bruce Guenter
Date: Tue Feb 10 20:28:20 2004 +0000
Added cvm-vchkpw README from Sebastian Benoit
README.vchkpw | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 README.vchkpw
commit ef4f167044211da9560883187dc3434b64128ef8
Author: Bruce Guenter
Date: Tue Feb 10 19:29:03 2004 +0000
Added comments from Sebastian Benoit
cvm-vchkpw.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
commit bc66fb533d91d10873dbd4f8e41dfff9823c1dff
Author: Bruce Guenter
Date: Tue Feb 10 19:22:31 2004 +0000
Treat cvm_fact_shell as optional (as defined by facts.html) instead of
required.
NEWS | 3 +++
module_request.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
commit de75551505d3f719b931afc407bd834b6cfb53ed
Author: Bruce Guenter