Print this page
    
1575 untangle libmlrpc ... (smbsrv)
    
      
        | Split | Close | 
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/lib/smbsrv/libmlsvc/common/msgsvc_svc.c
          +++ new/usr/src/lib/smbsrv/libmlsvc/common/msgsvc_svc.c
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  
    | ↓ 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) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  /*
  27   28   * Message Service
  28   29   */
  29   30  
  30   31  #include <syslog.h>
  31   32  #include <stdlib.h>
  32   33  
       34 +#include <libmlrpc/libmlrpc.h>
  33   35  #include <smbsrv/libsmb.h>
  34      -#include <smbsrv/libmlrpc.h>
  35   36  #include <smbsrv/libmlsvc.h>
  36   37  #include <smbsrv/ndl/msgsvc.ndl>
  37   38  #include <smbsrv/smbinfo.h>
  38   39  #include <smbsrv/nmpipes.h>
  39   40  
  40   41  static int msgsvcsend_NetrSendMessage(void *, ndr_xa_t *);
  41   42  
  42   43  static ndr_stub_table_t msgsvcsend_stub_table[] = {
  43   44          { msgsvcsend_NetrSendMessage, MSGSVCSEND_OPNUM_NetrSendMessage },
  44   45          {0}
  45   46  };
  46   47  
  47   48  static ndr_service_t msgsvcsend_service = {
  48   49          "MSGSVC",                       /* name */
  49   50          "Message Service",              /* desc */
  50   51          "\\msgsvc",                     /* endpoint */
  51   52          PIPE_NTSVCS,                    /* sec_addr_port */
  52   53          "5a7b91f8-ff00-11d0-a9b200c04fb6e6fc",  0,      /* abstract */
  53   54          NDR_TRANSFER_SYNTAX_UUID,               2,      /* transfer */
  54   55          0,                              /* no bind_instance_size */
  55   56          0,                              /* no bind_req() */
  56   57          0,                              /* no unbind_and_close() */
  57   58          0,                              /* use generic_call_stub() */
  58   59          &TYPEINFO(msgsvcsend_interface),        /* interface ti */
  59   60          msgsvcsend_stub_table           /* stub_table */
  60   61  };
  61   62  
  62   63  void
  63   64  msgsvcsend_initialize(void)
  64   65  {
  65   66          (void) ndr_svc_register(&msgsvcsend_service);
  66   67  }
  67   68  
  68   69  static int
  69   70  msgsvcsend_NetrSendMessage(void *arg, ndr_xa_t *mxa)
  70   71  {
  71   72          msgsvcsend_NetrSendMessage_t *param = arg;
  72   73  
  73   74          if (!ndr_is_admin(mxa)) {
  74   75                  param->status = ERROR_ACCESS_DENIED;
  75   76                  return (NDR_DRC_OK);
  76   77          }
  77   78  
  78   79          if (param->from == NULL || param->to == NULL || param->text == NULL) {
  79   80                  param->status = ERROR_INVALID_PARAMETER;
  80   81                  return (NDR_DRC_OK);
  81   82          }
  82   83  
  83   84          syslog(LOG_INFO, "%s to %s: %s", param->from,  param->to, param->text);
  84   85          param->status = ERROR_SUCCESS;
  85   86          return (NDR_DRC_OK);
  86   87  }
  
    | ↓ open down ↓ | 42 lines elided | ↑ open up ↑ | 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX