~ubuntu-branches/ubuntu/utopic/libpam-tacplus/utopic

« back to all changes in this revision

Viewing changes to libtac/lib/author_s.c

  • Committer: Package Import Robot
  • Author(s): Jeroen Nijhof
  • Date: 2014-01-31 12:32:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140131123200-slruika7jmfmyfp6
Tags: 1.3.8-1
* New upstream release.
* Fixed pam-configs. Closes: #717716
* Added dh-autoreconf. Closes: #734228

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * See `CHANGES' file for revision history.
20
20
 */
21
21
 
22
 
#include "tacplus.h"
23
22
#include "libtac.h"
24
23
#include "xalloc.h"
25
24
 
33
32
 *         LIBTAC_STATUS_WRITE_TIMEOUT (pending impl)
34
33
 *         LIBTAC_STATUS_ASSEMBLY_ERR  (pending impl)
35
34
 */
36
 
int tac_author_send(int fd, const char *user, char *tty, char *rem_addr,
 
35
int tac_author_send(int fd, const char *user, char *tty, char *r_addr,
37
36
    struct tac_attrib *attr) {
38
37
 
39
38
    HDR *th;
40
39
    struct author tb;
41
 
    u_char user_len, port_len, rem_addr_len;
 
40
    u_char user_len, port_len, r_addr_len;
42
41
    struct tac_attrib *a;
43
42
    int i = 0;              /* attributes count */
44
43
    int pkt_len = 0;    /* current packet length */
56
55
 
57
56
    TACDEBUG((LOG_DEBUG, "%s: user '%s', tty '%s', rem_addr '%s', encrypt: %s", \
58
57
        __FUNCTION__, user, \
59
 
        tty, rem_addr, tac_encryption ? "yes" : "no"))
 
58
        tty, r_addr, tac_encryption ? "yes" : "no"))
60
59
    
61
60
    user_len = (u_char) strlen(user);
62
61
    port_len = (u_char) strlen(tty);
63
 
    rem_addr_len = (u_char) strlen(rem_addr);
 
62
    r_addr_len = (u_char) strlen(r_addr);
64
63
 
65
64
    tb.authen_method = tac_authen_method;
66
65
    tb.priv_lvl = tac_priv_lvl;
79
78
    tb.service = tac_authen_service;
80
79
    tb.user_len = user_len;
81
80
    tb.port_len = port_len;
82
 
    tb.rem_addr_len = rem_addr_len;
 
81
    tb.r_addr_len = r_addr_len;
83
82
 
84
83
    /* allocate packet */
85
84
    pkt = (u_char *) xcalloc(1, TAC_AUTHOR_REQ_FIXED_FIELDS_SIZE);
125
124
    /* fill user and port fields */
126
125
    PUTATTR(user, user_len)
127
126
    PUTATTR(tty, port_len)
128
 
    PUTATTR(rem_addr, rem_addr_len)
 
127
    PUTATTR(r_addr, r_addr_len)
129
128
 
130
129
    /* fill attributes */
131
130
    a = attr;