Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
net-snmp
> net-snmp-5.3.0.1_empty_smux_peer_password.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File net-snmp-5.3.0.1_empty_smux_peer_password.patch of Package net-snmp (Revision 2)
Currently displaying revision
2
,
show latest
---------------------------------------------------------------------- r15943 (orig r15942): dts12 | 2007-03-12 20:47:26 +0100 Changed paths: M /upstream/branches/V5-2-patches/net-snmp/agent/mibgroup/smux/smux.c M /upstream/branches/V5-3-patches/net-snmp/agent/mibgroup/smux/smux.c M /upstream/branches/V5-4-patches/net-snmp/agent/mibgroup/smux/smux.c M /upstream/trunk/net-snmp/agent/mibgroup/smux/smux.c CHANGES: snmpd: PATCHES: 1659623: Handle SMUX peers with an empty password. ---------------------------------------------------------------------- === agent/mibgroup/smux/smux.c ================================================================== --- agent/mibgroup/smux/smux.c (revision 15942) +++ agent/mibgroup/smux/smux.c (revision 15943) @@ -150,42 +150,40 @@ config_perror("Too many smuxpeers"); return; } - aptr->sa_active_fd = -1; - if (!cptr) { - /* - * null passwords OK - */ - Auths[nauths++] = aptr; - DEBUGMSGTL(("smux_conf", "null password\n")); - return; - } /* * oid */ - password_cptr = strchr(cptr, ' '); - cptr_len = strlen(cptr); - if (password_cptr) - *password_cptr = 0x0; - + aptr->sa_active_fd = -1; aptr->sa_oid_len = MAX_OID_LEN; read_objid( cptr, aptr->sa_oid, &aptr->sa_oid_len ); - DEBUGMSGTL(("smux_conf", "parsing registration for: %s\n", cptr)); - if ((&password_cptr - &cptr + 1) < cptr_len) { - cptr = ++password_cptr; - DEBUGMSGTL(("smux_conf", "password is: %s\n", - cptr ? cptr : "NULL")); - } + password_cptr = strchr(cptr, ' '); + cptr_len = strlen(cptr); - /* - * password - */ - if (cptr) - strcpy(aptr->sa_passwd, cptr); + if (password_cptr != NULL) { /* Do we have a password or not? */ + *password_cptr = 0x0; + if ((password_cptr - cptr + 1) < cptr_len) { + cptr = ++password_cptr; + DEBUGMSGTL(("smux_conf", "password is: %s\n", + cptr ? cptr : "NULL")); + } + /* + * password + */ + if (cptr) + strcpy(aptr->sa_passwd, cptr); + } else { + /* + * null passwords OK + */ + DEBUGMSGTL(("smux_conf", "null password\n")); + } + Auths[nauths++] = aptr; + return; } void