~ubuntu-branches/ubuntu/precise/net-snmp/precise

« back to all changes in this revision

Viewing changes to agent/mibgroup/ucd-snmp/pass.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-28 14:59:36 UTC
  • mfrom: (1.2.3 upstream) (1.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100628145936-cbiallic69pn044g
Tags: 5.4.3~dfsg-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Set Ubuntu maintainer address.
  - net-snmp-config: Use bash. (LP: #104738)
  - Removed multiuser option when calling update-rc.d. (LP: #254261)
  - debian/snmpd.init: LSBify the init script.
  - debian/patches/52_fix_snmpcmd_1_typo.patch: Adjust a typo in snmpcmd.1
    (LP: #250459)
  - debian/snmpd.postinst: source debconf before doing work, LP: #589056
  - debian/snmp.preinst, debian/snmp.prerm: kill any/all processes owned by
    snmp user before install/uninstall, LP: #573391
  - Add apport hook (LP: #533603):
  - debian/{snmp,snmpd}.apport: Added.
  - debian/control: Build-depends on dh-apport.
  - debian/rules: 
    + Add --with apport.
    + override_dh_apport to install hook on snmpd package only.
 * Dropped patches:
   - debian/patches/99-fix-ubuntu-div0.patch: Fix dvision by zero.. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
287
287
    oid             newname[MAX_OID_LEN];
288
288
    int             i, rtest, fd, newlen;
289
289
    static long     long_ret;
 
290
    static in_addr_t addr_ret;
290
291
    char            buf[SNMP_MAXBUF];
291
292
    static char     buf2[SNMP_MAXBUF];
292
293
    static oid      objid[MAX_OID_LEN];
412
413
                        *var_len = 0;
413
414
                        return (NULL);
414
415
                    }
415
 
                    long_ret =
 
416
                    addr_ret =
416
417
                        (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
417
418
                        (objid[2] << 8) + objid[3];
418
 
                    long_ret = htonl(long_ret);
419
 
                    *var_len = sizeof(long_ret);
 
419
                    addr_ret = htonl(addr_ret);
 
420
                    *var_len = sizeof(addr_ret);
420
421
                    vp->type = ASN_IPADDRESS;
421
 
                    return ((unsigned char *) &long_ret);
 
422
                    return ((unsigned char *) &addr_ret);
422
423
                }
423
424
            }
424
425
            *var_len = 0;
502
503
                buf[ sizeof(buf)-1 ] = 0;
503
504
                break;
504
505
            case ASN_OBJECT_ID:
505
 
                sprint_mib_oid(buf2, (oid *) var_val, var_val_len);
 
506
                sprint_mib_oid(buf2, (oid *) var_val, var_val_len/sizeof(oid));
506
507
                snprintf(buf, sizeof(buf), "objectid \"%s\"\n", buf2);
507
508
                buf[ sizeof(buf)-1 ] = 0;
508
509
                break;
509
510
            }
510
 
            strncat(passthru->command, buf, sizeof(passthru->command));
 
511
            strncat(passthru->command, buf, sizeof(passthru->command)-strlen(passthru->command)-1);
511
512
            passthru->command[ sizeof(passthru->command)-1 ] = 0;
512
513
            DEBUGMSGTL(("ucd-snmp/pass", "pass-running:  %s",
513
514
                        passthru->command));