diff options
Diffstat (limited to 'debian/patches/tac_add_attrib_return_error.patch')
-rw-r--r-- | debian/patches/tac_add_attrib_return_error.patch | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/debian/patches/tac_add_attrib_return_error.patch b/debian/patches/tac_add_attrib_return_error.patch new file mode 100644 index 0000000..a886698 --- /dev/null +++ b/debian/patches/tac_add_attrib_return_error.patch @@ -0,0 +1,101 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -41,7 +41,7 @@ libtac/lib/xalloc.c \ + libtac/lib/xalloc.h \ + $(libtac_include_HEADERS) + libtac_la_CFLAGS = $(AM_CFLAGS) -Ilibtac/include +-libtac_la_LDFLAGS = -version-info 1:0:0 -shared ++libtac_la_LDFLAGS = -version-info 3:0:0 -shared + + moduledir = @pamdir@ + module_LTLIBRARIES = pam_tacplus.la +--- a/libtac/include/libtac.h ++++ b/libtac/include/libtac.h +@@ -95,15 +95,16 @@ struct areply { + * all negative, tacplus status codes are >= 0 + */ + +-#define LIBTAC_STATUS_ASSEMBLY_ERR -1 +-#define LIBTAC_STATUS_PROTOCOL_ERR -2 +-#define LIBTAC_STATUS_READ_TIMEOUT -3 +-#define LIBTAC_STATUS_WRITE_TIMEOUT -4 +-#define LIBTAC_STATUS_WRITE_ERR -5 +-#define LIBTAC_STATUS_SHORT_HDR -6 +-#define LIBTAC_STATUS_SHORT_BODY -7 +-#define LIBTAC_STATUS_CONN_TIMEOUT -8 +-#define LIBTAC_STATUS_CONN_ERR -9 ++#define LIBTAC_STATUS_ASSEMBLY_ERR -1 ++#define LIBTAC_STATUS_PROTOCOL_ERR -2 ++#define LIBTAC_STATUS_READ_TIMEOUT -3 ++#define LIBTAC_STATUS_WRITE_TIMEOUT -4 ++#define LIBTAC_STATUS_WRITE_ERR -5 ++#define LIBTAC_STATUS_SHORT_HDR -6 ++#define LIBTAC_STATUS_SHORT_BODY -7 ++#define LIBTAC_STATUS_CONN_TIMEOUT -8 ++#define LIBTAC_STATUS_CONN_ERR -9 ++#define LIBTAC_STATUS_ATTRIB_TOO_LONG -10 + + /* Runtime flags */ + +@@ -138,7 +139,7 @@ int tac_cont_send(int, char *); + HDR *_tac_req_header(u_char, int); + void _tac_crypt(u_char *, HDR *, int); + u_char *_tac_md5_pad(int, HDR *); +-void tac_add_attrib(struct tac_attrib **, char *, char *); ++int tac_add_attrib(struct tac_attrib **, char *, char *); + void tac_free_attrib(struct tac_attrib **); + char *tac_acct_flag2str(int); + int tac_acct_send(int, int, const char *, char *, char *, +@@ -151,7 +152,7 @@ char *_tac_check_header(HDR *, int); + int tac_author_send(int, const char *, char *, char *, + struct tac_attrib *); + int tac_author_read(int, struct areply *); +-void tac_add_attrib_pair(struct tac_attrib **, char *, char, ++int tac_add_attrib_pair(struct tac_attrib **, char *, char, + char *); + int tac_read_wait(int, int, int, int *); + +--- a/libtac/lib/attrib.c ++++ b/libtac/lib/attrib.c +@@ -23,11 +23,11 @@ + #include "libtac.h" + #include "xalloc.h" + +-void tac_add_attrib(struct tac_attrib **attr, char *name, char *value) { +- tac_add_attrib_pair(attr, name, '=', value); ++int tac_add_attrib(struct tac_attrib **attr, char *name, char *value) { ++ return tac_add_attrib_pair(attr, name, '=', value); + } + +-void tac_add_attrib_pair(struct tac_attrib **attr, char *name, char sep, char *value) { ++int tac_add_attrib_pair(struct tac_attrib **attr, char *name, char sep, char *value) { + struct tac_attrib *a; + size_t l1 = strlen(name); + size_t l2; +@@ -37,7 +37,7 @@ void tac_add_attrib_pair(struct tac_attr + TACSYSLOG((LOG_WARNING,\ + "%s: attribute `%s' exceeds max. %d characters, skipping",\ + __FUNCTION__, name, TAC_PLUS_ATTRIB_MAX_LEN-1)) +- return; ++ return LIBTAC_STATUS_ATTRIB_TOO_LONG; + } + + total_len = l1 + 1; /* "name" + "sep" */ +@@ -52,7 +52,7 @@ void tac_add_attrib_pair(struct tac_attr + TACSYSLOG((LOG_WARNING,\ + "%s: attribute `%s' total length exceeds %d characters, skipping",\ + __FUNCTION__, name, TAC_PLUS_ATTRIB_MAX_LEN)) +- return; ++ return LIBTAC_STATUS_ATTRIB_TOO_LONG; + } + + total_len += l2; +@@ -85,6 +85,8 @@ void tac_add_attrib_pair(struct tac_attr + } + *(a->attr+total_len) = '\0'; /* add 0 for safety */ + a->next = NULL; /* make sure it's null */ ++ ++ return 0; + } + + void tac_free_attrib(struct tac_attrib **attr) { |