diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-03-29 00:39:57 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-03-29 00:39:57 +0000 |
commit | 21519f50b2c34424cca90ca89403b28ade9a8585 (patch) | |
tree | da1efa38fffd9ab72681334e2e781e155d25d609 /ipadm | |
parent | 002cb3381e5d9650a980444ec1e5c859e0e8c915 (diff) | |
download | illumos-packaging-21519f50b2c34424cca90ca89403b28ade9a8585.tar.gz |
Really fix strcmp in ipmgmtd
Diffstat (limited to 'ipadm')
-rw-r--r-- | ipadm/debian/patches/ipmgmtd-segfault.patch | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/ipadm/debian/patches/ipmgmtd-segfault.patch b/ipadm/debian/patches/ipmgmtd-segfault.patch index 3576e33..9bbab6a 100644 --- a/ipadm/debian/patches/ipmgmtd-segfault.patch +++ b/ipadm/debian/patches/ipmgmtd-segfault.patch @@ -4,26 +4,56 @@ Dyson-Bug: http://osdyson.org/issues/105 Index: ipadm/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c =================================================================== --- ipadm.orig/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c 2012-10-08 00:25:23.000000000 +0000 -+++ ipadm/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c 2013-03-28 11:01:45.894149910 +0000 -@@ -111,18 +111,21 @@ ++++ ipadm/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c 2013-03-29 00:23:59.807522523 +0000 +@@ -77,6 +77,19 @@ + /* signifies whether volatile copy of data store is in use */ + static boolean_t ipmgmt_rdonly_root = B_FALSE; - if ((proto == NULL && db_proto != NULL) || - (proto != NULL && db_proto == NULL) || -+ (proto == NULL && db_proto == NULL) || - strcmp(proto, db_proto) != 0) { ++static boolean_t ++strings_differ(const char *a, const char *b) ++{ ++ if (a && !b) ++ return (B_TRUE); ++ if (!a && b) ++ return (B_TRUE); ++ if (a && b && strcmp(a, b)) ++ return (B_TRUE); ++ ++ return (B_FALSE); ++} ++ + /* + * Checks if the database nvl, `db_nvl' contains and matches ALL of the passed + * in private nvpairs `proto', `ifname' & `aobjname'. +@@ -102,28 +115,15 @@ + (void) nvpair_value_string(nvp, &db_aobjname); + } + +- if (proto != NULL && proto[0] == '\0') +- proto = NULL; +- if (ifname != NULL && ifname[0] == '\0') +- ifname = NULL; +- if (aobjname != NULL && aobjname[0] == '\0') +- aobjname = NULL; +- +- if ((proto == NULL && db_proto != NULL) || +- (proto != NULL && db_proto == NULL) || +- strcmp(proto, db_proto) != 0) { ++ if (strings_differ(proto, db_proto)) { /* no intersection - different protocols. */ return (B_FALSE); } - if ((ifname == NULL && db_ifname != NULL) || - (ifname != NULL && db_ifname == NULL) || -+ (ifname == NULL && db_ifname == NULL) || - strcmp(ifname, db_ifname) != 0) { +- if ((ifname == NULL && db_ifname != NULL) || +- (ifname != NULL && db_ifname == NULL) || +- strcmp(ifname, db_ifname) != 0) { ++ if (strings_differ(ifname, db_ifname)) { /* no intersection - different interfaces. */ return (B_FALSE); } - if ((aobjname == NULL && db_aobjname != NULL) || - (aobjname != NULL && db_aobjname == NULL) || -+ (aobjname == NULL && db_aobjname == NULL) || - strcmp(aobjname, db_aobjname) != 0) { +- if ((aobjname == NULL && db_aobjname != NULL) || +- (aobjname != NULL && db_aobjname == NULL) || +- strcmp(aobjname, db_aobjname) != 0) { ++ if (strings_differ(aobjname, db_aobjname)) { /* no intersection - different address objects */ return (B_FALSE); + } |