Print this page
7849 Disable auditing when building native svc.configd
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/configd/client.c
          +++ new/usr/src/cmd/svc/configd/client.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2015 RackTop Systems.
  24   25   */
  25   26  
  26   27  /*
  27   28   * This is the client layer for svc.configd.  All direct protocol interactions
  28   29   * are handled here.
  29   30   *
  30   31   * Essentially, the job of this layer is to turn the idempotent protocol
  31   32   * into a series of non-idempotent calls into the object layer, while
  32   33   * also handling the necessary locking.
  33   34   */
↓ open down ↓ 694 lines elided ↑ open up ↑
 728  729           * clean up annotations
 729  730           */
 730  731          if (cp->rc_operation != NULL)
 731  732                  free((void *)cp->rc_operation);
 732  733          if (cp->rc_file != NULL)
 733  734                  free((void *)cp->rc_file);
 734  735  
 735  736          /*
 736  737           * End audit session.
 737  738           */
      739 +#ifndef NATIVE_BUILD
 738  740          (void) adt_end_session(cp->rc_adt_session);
      741 +#endif
 739  742  
 740  743          client_free(cp);
 741  744  }
 742  745  
 743  746  /*
 744  747   * Fails with
 745  748   *   _TYPE_MISMATCH - the entity is already set up with a different type
 746  749   *   _NO_RESOURCES - out of memory
 747  750   */
 748  751  static int
↓ open down ↓ 1196 lines elided ↑ open up ↑
1945 1948  client_annotation_finished()
1946 1949  {
1947 1950          thread_info_t *ti = thread_self();
1948 1951          repcache_client_t *cp = ti->ti_active_client;
1949 1952  
1950 1953          (void) pthread_mutex_lock(&cp->rc_annotate_lock);
1951 1954          cp->rc_annotate = 0;
1952 1955          (void) pthread_mutex_unlock(&cp->rc_annotate_lock);
1953 1956  }
1954 1957  
     1958 +#ifndef NATIVE_BUILD
1955 1959  static void
1956 1960  start_audit_session(repcache_client_t *cp)
1957 1961  {
1958 1962          ucred_t *cred = NULL;
1959 1963          adt_session_data_t *session;
1960 1964  
1961 1965          /*
1962 1966           * A NULL session pointer value can legally be used in all
1963 1967           * subsequent calls to adt_* functions.
1964 1968           */
↓ open down ↓ 36 lines elided ↑ open up ↑
2001 2005                  ucred_free(cred);
2002 2006                  return;
2003 2007          }
2004 2008  
2005 2009          /* All went well.  Save the session data and session ID */
2006 2010          cp->rc_adt_session = session;
2007 2011          adt_get_asid(session, &cp->rc_adt_sessionid);
2008 2012  
2009 2013          ucred_free(cred);
2010 2014  }
     2015 +#endif
2011 2016  
2012 2017  /*
2013 2018   * Handle switch client request
2014 2019   *
2015 2020   * This routine can return:
2016 2021   *
2017 2022   *      _PERMISSION_DENIED      not enough privileges to do request.
2018 2023   *      _UNKNOWN                file operation error (details written to
2019 2024   *                              the console).
2020 2025   *      _SUCCESS                switch operation is completed.
↓ open down ↓ 430 lines elided ↑ open up ↑
2451 2456                  return (REPOSITORY_DOOR_FAIL_NO_RESOURCES);
2452 2457  
2453 2458          (void) pthread_mutex_lock(&client_lock);
2454 2459          cp->rc_id = ++client_maxid;
2455 2460          (void) pthread_mutex_unlock(&client_lock);
2456 2461  
2457 2462          cp->rc_all_auths = privileged;
2458 2463          cp->rc_pid = pid;
2459 2464          cp->rc_debug = debugflags;
2460 2465  
     2466 +#ifndef NATIVE_BUILD
2461 2467          start_audit_session(cp);
     2468 +#endif
2462 2469  
2463 2470          cp->rc_doorfd = door_create(client_switcher, (void *)cp->rc_id,
2464 2471              door_flags);
2465 2472  
2466 2473          if (cp->rc_doorfd < 0) {
2467 2474                  client_free(cp);
2468 2475                  return (REPOSITORY_DOOR_FAIL_NO_RESOURCES);
2469 2476          }
2470 2477  #ifdef DOOR_PARAM_DATA_MIN
2471 2478          (void) door_setparam(cp->rc_doorfd, DOOR_PARAM_DATA_MIN,
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX