diff options
author | Jeroen Nijhof <jeroen@jeroennijhof.nl> | 2012-03-18 14:47:55 +0100 |
---|---|---|
committer | Jeroen Nijhof <jeroen@jeroennijhof.nl> | 2012-03-18 14:47:55 +0100 |
commit | f467ae338eeef5b0f9f19cc40add51fac3bf252e (patch) | |
tree | 1074c935558b7a6ae8831e354fcebdbab1619701 /libtac | |
parent | 7bcf688493641bb5762a3fa67454e604158f8255 (diff) | |
download | pam_tacplus-f467ae338eeef5b0f9f19cc40add51fac3bf252e.tar.gz pam_tacplus-f467ae338eeef5b0f9f19cc40add51fac3bf252e.zip |
Changed e-mail and improved accounting
Diffstat (limited to 'libtac')
-rw-r--r-- | libtac/include/cdefs.h | 2 | ||||
-rw-r--r-- | libtac/include/libtac.h | 7 | ||||
-rw-r--r-- | libtac/include/tacplus.h | 2 | ||||
-rw-r--r-- | libtac/lib/acct_r.c | 4 | ||||
-rw-r--r-- | libtac/lib/acct_s.c | 21 | ||||
-rw-r--r-- | libtac/lib/attrib.c | 2 | ||||
-rw-r--r-- | libtac/lib/authen_r.c | 2 | ||||
-rw-r--r-- | libtac/lib/authen_s.c | 2 | ||||
-rw-r--r-- | libtac/lib/author_r.c | 2 | ||||
-rw-r--r-- | libtac/lib/author_s.c | 2 | ||||
-rw-r--r-- | libtac/lib/connect.c | 2 | ||||
-rw-r--r-- | libtac/lib/cont_s.c | 2 | ||||
-rw-r--r-- | libtac/lib/crypt.c | 2 | ||||
-rw-r--r-- | libtac/lib/hdr_check.c | 2 | ||||
-rw-r--r-- | libtac/lib/header.c | 2 | ||||
-rw-r--r-- | libtac/lib/messages.c | 2 | ||||
-rw-r--r-- | libtac/lib/messages.h | 2 | ||||
-rw-r--r-- | libtac/lib/version.c | 2 | ||||
-rw-r--r-- | libtac/lib/xalloc.c | 2 | ||||
-rw-r--r-- | libtac/lib/xalloc.h | 2 |
20 files changed, 41 insertions, 25 deletions
diff --git a/libtac/include/cdefs.h b/libtac/include/cdefs.h index 2297d93..98ae7a5 100644 --- a/libtac/include/cdefs.h +++ b/libtac/include/cdefs.h @@ -1,7 +1,7 @@ /* cdefs.h * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/include/libtac.h b/libtac/include/libtac.h index d7a2071..2e1881f 100644 --- a/libtac/include/libtac.h +++ b/libtac/include/libtac.h @@ -1,7 +1,7 @@ /* libtac.h * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 @@ -132,9 +132,10 @@ extern void _tac_crypt(u_char *buf, HDR *th, int length); extern u_char *_tac_md5_pad(int len, HDR *hdr); extern void tac_add_attrib(struct tac_attrib **attr, char *name, char *value); extern void tac_free_attrib(struct tac_attrib **attr); -extern int tac_account_send(int fd, int type, const char *user, char *tty, char *rem_addr, +extern char *tac_acct_flag2str(int flag); +extern int tac_acct_send(int fd, int type, const char *user, char *tty, char *rem_addr, struct tac_attrib *attr); -extern int tac_account_read(int fd, struct areply *arep); +extern int tac_acct_read(int fd, struct areply *arep); extern void *xcalloc(size_t nmemb, size_t size); extern void *xrealloc(void *ptr, size_t size); extern char *_tac_check_header(HDR *th, int type); diff --git a/libtac/include/tacplus.h b/libtac/include/tacplus.h index 0838325..b5bc1a7 100644 --- a/libtac/include/tacplus.h +++ b/libtac/include/tacplus.h @@ -1,7 +1,7 @@ /* tacplus.h * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/acct_r.c b/libtac/lib/acct_r.c index ff651d3..45e1c5a 100644 --- a/libtac/lib/acct_r.c +++ b/libtac/lib/acct_r.c @@ -1,7 +1,7 @@ /* acct_r.c - Read accounting reply from server. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 @@ -33,7 +33,7 @@ * LIBTAC_STATUS_PROTOCOL_ERR * >= 0 : server response, see TAC_PLUS_AUTHEN_STATUS_... */ -int tac_account_read(int fd, struct areply *re) { +int tac_acct_read(int fd, struct areply *re) { HDR th; struct acct_reply *tb = NULL; int len_from_header, r, len_from_body; diff --git a/libtac/lib/acct_s.c b/libtac/lib/acct_s.c index 51d2715..f297530 100644 --- a/libtac/lib/acct_s.c +++ b/libtac/lib/acct_s.c @@ -1,7 +1,7 @@ /* acct_s.c - Send accounting event information to server. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 @@ -23,6 +23,21 @@ #include "libtac.h" #include "xalloc.h" +char *tac_acct_flag2str(int flag) { + switch(flag) { + case TAC_PLUS_ACCT_FLAG_MORE: + return "more"; + case TAC_PLUS_ACCT_FLAG_START: + return "start"; + case TAC_PLUS_ACCT_FLAG_STOP: + return "stop"; + case TAC_PLUS_ACCT_FLAG_WATCHDOG: + return "update"; + default: + return "unknown"; + } +} + /* * return value: * 0 : success @@ -31,7 +46,7 @@ * LIBTAC_STATUS_WRITE_TIMEOUT (pending impl) * LIBTAC_STATUS_ASSEMBLY_ERR (pending impl) */ -int tac_account_send(int fd, int type, const char *user, char *tty, +int tac_acct_send(int fd, int type, const char *user, char *tty, char *rem_addr, struct tac_attrib *attr) { HDR *th; @@ -55,7 +70,7 @@ int tac_account_send(int fd, int type, const char *user, char *tty, TACDEBUG((LOG_DEBUG, "%s: user '%s', tty '%s', rem_addr '%s', encrypt: %s, type: %s", \ __FUNCTION__, user, tty, rem_addr, \ (tac_encryption) ? "yes" : "no", \ - (type == TAC_PLUS_ACCT_FLAG_START) ? "START" : "STOP")) + tac_acct_flag2str(type))) user_len=(u_char) strlen(user); port_len=(u_char) strlen(tty); diff --git a/libtac/lib/attrib.c b/libtac/lib/attrib.c index f409796..adba6d7 100644 --- a/libtac/lib/attrib.c +++ b/libtac/lib/attrib.c @@ -2,7 +2,7 @@ * for accounting and authorization functions. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/authen_r.c b/libtac/lib/authen_r.c index 7d54cbc..566b747 100644 --- a/libtac/lib/authen_r.c +++ b/libtac/lib/authen_r.c @@ -1,7 +1,7 @@ /* authen_r.c - Read authentication reply from server. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/authen_s.c b/libtac/lib/authen_s.c index 4983a01..c987c1f 100644 --- a/libtac/lib/authen_s.c +++ b/libtac/lib/authen_s.c @@ -1,7 +1,7 @@ /* authen_s.c - Send authentication request to the server. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/author_r.c b/libtac/lib/author_r.c index 915d7fd..43531a2 100644 --- a/libtac/lib/author_r.c +++ b/libtac/lib/author_r.c @@ -1,7 +1,7 @@ /* author_r.c - Reads authorization reply from the server. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/author_s.c b/libtac/lib/author_s.c index c82d6e4..627acb9 100644 --- a/libtac/lib/author_s.c +++ b/libtac/lib/author_s.c @@ -1,7 +1,7 @@ /* author_s.c - Send authorization request to the server. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/connect.c b/libtac/lib/connect.c index 15dc756..ef4d706 100644 --- a/libtac/lib/connect.c +++ b/libtac/lib/connect.c @@ -1,7 +1,7 @@ /* connect.c - Open connection to server. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/cont_s.c b/libtac/lib/cont_s.c index 8382bc5..b155cdc 100644 --- a/libtac/lib/cont_s.c +++ b/libtac/lib/cont_s.c @@ -1,6 +1,6 @@ /* cont_s.c - Send continue request to the server. * - * Copyright (C) 2010, Jeroen Nijhof <jeroen@nijhofnet.nl> + * Copyright (C) 2010, Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/crypt.c b/libtac/lib/crypt.c index 51ea669..04d29a6 100644 --- a/libtac/lib/crypt.c +++ b/libtac/lib/crypt.c @@ -1,7 +1,7 @@ /* crypt.c - TACACS+ encryption related functions * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/hdr_check.c b/libtac/lib/hdr_check.c index 75c13d4..3766744 100644 --- a/libtac/lib/hdr_check.c +++ b/libtac/lib/hdr_check.c @@ -1,7 +1,7 @@ /* hdr_check.c - Perform basic sanity checks on received packet. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/header.c b/libtac/lib/header.c index 1ae5c17..393ce7a 100644 --- a/libtac/lib/header.c +++ b/libtac/lib/header.c @@ -1,7 +1,7 @@ /* header.c - Create pre-filled header for TACACS+ request. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/messages.c b/libtac/lib/messages.c index d24a809..0c77df3 100644 --- a/libtac/lib/messages.c +++ b/libtac/lib/messages.c @@ -1,7 +1,7 @@ /* messages.c - Various messages returned to user. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/messages.h b/libtac/lib/messages.h index 041195f..a7c34e9 100644 --- a/libtac/lib/messages.h +++ b/libtac/lib/messages.h @@ -1,7 +1,7 @@ /* messages.h * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/version.c b/libtac/lib/version.c index 16c8c7b..470be16 100644 --- a/libtac/lib/version.c +++ b/libtac/lib/version.c @@ -1,7 +1,7 @@ /* version.c - TACACS+ library version. * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/xalloc.c b/libtac/lib/xalloc.c index a8e8302..de6a5fb 100644 --- a/libtac/lib/xalloc.c +++ b/libtac/lib/xalloc.c @@ -2,7 +2,7 @@ * Taken from excellent glibc.info ;) * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 diff --git a/libtac/lib/xalloc.h b/libtac/lib/xalloc.h index 3573567..79b12f9 100644 --- a/libtac/lib/xalloc.h +++ b/libtac/lib/xalloc.h @@ -1,7 +1,7 @@ /* xalloc.h * * Copyright (C) 2010, Pawel Krawczyk <pawel.krawczyk@hush.com> and - * Jeroen Nijhof <jeroen@nijhofnet.nl> + * Jeroen Nijhof <jeroen@jeroennijhof.nl> * * 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 |