~ubuntu-branches/ubuntu/raring/sudo/raring

« back to all changes in this revision

Viewing changes to plugins/sudoers/interfaces.c

  • Committer: Package Import Robot
  • Author(s): Tyler Hicks
  • Date: 2012-07-16 14:01:42 UTC
  • mfrom: (1.3.22 sid)
  • Revision ID: package-import@ubuntu.com-20120716140142-b0tgau0k6nid4mrf
Tags: 1.8.5p2-1ubuntu1
* Merge from debian/testing (LP: #1024154), remaining changes:
  - debian/patches/keep_home_by_default.patch:
    + Set HOME in initial_keepenv_table.
  - debian/rules:
    + compile with --without-lecture --with-tty-tickets (Ubuntu specific)
    + install man/man8/sudo_root.8 in both flavours (Ubuntu specific)
    + install apport hooks
    + The ubuntu-sudo-as-admin-successful.patch was taken upstream by
      Debian however it requires a --enable-admin-flag configure flag to
      actually enable it in both flavours.
  - debian/control:
    + Mark Debian Vcs-* as XS-Debian-Vcs-*
    + update debian/control
  - debian/sudoers:
    + grant admin group sudo access
  - debian/source_sudo.py, debian/sudo-ldap.dirs, debian/sudo.dirs:
    + add usr/share/apport/package-hooks
  - debian/sudo.pam:
    + Use pam_env to read /etc/environment and /etc/default/locale
      environment files. Reading ~/.pam_environment is not permitted due to
      security reasons.
* Dropped changes:
  - debian/patches/lp927828-fix-abort-in-pam-modules-when-timestamp-valid.patch
    + Fixed upstream in 1.8.5
  - debian/patches/CVE-2012-2337.patch:
    + Fixed upstream in 1.8.4p5
  - debian/patches/pam_env_merge.patch:
    + Feature released upstream in 1.8.5
  - debian/{sudo,sudo-ldap}.{preinst,postinst,postrm}:
    + Drop Ubuntu-specific sudoers file migration code because the only
      upgrade path to quantal is from precise. All necessary sudoers file
      migration will have already been done by the time this version of the
      sudo package is installed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
{
62
62
    char *addrinfo, *addr, *mask;
63
63
    struct interface *ifp;
 
64
    debug_decl(set_interfaces, SUDO_DEBUG_NETIF)
64
65
 
65
66
    addrinfo = estrdup(ai);
66
67
    for (addr = strtok(addrinfo, " \t"); addr != NULL; addr = strtok(NULL, " \t")) {
70
71
        *mask++ = '\0';
71
72
 
72
73
        /* Parse addr and store in list. */
73
 
        ifp = emalloc(sizeof(*ifp));
 
74
        ifp = ecalloc(1, sizeof(*ifp));
74
75
        if (strchr(addr, ':')) {
75
76
            /* IPv6 */
76
 
#ifdef HAVE_IN6_ADDR
 
77
#ifdef HAVE_STRUCT_IN6_ADDR
77
78
            ifp->family = AF_INET6;
78
79
            if (inet_pton(AF_INET6, addr, &ifp->addr.ip6) != 1 ||
79
80
                inet_pton(AF_INET6, mask, &ifp->netmask.ip6) != 1)
97
98
        interfaces = ifp;
98
99
    }
99
100
    efree(addrinfo);
 
101
    debug_return;
100
102
}
101
103
 
102
104
void
103
105
dump_interfaces(const char *ai)
104
106
{
105
107
    char *cp, *addrinfo;
 
108
    debug_decl(set_interfaces, SUDO_DEBUG_NETIF)
106
109
 
107
110
    addrinfo = estrdup(ai);
108
111
 
111
114
        sudo_printf(SUDO_CONV_INFO_MSG, "\t%s\n", cp);
112
115
 
113
116
    efree(addrinfo);
 
117
    debug_return;
114
118
}