Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/inotify.c
          +++ new/usr/src/uts/common/io/inotify.c
↓ open down ↓ 497 lines elided ↑ open up ↑
 498  498                  len = 0;
 499  499          }
 500  500  
 501  501          event = kmem_zalloc(sizeof (inotify_kevent_t) + len, KM_SLEEP);
 502  502          event->ine_event.wd = wd;
 503  503          event->ine_event.mask = (uint32_t)mask;
 504  504          event->ine_event.cookie = cookie;
 505  505          event->ine_event.len = len;
 506  506  
 507  507          if (name != NULL)
 508      -                strcpy(event->ine_event.name, name);
      508 +                (void) strcpy(event->ine_event.name, name);
 509  509  
 510  510          if (tail != NULL) {
 511  511                  tail->ine_next = event;
 512  512          } else {
 513  513                  VERIFY(state->ins_head == NULL);
 514  514                  state->ins_head = event;
 515  515                  cv_broadcast(&state->ins_cv);
 516  516          }
 517  517  
 518  518          state->ins_tail = event;
↓ open down ↓ 103 lines elided ↑ open up ↑
 622  622                  avl_create(&watch->inw_children,
 623  623                      (int(*)(const void *, const void *))inotify_watch_cmpvp,
 624  624                      sizeof (inotify_watch_t),
 625  625                      offsetof(inotify_watch_t, inw_byvp));
 626  626          } else {
 627  627                  VERIFY(name != NULL);
 628  628                  inotify_watch_hold(parent);
 629  629                  watch->inw_mask &= IN_CHILD_EVENTS;
 630  630                  watch->inw_parent = parent;
 631  631                  watch->inw_name = kmem_alloc(strlen(name) + 1, KM_SLEEP);
 632      -                strcpy(watch->inw_name, name);
      632 +                /* strcpy() is safe, because strlen(name) bounds us. */
      633 +                (void) strcpy(watch->inw_name, name);
 633  634  
 634  635                  avl_add(&parent->inw_children, watch);
 635  636          }
 636  637  
 637  638          /*
 638  639           * Add our monitor to the vnode.  We must not have the watch lock held
 639  640           * when we do this, as it will immediately hold our watch.
 640  641           */
 641  642          err = fem_install(vp, inotify_femp, watch, OPARGUNIQ,
 642  643              (void (*)(void *))inotify_watch_hold,
↓ open down ↓ 862 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX