Project

General

Profile

Bug #6261

Fix for 6198 overlooked NULL abuse in svr4pkg/libinst/mntinfo.c

Added by Dan McDonald over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
nfs - NFS server and client
Start date:
2015-09-24
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

Richard PALO pointed this additional change that he'd have liked to have seen (slightly modified for correctness) in #6198 :

diff --git a/usr/src/cmd/svr4pkg/libinst/mntinfo.c b/usr/src/cmd/svr4pkg/libinst/mntinfo.c
index 0867628..44fda5c 100644
--- a/usr/src/cmd/svr4pkg/libinst/mntinfo.c
+++ b/usr/src/cmd/svr4pkg/libinst/mntinfo.c
@@ -223,7 +223,7 @@ get_server_host(uint32_t n)
        if (n < fs_tab_used) {
                (void) strcpy(hostname, fs_tab[n]->remote_name);
                if ((host_end = strchr(hostname, ':')) == NULL) {
-                       if ((strcmp(fs_tab[n]->fstype, MNTTYPE_AUTOFS)) == NULL)
+                       if ((strcmp(fs_tab[n]->fstype, MNTTYPE_AUTOFS)) == 0)
                                return ("automounter");
                        else
                                return (fs_tab[n]->fstype);
@@ -1121,7 +1121,7 @@ fsys(char *path)
                 * do the string compare. -- JST
                 */
                if ((fs_namelen == 1 && *(fs_tab[i]->name) == '/') ||
-                   ((term_char == '/' || term_char == NULL) &&
+                   ((term_char == '/' || term_char == '\0') &&
                    strncmp(fs_tab[i]->name, path2use, fs_namelen) == 0)) {
                        return (i);
                }

This would make a good bite-sized introduction for someone new to illumos, modulo the possibility svr4pkg isn't removed first.


Related issues

Related to illumos gate - Bug #6198: Let's EOL cachefsClosed2015-09-022015-09-12

Actions

History

#1

Updated by Dan McDonald over 4 years ago

  • Related to Bug #6198: Let's EOL cachefs added
#2

Updated by Richard PALO over 4 years ago

Thanks, Dan. This is part of merge hell with new/modified bugs on top of 5218...

Also available in: Atom PDF