Print this page
12159 truss psflags printing is broken

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/truss/print.c
          +++ new/usr/src/cmd/truss/print.c
↓ open down ↓ 1622 lines elided ↑ open up ↑
1623 1623                  (void) strlcat(str, "|PROC_SEC_FORBIDNULLMAP",
1624 1624                      sizeof (str));
1625 1625                  secflag_clear(&val, PROC_SEC_FORBIDNULLMAP);
1626 1626          }
1627 1627          if (secflag_isset(val, PROC_SEC_NOEXECSTACK)) {
1628 1628                  (void) strlcat(str, "|PROC_SEC_NOEXECSTACK",
1629 1629                      sizeof (str));
1630 1630                  secflag_clear(&val, PROC_SEC_NOEXECSTACK);
1631 1631          }
1632 1632  
1633      -        len = strlen(str);
1634      -        ptr = str + len;
1635      -        (void) snprintf(ptr, sizeof (str) - len, "|%#x", val);
     1633 +        if (val != 0) {
     1634 +                len = strlen(str);
     1635 +                ptr = str + len;
     1636 +                (void) snprintf(ptr, sizeof (str) - len, "|%#x", val);
     1637 +        }
     1638 +
1636 1639          outstring(pri, str + 1);
1637 1640  }
1638 1641  
1639 1642  /*
1640 1643   * Print a psecflags(2) delta
1641 1644   */
1642 1645  void
1643 1646  prt_psdelta(private_t *pri, int raw, long value)
1644 1647  {
1645 1648          secflagdelta_t psd;
↓ open down ↓ 1331 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX