Print this page
NEX-16818 Add fksmbcl development tool
NEX-17264 SMB client test tp_smbutil_013 fails after NEX-14666
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
and: (fix ref leaks)
SMB-50 User-mode SMB server
 Includes work by these authors:
 Thomas Keiser <thomas.keiser@nexenta.com>
 Albert Lee <trisk@nexenta.com>
   1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  14  */
  15 
  16 
  17 #include <sys/types.h>
  18 #include <sys/time.h>
  19 #include <sys/systm.h>
  20 #include <sys/errno.h>
  21 
  22 int














  23 copyinstr(const char *src, char *dst, size_t max_len, size_t *copied)
  24 {
  25         return (copystr(src, dst, max_len, copied));
  26 }
  27 
  28 int
  29 copystr(const char *src, char *dst, size_t max_len, size_t *outlen)
  30 {
  31         size_t copied;
  32 
  33         if (max_len == 0)
  34                 return (ENAMETOOLONG);
  35 
  36         copied = strlcpy(dst, src, max_len) + 1;
  37         if (copied >= max_len)
  38                 return (ENAMETOOLONG);
  39 
  40         if (outlen != NULL)
  41                 *outlen = copied;
  42 
  43         return (0);
  44 }
  45 
  46 void
  47 ovbcopy(const void *src, void *dst, size_t len)
  48 {
  49         (void) memmove(dst, src, len);














  50 }
   1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  14  */
  15 
  16 
  17 #include <sys/types.h>
  18 #include <sys/time.h>
  19 #include <sys/systm.h>
  20 #include <sys/errno.h>
  21 
  22 int
  23 copyin(const void *u, void *k, size_t s)
  24 {
  25         bcopy(u, k, s);
  26         return (0);
  27 }
  28 
  29 int
  30 copyout(const void *k, void *u, size_t s)
  31 {
  32         bcopy(k, u, s);
  33         return (0);
  34 }
  35 
  36 int
  37 copyinstr(const char *src, char *dst, size_t max_len, size_t *copied)
  38 {
  39         return (copystr(src, dst, max_len, copied));
  40 }
  41 
  42 int
  43 copystr(const char *src, char *dst, size_t max_len, size_t *outlen)
  44 {
  45         size_t copied;
  46 
  47         if (max_len == 0)
  48                 return (ENAMETOOLONG);
  49 
  50         copied = strlcpy(dst, src, max_len) + 1;
  51         if (copied >= max_len)
  52                 return (ENAMETOOLONG);
  53 
  54         if (outlen != NULL)
  55                 *outlen = copied;
  56 
  57         return (0);
  58 }
  59 
  60 void
  61 ovbcopy(const void *src, void *dst, size_t len)
  62 {
  63         (void) memmove(dst, src, len);
  64 }
  65 
  66 /* ARGSUSED */
  67 int
  68 ddi_copyin(const void *buf, void *kernbuf, size_t size, int flags)
  69 {
  70         return (copyin(buf, kernbuf, size));
  71 }
  72 
  73 /* ARGSUSED */
  74 int
  75 ddi_copyout(const void *buf, void *kernbuf, size_t size, int flags)
  76 {
  77         return (copyout(buf, kernbuf, size));
  78 }