Project

General

Profile

Bug #1978

iPsGetSetStmfProp is missing some brackets

Added by Milan Jurik almost 9 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2012-01-12
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

In iPsGetSetStmfProp() (http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libstmf/common/store.c#iPsGetSetStmfProp), there is this code:

   2345         switch (propType) {
   2346             case STMF_DEFAULT_LU_STATE :
   2347                 psStmfProp = DEFAULT_LU_STATE;
   2348                 if (strcasecmp(propVal, "online") == 0)
   2349                     psStmfPropVal = STMF_PS_LU_ONLINE;
   2350                 else if (strcasecmp(propVal, "offline") == 0)
   2351                     psStmfPropVal = STMF_PS_LU_OFFLINE;
   2352                 else
   2353                     ret = STMF_PS_ERROR;
   2354                     goto out;
   2355                 break;
   2356             case STMF_DEFAULT_TARGET_PORT_STATE :
   2357                 psStmfProp = DEFAULT_TARGET_PORT_STATE;
   2358                 if (strcasecmp(propVal, "online") == 0)
   2359                     psStmfPropVal =
   2360                         STMF_PS_TARGET_PORT_ONLINE;
   2361                 else if (strcasecmp(propVal, "offline") == 0)
   2362                     psStmfPropVal =
   2363                         STMF_PS_TARGET_PORT_OFFLINE;
   2364                 else
   2365                     ret = STMF_PS_ERROR;
   2366                     goto out;
   2367                 break;
   2368             default :
   2369                 ret = STMF_PS_ERROR;
   2370                 goto out;
   2371                 break;
   2372         }

On lines 2352, 2354, 2364, 2366 there are missing brackets. As the result, setting LU and port status ends too soon.


Files

test.c (242 Bytes) test.c testing source code Milan Jurik, 2012-01-16 04:50 PM
lint-store.patch (1.48 KB) lint-store.patch suggested fix Milan Jurik, 2012-01-16 04:50 PM
#1

Updated by Milan Jurik almost 9 years ago

  • Status changed from New to In Progress
  • Assignee set to Peter Tribble
  • % Done changed from 0 to 80
#2

Updated by Milan Jurik almost 9 years ago

  • Assignee changed from Peter Tribble to Milan Jurik
#3

Updated by Milan Jurik almost 9 years ago

Testing code and suggested fix attached.

#4

Updated by Rich Lowe almost 9 years ago

  • Category set to cmd - userland programs
  • Status changed from In Progress to Resolved
  • Tags deleted (needs-triage)

Resolved in r13565 commit:fed8865d992e

Also available in: Atom PDF