diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-08-23 11:33:37 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-08-23 11:33:37 +0000 |
commit | e1f899e662705332b04ab8dc6b21c28e54621d88 (patch) | |
tree | 1c7310b6914f6a22eece29296d20e499cb85ba2e | |
parent | bc729a97a9286d8629f774f23f1edeb945c6b29c (diff) | |
parent | 2a12d4b48bc1841009a51abdb5b10a991f9f28ae (diff) | |
download | illumos-joyent-e1f899e662705332b04ab8dc6b21c28e54621d88.tar.gz |
[illumos-gate merge]
commit 2a12d4b48bc1841009a51abdb5b10a991f9f28ae
11583 Some man3lib pages are missing parts of the SYNOPSIS
commit dfe6d73f5cf5922a7dfdafeac8df9775afb2d992
11394 iconv_modules build could be much more parallel
commit dfa42fab8d7071228466d2f82351da8e1a090aad
11035 Minimal SMB 3.0.2 support
commit 1bc6aeee80885d7c0e78d4eddf68dfdcb8520c7e
11034 Restoring previous versions from snapshots doesn't work with nested datasets
commit 58f3189518d9e749f916c2666f0d2914e1fac538
11033 It's time to require SMB signing by default
commit 87b817582bc68a9992ad7109bd09617975ea4725
11032 Time spent sharing SMB filesystems could be reduced by optimizing smb_getdataset for default mount points
52 files changed, 534 insertions, 433 deletions
diff --git a/usr/src/cmd/smbsrv/smbd/server.xml b/usr/src/cmd/smbsrv/smbd/server.xml index fa2ee7fdd4..783c4cffb3 100644 --- a/usr/src/cmd/smbsrv/smbd/server.xml +++ b/usr/src/cmd/smbsrv/smbd/server.xml @@ -22,7 +22,7 @@ information: Portions Copyright [yyyy] [name of copyright owner] CDDL HEADER END Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. -Copyright 2016 Nexenta Systems, Inc. All rights reserved. +Copyright 2018 Nexenta Systems, Inc. All rights reserved. Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> NOTE: This service manifest is not editable; its contents will @@ -38,7 +38,7 @@ file. <service name='network/smb/server' type='service' - version='1'> + version='2'> <!-- 2. Create default service instance. --> <create_default_instance enabled='false' /> @@ -192,9 +192,7 @@ file. <propval name='signing_enabled' type='boolean' value='true' override='true'/> <propval name='signing_required' type='boolean' - value='false' override='true'/> - <propval name='signing_check' type='boolean' - value='false' override='true'/> + value='true' override='true'/> <propval name='sync_enable' type='boolean' value='false' override='true'/> <propval name='security' type='astring' diff --git a/usr/src/cmd/smbsrv/smbd/smbd_vss.c b/usr/src/cmd/smbsrv/smbd/smbd_vss.c index 759c696513..b0d114631d 100644 --- a/usr/src/cmd/smbsrv/smbd/smbd_vss.c +++ b/usr/src/cmd/smbsrv/smbd/smbd_vss.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. * Copyright 2016 Martin Matuska. All rights reserved. */ @@ -110,11 +110,13 @@ smbd_vss_get_count(const char *path, uint32_t *count) bzero(&vss_count, sizeof (smbd_vss_count_t)); *count = 0; - if (smb_getdataset(path, dataset, MAXPATHLEN) != 0) + if ((libhd = libzfs_init()) == NULL) return (-1); - if ((libhd = libzfs_init()) == NULL) + if (smb_getdataset(libhd, path, dataset, MAXPATHLEN) != 0) { + libzfs_fini(libhd); return (-1); + } if ((zfshd = zfs_open(libhd, dataset, ZFS_TYPE_DATASET)) == NULL) { libzfs_fini(libhd); @@ -165,16 +167,18 @@ smbd_vss_get_snapshots(const char *path, uint32_t count, vss_uint64_date.gd_count = count; vss_uint64_date.gd_return_count = 0; vss_uint64_date.gd_gmt_array = malloc(count * sizeof (uint64_t)); + if (vss_uint64_date.gd_gmt_array == NULL) return; - if (smb_getdataset(path, dataset, MAXPATHLEN) != 0) { + if ((libhd = libzfs_init()) == NULL) { free(vss_uint64_date.gd_gmt_array); return; } - if ((libhd = libzfs_init()) == NULL) { + if (smb_getdataset(libhd, path, dataset, MAXPATHLEN) != 0) { free(vss_uint64_date.gd_gmt_array); + libzfs_fini(libhd); return; } @@ -251,11 +255,13 @@ smbd_vss_map_gmttoken(const char *path, char *gmttoken, time_t toktime, vss_map_gmttoken.mg_snapname = snapname; *snapname = '\0'; - if (smb_getdataset(path, dataset, MAXPATHLEN) != 0) + if ((libhd = libzfs_init()) == NULL) return (-1); - if ((libhd = libzfs_init()) == NULL) + if (smb_getdataset(libhd, path, dataset, MAXPATHLEN) != 0) { + libzfs_fini(libhd); return (-1); + } if ((zfshd = zfs_open(libhd, dataset, ZFS_TYPE_DATASET)) == NULL) { libzfs_fini(libhd); diff --git a/usr/src/lib/iconv_modules/Makefile b/usr/src/lib/iconv_modules/Makefile index a881735665..e8ec6dc252 100644 --- a/usr/src/lib/iconv_modules/Makefile +++ b/usr/src/lib/iconv_modules/Makefile @@ -35,6 +35,8 @@ clobber := TARGET = clobber all install lint clean clobber: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC cd $@; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/common/Makefile b/usr/src/lib/iconv_modules/common/Makefile index da26c3adf1..eaa4f5a9f1 100644 --- a/usr/src/lib/iconv_modules/common/Makefile +++ b/usr/src/lib/iconv_modules/common/Makefile @@ -39,6 +39,8 @@ echo := TARGET = echo all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/euro/Makefile b/usr/src/lib/iconv_modules/euro/Makefile index da26c3adf1..eaa4f5a9f1 100644 --- a/usr/src/lib/iconv_modules/euro/Makefile +++ b/usr/src/lib/iconv_modules/euro/Makefile @@ -39,6 +39,8 @@ echo := TARGET = echo all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/euro/Makefile.com b/usr/src/lib/iconv_modules/euro/Makefile.com index 444be97b64..c51372dcad 100644 --- a/usr/src/lib/iconv_modules/euro/Makefile.com +++ b/usr/src/lib/iconv_modules/euro/Makefile.com @@ -44,18 +44,18 @@ include $(SRC)/lib/iconv_modules/Makefile.iconv LDFLAGS = $(DYNFLAGS) $(LDLIBS) -CFLAGS += $(INCLUDES) $(XREGSFLAG) -D_REENTRANT +CFLAGS += $(XREGSFLAG) -D_REENTRANT -CLEANFILES += core ../common/tbl.h +CLEANFILES += tbl.h -$(ALL_SOS): ../common/euro.h ../common/euro.c ../common/tbl.h +$(ALL_SOS): ../common/euro.h ../common/euro.c tbl.h TABLE=`echo $@ | $(TR) -d "-" | sed -e s:%:_:g | /usr/bin/cut -d. -f1` ; \ - $(CC) $(CFLAGS) -DT_$$TABLE ../common/euro.c -c -o $@.o ; \ + $(CC) $(CFLAGS) $(CPPFLAGS) -DT_$$TABLE ../common/euro.c -c -o $@.o ; \ $(LD) $(LDFLAGS) -o $@ $@.o $(LDLIBS) $(POST_PROCESS_SO) -../common/tbl.h: ../genincl $(TABLES:%=../tbls/%) - cd ..; ./genincl > common/tbl.h +tbl.h: ../genincl $(TABLES:%=../tbls/%) + (cd ..; ./genincl) > $@ $(CREATE_LINKS): $(ICONV_LINK_TARGETS) $(SYMLINK) -f 646%8859-1.so $(ICONV_DIR)/646%8859-15.so diff --git a/usr/src/lib/iconv_modules/hi_IN/Makefile b/usr/src/lib/iconv_modules/hi_IN/Makefile index da26c3adf1..eaa4f5a9f1 100644 --- a/usr/src/lib/iconv_modules/hi_IN/Makefile +++ b/usr/src/lib/iconv_modules/hi_IN/Makefile @@ -39,6 +39,8 @@ echo := TARGET = echo all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/ja/Makefile b/usr/src/lib/iconv_modules/ja/Makefile index da26c3adf1..eaa4f5a9f1 100644 --- a/usr/src/lib/iconv_modules/ja/Makefile +++ b/usr/src/lib/iconv_modules/ja/Makefile @@ -39,6 +39,8 @@ echo := TARGET = echo all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/ja/Makefile.com b/usr/src/lib/iconv_modules/ja/Makefile.com index a7e10f6fed..a7c1bbd205 100644 --- a/usr/src/lib/iconv_modules/ja/Makefile.com +++ b/usr/src/lib/iconv_modules/ja/Makefile.com @@ -312,6 +312,15 @@ CLEANFILES += $(LINKS) $(DYNOBJS) $(ALL_SOS) clobber: clean +# There is no way to escape the make(1S) interpretation of '%' as a wildcard, +# as such we can't install these files using traditional make rules, given +# they contain a % which, while it would match a literal '%' and work +# somewhat, would also match anything else. +# +# We have to, rather unfortunately, loop. +# +# Note especially that here, unlike in utf-8/, this is not merely theoretical +# We have both UTF-16%PCK and UTF-16BE%PCK for example. $(INSTALL_MODULES): $(DYNOBJS) for f in $(DYNOBJS); do \ fp=`echo $$f | $(SED) -e 's/_TO_/%/'`; \ diff --git a/usr/src/lib/iconv_modules/ko/Makefile b/usr/src/lib/iconv_modules/ko/Makefile index da26c3adf1..eaa4f5a9f1 100644 --- a/usr/src/lib/iconv_modules/ko/Makefile +++ b/usr/src/lib/iconv_modules/ko/Makefile @@ -39,6 +39,8 @@ echo := TARGET = echo all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/th_TH/Makefile b/usr/src/lib/iconv_modules/th_TH/Makefile index da26c3adf1..eaa4f5a9f1 100644 --- a/usr/src/lib/iconv_modules/th_TH/Makefile +++ b/usr/src/lib/iconv_modules/th_TH/Makefile @@ -39,6 +39,8 @@ echo := TARGET = echo all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/utf-8/Makefile b/usr/src/lib/iconv_modules/utf-8/Makefile index da26c3adf1..edcee27320 100644 --- a/usr/src/lib/iconv_modules/utf-8/Makefile +++ b/usr/src/lib/iconv_modules/utf-8/Makefile @@ -28,6 +28,27 @@ include $(SRC)/Makefile.master SUBDIRS = $(MACH) $(BUILD64)SUBDIRS += $(MACH64) +CODESETS = IBM-037 \ + IBM-273 IBM-277 IBM-278 IBM-280 IBM-284 IBM-285 IBM-297 \ + IBM-420 IBM-424 IBM-500 \ + IBM-850 IBM-852 IBM-855 IBM-856 IBM-857 IBM-862 IBM-864 \ + IBM-866 IBM-869 \ + IBM-870 IBM-871 IBM-875 \ + IBM-921 IBM-922 IBM-1025 IBM-1026 IBM-1112 \ + IBM-1122 \ + IBM-1140 IBM-1141 IBM-1142 IBM-1143 IBM-1144 IBM-1145 \ + IBM-1146 IBM-1147 IBM-1148 IBM-1149 + +INPUTFILES1 = $(CODESETS:%=%+UTF-8.src) +INPUTFILES2 = $(CODESETS:%=UTF-8+%.src) +INPUTFILES = $(INPUTFILES1) $(INPUTFILES2) +BINARYTABLES = $(INPUTFILES:%.src=%.bt) +GENICONVTBL = /usr/bin/geniconvtbl +GENI_SRCS = common/binarytables/srcs +ICONV_DIR = $(ROOT)/usr/lib/iconv +BTS_DIR = $(ICONV_DIR)/geniconvtbl/binarytables + + all := TARGET = all clean := TARGET = clean clobber := TARGET = clobber @@ -35,10 +56,43 @@ install := TARGET = install lint := TARGET = lint echo := TARGET = echo +$(ICONV_DIR)/alias:= FILEMODE=0444 + .KEEP_STATE: +$(BTS_DIR): + $(INS.dir) + +%.bt: $(GENI_SRCS)/%.src + $(GENICONVTBL) -o $@ -f $< + +$(ICONV_DIR)/%: % + $(INS.file) + +all: $(BINARYTABLES) + +# There is no way to escape the make(1S) interpretation of '%' as a wildcard, +# as such we can't install these files using traditional make rules, given +# they contain a % which, while it would match a literal '%' and work +# somewhat, would also match anything else. +# +# We have to, rather unfortunately, loop. +install: all $(BINARYTABLES) $(BTS_DIR) $(ICONV_DIR)/alias + for f in $(BINARYTABLES) ; do \ + fp=`echo $$f | $(TR) "+" "%"` ; \ + echo "installing $$f as $(BTS_DIR)/$$fp ..." ; \ + $(RM) $(BTS_DIR)/$$fp ; \ + $(CP) $$f $(BTS_DIR)/$$fp ; \ + $(CHMOD) 0444 $(BTS_DIR)/$$fp; \ + done + +clean: + $(RM) $(BINARYTABLES) + all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/utf-8/Makefile.com b/usr/src/lib/iconv_modules/utf-8/Makefile.com index 2136e0ea66..73954ee7dd 100644 --- a/usr/src/lib/iconv_modules/utf-8/Makefile.com +++ b/usr/src/lib/iconv_modules/utf-8/Makefile.com @@ -26,35 +26,22 @@ include $(SRC)/Makefile.master -BTS_DIR = $(ROOT)/usr/lib/iconv/geniconvtbl/binarytables - -# geniconvtbl loadmodule -GENICONVTBL= /usr/bin/geniconvtbl # # Common sources come from following directory: COMMON = ../common/ -GENI_SRCS = ../common/binarytables/srcs include $(SRC)/lib/iconv_modules/Makefile.iconv include $(SRC)/lib/iconv_modules/utf-8/Makefile.iconv -CLEANFILES = *.o *.so core *.bt +CLEANFILES = *.o *.so .NO_PARALLEL: -.PARALLEL: $(DYNOBJS) $(BINARYTABLES) - +.PARALLEL: $(DYNOBJS) -all: $(DYNOBJS) $(BINARYTABLES) +all: $(DYNOBJS) -install: all $(ICONV_DIR) $(BTS_DIR) $(ICONV_DIR)/alias - for f in $(BINARYTABLES) ; do \ - TMP=`echo $$f | $(TR) "+" "%"` ; \ - echo installing $$TMP to $(BTS_DIR) ; \ - $(RM) $(BTS_DIR)/$$TMP ; \ - $(CP) $$f $(BTS_DIR)/$$TMP ; \ - $(CHMOD) 444 $(BTS_DIR)/$$TMP ; \ - done +install: all $(ICONV_DIR) for f in $(DYNOBJS) ; do \ TMP=`echo $$f | $(TR) "+" "%"` ; \ echo installing $$TMP to $(ICONV_DIR) ; \ @@ -64,14 +51,8 @@ install: all $(ICONV_DIR) $(BTS_DIR) $(ICONV_DIR)/alias done -@echo "done." - -$(BTS_DIR): - $(INS.dir) $@ - clobber: clean -$(ICONV_DIR)/alias:= FILEMODE=0444 - LDLIBS = -lc LDFLAGS = $(DYNFLAGS) $(LDLIBS) $(CFLAG_OPT) @@ -248,12 +229,3 @@ $(UTF_8_TO_UTF_8_SO): $(COMMON)/common_defs.h $(COMMON)/utf8.c $(CC) $(CFLAGS) $(COMMON)/utf8.c -c -o $@.o $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $@.o $(POST_PROCESS_SO) - - -# -# Rules for binary tables: -.SUFFIXES: $(SUFFIXES) .src -.SUFFIXES: $(SUFFIXES) .bt - -%.bt: $(GENI_SRCS)/%.src - $(GENICONVTBL) -o $@ -f $< diff --git a/usr/src/lib/iconv_modules/utf-8/Makefile.iconv b/usr/src/lib/iconv_modules/utf-8/Makefile.iconv index bc4d8864a6..3b8feb9054 100644 --- a/usr/src/lib/iconv_modules/utf-8/Makefile.iconv +++ b/usr/src/lib/iconv_modules/utf-8/Makefile.iconv @@ -1393,14 +1393,14 @@ UTF_8_TO_UTF_EBCDIC = UTF-8+UTF-EBCDIC.so # # ACE/ACE-ALLOW-UNASSIGNED <-> UTF-8 iconv modules: -ACE_TO_UTF_8 = ACE%UTF-8.so -ACE_ALLOW_UNAS_TO_UTF_8 = ACE-ALLOW-UNASSIGNED%UTF-8.so -UTF_8_TO_ACE = UTF-8%ACE.so -UTF_8_TO_ACE_ALLOW_UNAS = UTF-8%ACE-ALLOW-UNASSIGNED.so +ACE_TO_UTF_8 = ACE+UTF-8.so +ACE_ALLOW_UNAS_TO_UTF_8 = ACE-ALLOW-UNASSIGNED+UTF-8.so +UTF_8_TO_ACE = UTF-8+ACE.so +UTF_8_TO_ACE_ALLOW_UNAS = UTF-8+ACE-ALLOW-UNASSIGNED.so # # UTF-8 <-> UTF-8 iconv module: -UTF_8_TO_UTF_8 = UTF-8%UTF-8.so +UTF_8_TO_UTF_8 = UTF-8+UTF-8.so # # Following are groupings: @@ -6749,19 +6749,3 @@ UTF_8_TO_ACE_SO= $(UTF_8_TO_ACE) UTF_8_TO_ACE_ALLOW_UNAS_SO= $(UTF_8_TO_ACE_ALLOW_UNAS) UTF_8_TO_UTF_8_SO = $(UTF_8_TO_UTF_8) - -CODESETS = IBM-037 \ - IBM-273 IBM-277 IBM-278 IBM-280 IBM-284 IBM-285 IBM-297 \ - IBM-420 IBM-424 IBM-500 \ - IBM-850 IBM-852 IBM-855 IBM-856 IBM-857 IBM-862 IBM-864 \ - IBM-866 IBM-869 \ - IBM-870 IBM-871 IBM-875 \ - IBM-921 IBM-922 IBM-1025 IBM-1026 IBM-1112 \ - IBM-1122 \ - IBM-1140 IBM-1141 IBM-1142 IBM-1143 IBM-1144 IBM-1145 \ - IBM-1146 IBM-1147 IBM-1148 IBM-1149 - -INPUTFILES1 = $(CODESETS:%=%+UTF-8.src) -INPUTFILES2 = $(CODESETS:%=UTF-8+%.src) -INPUTFILES = $(INPUTFILES1) $(INPUTFILES2) -BINARYTABLES = $(INPUTFILES:%.src=%.bt) diff --git a/usr/src/lib/iconv_modules/vi/Makefile b/usr/src/lib/iconv_modules/vi/Makefile index da26c3adf1..eaa4f5a9f1 100644 --- a/usr/src/lib/iconv_modules/vi/Makefile +++ b/usr/src/lib/iconv_modules/vi/Makefile @@ -39,6 +39,8 @@ echo := TARGET = echo all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/iconv_modules/zh/Makefile b/usr/src/lib/iconv_modules/zh/Makefile index da26c3adf1..eaa4f5a9f1 100644 --- a/usr/src/lib/iconv_modules/zh/Makefile +++ b/usr/src/lib/iconv_modules/zh/Makefile @@ -39,6 +39,8 @@ echo := TARGET = echo all clean clobber install lint echo: $(SUBDIRS) +.PARALLEL: $(SUBDIRS) + $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/lib/smbsrv/libmlsvc/common/smb_quota.c b/usr/src/lib/smbsrv/libmlsvc/common/smb_quota.c index ceebb9d042..3f3188c8fe 100644 --- a/usr/src/lib/smbsrv/libmlsvc/common/smb_quota.c +++ b/usr/src/lib/smbsrv/libmlsvc/common/smb_quota.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ #include <stdio.h> @@ -1083,12 +1083,14 @@ smb_quota_zfs_init(const char *path, smb_quota_zfs_handle_t *zfs_hdl) { char dataset[MAXPATHLEN]; - if (smb_getdataset(path, dataset, MAXPATHLEN) != 0) - return (NT_STATUS_INVALID_PARAMETER); - if ((zfs_hdl->z_lib = libzfs_init()) == NULL) return (NT_STATUS_INTERNAL_ERROR); + if (smb_getdataset(zfs_hdl->z_lib, path, dataset, MAXPATHLEN) != 0) { + libzfs_fini(zfs_hdl->z_lib); + return (NT_STATUS_INVALID_PARAMETER); + } + zfs_hdl->z_fs = zfs_open(zfs_hdl->z_lib, dataset, ZFS_TYPE_DATASET); if (zfs_hdl->z_fs == NULL) { libzfs_fini(zfs_hdl->z_lib); diff --git a/usr/src/lib/smbsrv/libmlsvc/common/smb_share.c b/usr/src/lib/smbsrv/libmlsvc/common/smb_share.c index 8a354a7da0..3bdf29a480 100644 --- a/usr/src/lib/smbsrv/libmlsvc/common/smb_share.c +++ b/usr/src/lib/smbsrv/libmlsvc/common/smb_share.c @@ -19,7 +19,7 @@ * CDDL HEADER END * * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* @@ -2240,11 +2240,13 @@ smb_shr_zfs_add(smb_share_t *si) int ret; char buf[MAXPATHLEN]; /* dataset or mountpoint */ - if (smb_getdataset(si->shr_path, buf, MAXPATHLEN) != 0) + if ((libhd = libzfs_init()) == NULL) return; - if ((libhd = libzfs_init()) == NULL) + if (smb_getdataset(libhd, si->shr_path, buf, MAXPATHLEN) != 0) { + libzfs_fini(libhd); return; + } if ((zfshd = zfs_open(libhd, buf, ZFS_TYPE_FILESYSTEM)) == NULL) { libzfs_fini(libhd); @@ -2285,11 +2287,13 @@ smb_shr_zfs_remove(smb_share_t *si) int ret; char buf[MAXPATHLEN]; /* dataset or mountpoint */ - if (smb_getdataset(si->shr_path, buf, MAXPATHLEN) != 0) + if ((libhd = libzfs_init()) == NULL) return; - if ((libhd = libzfs_init()) == NULL) + if (smb_getdataset(libhd, si->shr_path, buf, MAXPATHLEN) != 0) { + libzfs_fini(libhd); return; + } errno = 0; ret = zfs_smb_acl_remove(libhd, buf, si->shr_path, si->shr_name); @@ -2318,11 +2322,13 @@ smb_shr_zfs_rename(smb_share_t *from, smb_share_t *to) int ret; char dataset[MAXPATHLEN]; - if (smb_getdataset(from->shr_path, dataset, MAXPATHLEN) != 0) + if ((libhd = libzfs_init()) == NULL) return; - if ((libhd = libzfs_init()) == NULL) + if (smb_getdataset(libhd, from->shr_path, dataset, MAXPATHLEN) != 0) { + libzfs_fini(libhd); return; + } if ((zfshd = zfs_open(libhd, dataset, ZFS_TYPE_FILESYSTEM)) == NULL) { libzfs_fini(libhd); diff --git a/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_sd.c b/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_sd.c index 0ef6ba7658..f1ce198da0 100644 --- a/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_sd.c +++ b/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_sd.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* @@ -59,13 +60,16 @@ srvsvc_shareacl_getpath(smb_share_t *si, char *shr_acl_path) zfs_handle_t *zfshd; int ret = 0; - ret = smb_getdataset(si->shr_path, dataset, MAXPATHLEN); - if (ret != 0) - return (ret); - if ((libhd = libzfs_init()) == NULL) return (-1); + ret = smb_getdataset(libhd, si->shr_path, dataset, MAXPATHLEN); + if (ret != 0) { + libzfs_fini(libhd); + return (ret); + } + + if ((zfshd = zfs_open(libhd, dataset, ZFS_TYPE_DATASET)) == NULL) { libzfs_fini(libhd); return (-1); diff --git a/usr/src/lib/smbsrv/libsmb/Makefile.com b/usr/src/lib/smbsrv/libsmb/Makefile.com index 39af0ff072..37f853498d 100644 --- a/usr/src/lib/smbsrv/libsmb/Makefile.com +++ b/usr/src/lib/smbsrv/libsmb/Makefile.com @@ -20,30 +20,30 @@ # # # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2017 Nexenta Systems, Inc. All rights reserved. +# Copyright 2018 Nexenta Systems, Inc. All rights reserved. # # Copyright (c) 2018, Joyent, Inc. LIBRARY= libsmb.a VERS= .1 -OBJS_SHARED = \ +OBJS_SHARED = \ smb_cfg_util.o \ - smb_door_legacy.o \ + smb_door_legacy.o \ smb_inet.o \ smb_msgbuf.o \ smb_native.o \ smb_oem.o \ smb_sid.o \ - smb_string.o \ + smb_string.o \ smb_token.o \ smb_token_xdr.o \ smb_utf8.o \ smb_xdr.o -OBJS_COMMON = \ +OBJS_COMMON = \ smb_acl.o \ - smb_auth.o \ + smb_auth.o \ smb_cache.o \ smb_cfg.o \ smb_crypt.o \ @@ -83,7 +83,7 @@ LDLIBS += $(MACH_LDLIBS) # perfer to keep libs ordered by dependence LDLIBS += -lscf -lmd -luuid -lpkcs11 -lcryptoutil LDLIBS += -lsec -lidmap -lreparse -lcmdutils -lavl -LDLIBS += -lnvpair -lresolv -lsocket -lnsl -lc +LDLIBS += -lnvpair -lresolv -lsocket -lnsl -lzfs -lc CPPFLAGS += $(INCS) -D_REENTRANT CPPFLAGS += -Dsyslog=smb_syslog CERRWARN += $(CNOWARN_UNINIT) diff --git a/usr/src/lib/smbsrv/libsmb/common/libsmb.h b/usr/src/lib/smbsrv/libsmb/common/libsmb.h index 25bd45f6bb..11a764f0dc 100644 --- a/usr/src/lib/smbsrv/libsmb/common/libsmb.h +++ b/usr/src/lib/smbsrv/libsmb/common/libsmb.h @@ -21,7 +21,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ #ifndef _LIBSMB_H @@ -186,7 +186,8 @@ extern int smb_smf_restart_service(void); extern int smb_smf_maintenance_mode(void); /* ZFS interface */ -int smb_getdataset(const char *, char *, size_t); +struct libzfs_handle; +int smb_getdataset(struct libzfs_handle *, const char *, char *, size_t); /* Configuration management functions */ extern int smb_config_get(smb_cfg_id_t, char *, int); diff --git a/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c b/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c index 45b0e79c44..c27c4af6b0 100644 --- a/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c +++ b/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* @@ -165,6 +165,7 @@ static smb_cfg_param_t smb_cfg_table[] = */ static struct str_val smb_versions[] = { + { "3.02", SMB_VERS_3_02 }, { "3.0", SMB_VERS_3_0 }, { "2.1", SMB_VERS_2_1 }, { "2.002", SMB_VERS_2_002 }, @@ -1223,7 +1224,7 @@ smb_config_get_protocol(smb_cfg_id_t id, char *name, uint32_t default_val) * whole range that we implement). For that reason, this should usually be the * highest protocol version we implement. */ -uint32_t max_protocol_default = SMB_VERS_3_0; +uint32_t max_protocol_default = SMB_VERS_3_02; uint32_t smb_config_get_max_protocol(void) diff --git a/usr/src/lib/smbsrv/libsmb/common/smb_util.c b/usr/src/lib/smbsrv/libsmb/common/smb_util.c index 359ea0e801..cbc7c515cf 100644 --- a/usr/src/lib/smbsrv/libsmb/common/smb_util.c +++ b/usr/src/lib/smbsrv/libsmb/common/smb_util.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ #include <ctype.h> @@ -627,7 +627,8 @@ smb_netgroup_match(struct nd_hostservlist *clnames, char *glist, int grc) * -1 = Failure to open /etc/mnttab file or to get ZFS dataset. */ int -smb_getdataset(const char *path, char *dataset, size_t len) +smb_getdataset(libzfs_handle_t *libhdl, const char *path, char *dataset, + size_t len) { char tmppath[MAXPATHLEN]; char *cp; @@ -636,6 +637,33 @@ smb_getdataset(const char *path, char *dataset, size_t len) struct mnttab mntpref; int rc = -1; + /* + * Optimisation: if the path is the default mountpoint then + * the dataset name can be determined from path. + * Attempt to open dataset by derived name and, if successful, + * check if its mountpoint matches path. + */ + if (libhdl != NULL) { + zfs_handle_t *hdl; + char mountpnt[ZFS_MAXPROPLEN]; + char *dsname = (char *)path + strspn(path, "/"); + + hdl = zfs_open(libhdl, dsname, ZFS_TYPE_FILESYSTEM); + if (hdl != NULL) { + if ((zfs_prop_get(hdl, ZFS_PROP_MOUNTPOINT, mountpnt, + sizeof (mountpnt), NULL, NULL, 0, B_FALSE) == 0) && + (strcmp(mountpnt, path) == 0)) { + zfs_close(hdl); + (void) strlcpy(dataset, dsname, len); + return (0); + } + zfs_close(hdl); + } + } + + /* + * Couldn't find a filesystem optimistically, use mnttab + */ if ((fp = fopen(MNTTAB, "r")) == NULL) return (-1); @@ -899,9 +927,9 @@ smb_name_validate_domain(const char *domain) * hyphens. * * It cannot: - * - be blank or longer than 15 chracters - * - contain all numbers - * - be the same as the computer name + * - be blank or longer than 15 chracters + * - contain all numbers + * - be the same as the computer name */ uint32_t smb_name_validate_nbdomain(const char *name) diff --git a/usr/src/man/man3lib/libSMHBAAPI.3lib b/usr/src/man/man3lib/libSMHBAAPI.3lib index 619365cebd..2e443ad770 100644 --- a/usr/src/man/man3lib/libSMHBAAPI.3lib +++ b/usr/src/man/man3lib/libSMHBAAPI.3lib @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBSMHBAAPI 3LIB "Sep 28, 2009" +.TH LIBSMHBAAPI 3LIB "Aug 19, 2019" .SH NAME libSMHBAAPI, libsmhbaapi, SMHBA_GetAdapterAttributes, SMHBA_GetAdapterPortAttributes, SMHBA_GetBindingCapability, @@ -22,15 +22,12 @@ SMHBA_ScsiInquiry, SMHBA_ScsiReadCapacity, SMHBA_ScsiReportLuns, SMHBA_SendECHO, SMHBA_SendSMPPassThru, SMHBA_SendTEST, SMHBA_SetBindingSupport, SMHBA_SetPersistentBinding \- Common Storage Management HBA information library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lSMHBAAPI\fR [ \fIlibrary\fR\&.\|.\|. ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-lSMHBAAPI\fR [ \fIlibrary\fR... ] #include <smhbaapi.h> .fi .SH DESCRIPTION -.sp -.LP The functions in this library access Fibre Channel and/or Serial Attached SCSI HBA data depending on vendor provided implementation underneath. .sp @@ -72,7 +69,7 @@ SCSI commands for discovered devices (Report LUNS, Read Capacity, and Inquiry) .TP .ie t \(bu .el o -Storage Managment Protocol commands to discover Serial Attached SCSI +Storage Management Protocol commands to discover Serial Attached SCSI configuration details .RE .RS +4 @@ -82,8 +79,6 @@ configuration details Common Transport commands to discover Fibre Channel Fabric details .RE .SH INTERFACES -.sp -.LP The shared object \fBlibSMHBAAPI.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -123,8 +118,6 @@ l l . .TE .SH USAGE -.sp -.LP Client applications link with the Common Library (using -\fBlSMHBAAPI\fR) to access the interfaces. The Common Library dynamically loads individual Vendor-Specific Libraries (VSL) listed in \fB/etc/smhba.conf\fR and described @@ -338,7 +331,7 @@ For Serial Attached HBA .el o \fBSMHBA_SendSMPPassThru()\fR .RE -For Fibre Channle HBA +For Fibre Channel HBA .RS +4 .TP .ie t \(bu @@ -423,8 +416,6 @@ Close open HBAs by calling \fBHBA_CloseAdapter()\fR. Unload the library by calling \fBHBA_FreeLibrary()\fR. .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -445,6 +436,4 @@ T} .TE .SH SEE ALSO -.sp -.LP \fBsmhba.conf\fR(4), \fBattributes\fR(5) diff --git a/usr/src/man/man3lib/libbsm.3lib b/usr/src/man/man3lib/libbsm.3lib index f0e40da890..45d9da0beb 100644 --- a/usr/src/man/man3lib/libbsm.3lib +++ b/usr/src/man/man3lib/libbsm.3lib @@ -3,21 +3,18 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBBSM 3LIB "Mar 6, 2017" +.TH LIBBSM 3LIB "Aug 19, 2019" .SH NAME libbsm \- basic security library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR... ] \fIfile\fR. \fB-lbsm\fR [ \fIlibrary\fR... ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-lbsm\fR [ \fIlibrary\fR... ] .fi .SH DESCRIPTION -.LP Functions in this library provide basic security, library object reuse, and auditing. .SH INTERFACES -.LP The shared object \fBlibbsm.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -55,13 +52,13 @@ l l . \fBsetauclass\fR \fBsetauclassfile\fR \fBsetaudit\fR \fBsetaudit_addr\fR \fBsetauevent\fR \fBsetaueventfile\fR -\fBsetauid\fR \fBtestac\fR +\fBsetauid\fR \fBtestac\fR .TE .SH FILES .ne 2 .na -\fB\fB/lib/libbsm.so.1\fR\fR +\fB/lib/libbsm.so.1\fR .ad .RS 23n shared object @@ -70,14 +67,13 @@ shared object .sp .ne 2 .na -\fB\fB/lib/64/libbsm.so.1\fR\fR +\fB/lib/64/libbsm.so.1\fR .ad .RS 23n 64-bit shared object .RE .SH ATTRIBUTES -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -93,5 +89,4 @@ T} .TE .SH SEE ALSO -.LP \fBpvs\fR(1), \fBIntro\fR(3), \fBattributes\fR(5) diff --git a/usr/src/man/man3lib/libc_db.3lib b/usr/src/man/man3lib/libc_db.3lib index 796dda7ce7..820d22329e 100644 --- a/usr/src/man/man3lib/libc_db.3lib +++ b/usr/src/man/man3lib/libc_db.3lib @@ -3,27 +3,24 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBC_DB 3LIB "Mar 24, 2004" +.TH LIBC_DB 3LIB "Aug 19, 2019" .SH NAME libc_db \- threads debugging library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lc_db\fR [ \fIlibrary \fR... ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-lc_db\fR [ \fIlibrary\fR... ] #include <\fBproc_service.h\fR> #include <\fBthread_db.h\fR> .fi .SH DESCRIPTION -.sp -.LP The \fBlibc_db\fR library provides support for monitoring and manipulating threads-related aspects of a multithreaded program. There are at least two processes involved, the controlling process and one or more target processes. The controlling process is the \fBlibc_db\fR client, which links with \fBlibc_db\fR and uses \fBlibc_db\fR to inspect or modify threads-related aspects of one or more target processes. The target processes must be -multithreaded processes that use \fBlibc\fR. The controlling process mignt or +multithreaded processes that use \fBlibc\fR. The controlling process might or might not be multithreaded itself. .sp .LP @@ -95,8 +92,6 @@ Callback functions are expected to return an integer. Iteration terminates early if a callback function returns a non-zero value. Otherwise, iteration terminates when there are no more handles to pass back. .SH INTERFACES -.sp -.LP The shared object \fBlibc_db.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -132,10 +127,9 @@ l l . .TE .SH FILES -.sp .ne 2 .na -\fB\fB/lib/libc_db.so.1\fR\fR +\fB/lib/libc_db.so.1\fR .ad .RS 24n shared object @@ -144,15 +138,13 @@ shared object .sp .ne 2 .na -\fB\fB/lib/64/libc_db.so.1\fR\fR +\fB/lib/64/libc_db.so.1\fR .ad .RS 24n 64-bit shared object .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for description of the following attributes: .sp @@ -166,6 +158,4 @@ MT-Level Safe .TE .SH SEE ALSO -.sp -.LP \fBIntro\fR(3), \fBtd_ta_new\fR(3C_DB), \fBattributes\fR(5), \fBthreads\fR(5) diff --git a/usr/src/man/man3lib/libcfgadm.3lib b/usr/src/man/man3lib/libcfgadm.3lib index 4904cc883d..42cb612b18 100644 --- a/usr/src/man/man3lib/libcfgadm.3lib +++ b/usr/src/man/man3lib/libcfgadm.3lib @@ -3,23 +3,18 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBCFGADM 3LIB "May 22, 2003" +.TH LIBCFGADM 3LIB "Aug 19, 2019" .SH NAME libcfgadm \- configuration administration library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR... ] \fIfile\fR... \fB-lcfgadm\fR \fB -ldevinfo \fR \fB -ldl \fR [ \fIlibrary\fR.. ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-lcfgadm\fR \fB-ldevinfo\fR \fB-ldl\fR [ \fIlibrary\fR... ] #include <\fBconfig_admin.h\fR> .fi .SH DESCRIPTION -.sp -.LP Functions in this library provide services for configuration administration. .SH INTERFACES -.sp -.LP The shared object \fBlibcfgadm.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -37,10 +32,9 @@ l l . .TE .SH FILES -.sp .ne 2 .na -\fB\fB/usr/lib/libcfgadm.so.1\fR\fR +\fB/usr/lib/libcfgadm.so.1\fR .ad .RS 30n shared object @@ -49,15 +43,13 @@ shared object .sp .ne 2 .na -\fB\fB/usr/lib/64/libcfgadm.so.1\fR\fR +\fB/usr/lib/64/libcfgadm.so.1\fR .ad .RS 30n 64-bit shared object .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -71,7 +63,5 @@ MT-Level Mt-Safe .TE .SH SEE ALSO -.sp -.LP \fBpvs\fR(1), \fBcfgadm\fR(1M), \fBIntro\fR(3), \fBconfig_admin\fR(3CFGADM), \fBattributes\fR(5) diff --git a/usr/src/man/man3lib/libfcoe.3lib b/usr/src/man/man3lib/libfcoe.3lib index 288a6fbc2b..8c263e5663 100644 --- a/usr/src/man/man3lib/libfcoe.3lib +++ b/usr/src/man/man3lib/libfcoe.3lib @@ -3,25 +3,20 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBFCOE 3LIB "Apr 1, 2009" +.TH LIBFCOE 3LIB "Aug 19, 2019" .SH NAME -libfcoe \- FCoE Port Mangament library +libfcoe \- FCoE Port Management library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR... ] \fIfile\fR... lfcoe [ \fIlibrary\fR... ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-lfcoe\fR [ \fIlibrary\fR... ] #include <libfcoe.h> .fi .SH DESCRIPTION -.sp -.LP Functions in this library provide management of the FCoE (Fibre Channel over Ethernet) ports in the system, allowing clients to create, delete and list information of FCoE ports. .SH INTERFACES -.sp -.LP The shared object \fBlibfcoe.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -32,14 +27,13 @@ interfaces. l l l l . \fBFCOE_CreatePort\fR \fBFCOE_DeletePort\fR -\fBFCOE_GetPortList\fR +\fBFCOE_GetPortList\fR .TE .SH FILES -.sp .ne 2 .na -\fB\fB/lib/libfcoe.so.1\fR\fR +\fB/lib/libfcoe.so.1\fR .ad .RS 24n shared object @@ -48,15 +42,13 @@ shared object .sp .ne 2 .na -\fB\fB/lib/64/libfcoe.so.1\fR\fR +\fB/lib/64/libfcoe.so.1\fR .ad .RS 24n 64-bit shared object .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -72,7 +64,5 @@ MT-Level Safe .TE .SH SEE ALSO -.sp -.LP \fBIntro\fR(3), \fBFCOE_CreatePort\fR(3FCOE), \fBFCOE_DeletePort\fR(3FCOE), \fBFCOE_GetPortList\fR(3FCOE), \fBattributes\fR(5) diff --git a/usr/src/man/man3lib/libfstyp.3lib b/usr/src/man/man3lib/libfstyp.3lib index 91a6935cca..8b4ff542f4 100644 --- a/usr/src/man/man3lib/libfstyp.3lib +++ b/usr/src/man/man3lib/libfstyp.3lib @@ -3,20 +3,17 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBFSTYP 3LIB "Jun 20, 2006" +.TH LIBFSTYP 3LIB "Aug 19, 2019" .SH NAME libfstyp \- file system type identification library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lfstyp\fR \fB -lnvpair \fR [ \fIlibrary\fR\&.\|.\|. ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-lfstyp\fR \fB-lnvpair\fR [ \fIlibrary\fR\... ] #include \fB<libnvpair.h>\fR #include \fB<libfstyp.h>\fR .fi .SH DESCRIPTION -.sp -.LP The \fBlibfstyp\fR library exports a set of functions to identify the file system type of an unmounted file system using heuristic modules. .sp @@ -24,8 +21,6 @@ system type of an unmounted file system using heuristic modules. Internally, the library is comprised of interfaces exported by file system-specific modules. See \fBfstyp_mod_init\fR(3FSTYP). .SH INTERFACES -.sp -.LP The shared object \fBlibfstyp.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -43,18 +38,15 @@ l l . .TE .SH FILES -.sp .ne 2 .na -\fB\fB/lib/libfstyp.so.1\fR\fR +\fB/lib/libfstyp.so.1\fR .ad .RS 22n shared object .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -71,7 +63,5 @@ MT-Level MT-Safe .TE .SH SEE ALSO -.sp -.LP \fBIntro\fR(3), \fBfstyp_mod_init\fR(3FSTYP), \fBlibnvpair\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/man/man3lib/libl.3lib b/usr/src/man/man3lib/libl.3lib index 9af64e3e8d..85473620a5 100644 --- a/usr/src/man/man3lib/libl.3lib +++ b/usr/src/man/man3lib/libl.3lib @@ -3,22 +3,17 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBL 3LIB "May 22, 2003" +.TH LIBL 3LIB "Aug 19, 2019" .SH NAME libl \- lex library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-ll\fR [ \fIlibrary\fR... ] .fi .SH DESCRIPTION -.sp -.LP Functions in this library provide user interfaces to the \fBlex\fR(1) library. .SH INTERFACES -.sp -.LP The shared object \fBlibl.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. .sp @@ -33,14 +28,13 @@ l l . \fByyless_e\fR \fByyless_w\fR \fByyracc\fR \fByyreject\fR \fByyreject_e\fR \fByyreject_w\fR -\fByywrap\fR +\fByywrap\fR .TE .SH FILES -.sp .ne 2 .na -\fB\fB/usr/lib/libl.so.1\fR\fR +\fB/usr/lib/libl.so.1\fR .ad .RS 25n shared object @@ -49,15 +43,13 @@ shared object .sp .ne 2 .na -\fB\fB/usr/lib/64/libl.so.1\fR\fR +\fB/usr/lib/64/libl.so.1\fR .ad .RS 25n 64-bit shared object .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -72,6 +64,4 @@ MT-Level Unsafe .TE .SH SEE ALSO -.sp -.LP \fBlex\fR(1), \fBIntro\fR(3), \fBattributes\fR(5) diff --git a/usr/src/man/man3lib/libpapi.3lib b/usr/src/man/man3lib/libpapi.3lib index 08aa88aa1d..582930a8e2 100644 --- a/usr/src/man/man3lib/libpapi.3lib +++ b/usr/src/man/man3lib/libpapi.3lib @@ -3,19 +3,16 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBPAPI 3LIB "Dec 18, 2006" +.TH LIBPAPI 3LIB "Aug 19, 2019" .SH NAME libpapi \- Free Standards Group Open Printing API (PAPI) library functions .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpapi\fR [ \fIlibrary\fR\&.\|.\|. ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-lpapi\fR [ \fIlibrary\fR... ] #include <papi.h> .fi .SH DESCRIPTION -.sp -.LP Functions in this library provide an interface for interaction with print services as described in v1.0 of the Free Standards Group (FSG) Open Printing API (PAPI). @@ -29,15 +26,10 @@ same interface. These modules should not be linked with directly, but can be used directly at runtime through the use of \fBLD_PRELOAD\fR for debugging purposes. .SH INTERFACES -.sp -.LP The shared object \fBlibpapi.so.0\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. .SS "Attribute" -.sp - -.sp .TS l l l l . @@ -56,9 +48,6 @@ l l . .TE .SS "Service" -.sp - -.sp .TS l l l l . @@ -72,9 +61,6 @@ l l . .TE .SS "Printer" -.sp - -.sp .TS l l l l . @@ -88,9 +74,6 @@ l l . .TE .SS "Job" -.sp - -.sp .TS l l l l . @@ -107,21 +90,17 @@ l l . .TE .SS "Miscellaneous" -.sp - -.sp .TS l l l l . \fBpapiLibrarySupportedCall\fR \fBpapiLibrarySupportedCalls\fR -\fBpapiStatusString\fR +\fBpapiStatusString\fR .TE .SH FILES -.sp .ne 2 .na -\fB\fB/usr/lib/libpapi.so.0\fR\fR +\fB/usr/lib/libpapi.so.0\fR .ad .sp .6 .RS 4n @@ -131,7 +110,7 @@ shared object .sp .ne 2 .na -\fB\fB/usr/lib/libpapi-common.so.0\fR\fR +\fB/usr/lib/libpapi-common.so.0\fR .ad .sp .6 .RS 4n @@ -141,7 +120,7 @@ private shared code .sp .ne 2 .na -\fB\fB/usr/lib/print/psm-lpd.so\fR\fR +\fB/usr/lib/print/psm-lpd.so\fR .ad .sp .6 .RS 4n @@ -151,7 +130,7 @@ private rfc1179 support .sp .ne 2 .na -\fB\fB/usr/lib/print/psm-lpsched.so\fR\fR +\fB/usr/lib/print/psm-lpsched.so\fR .ad .sp .6 .RS 4n @@ -161,7 +140,7 @@ private LP support .sp .ne 2 .na -\fB\fB/usr/lib/print/psm-ipp.so\fR\fR +\fB/usr/lib/print/psm-ipp.so\fR .ad .sp .6 .RS 4n @@ -171,7 +150,7 @@ private IPP support .sp .ne 2 .na -\fB\fB/usr/lib/libipp-core.so\fR\fR +\fB/usr/lib/libipp-core.so\fR .ad .sp .6 .RS 4n @@ -181,7 +160,7 @@ private IPP marshalling support .sp .ne 2 .na -\fB\fB/usr/lib/libipp-listener.so\fR\fR +\fB/usr/lib/libipp-listener.so\fR .ad .sp .6 .RS 4n @@ -191,7 +170,7 @@ private IPP operations support .sp .ne 2 .na -\fB\fB/usr/lip/libhttp-core.so\fR\fR +\fB/usr/lip/libhttp-core.so\fR .ad .sp .6 .RS 4n @@ -199,8 +178,6 @@ private HTTP support .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -217,6 +194,4 @@ MT-Level Safe .TE .SH SEE ALSO -.sp -.LP \fBIntro\fR(3), \fBprinters\fR(4), \fBprinters.conf\fR(4), \fBattributes\fR(5) diff --git a/usr/src/man/man3lib/libpool.3lib b/usr/src/man/man3lib/libpool.3lib index 9256db1801..6ecffed270 100644 --- a/usr/src/man/man3lib/libpool.3lib +++ b/usr/src/man/man3lib/libpool.3lib @@ -3,18 +3,16 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBPOOL 3LIB "April 9, 2016" +.TH LIBPOOL 3LIB "Aug 19, 2019" .SH NAME libpool \- pool configuration manipulation library .SH SYNOPSIS -.LP .nf -\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ] +\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lpool\fR [ \fIlibrary\fR... ] #include <\fBpool.h\fR> .fi .SH DESCRIPTION -.LP The functions in this library define the interface for reading and writing resource pools configuration files, as well as that for committing an existing configuration to becoming the running OS configuration (with respect to @@ -128,7 +126,7 @@ pool does not exist, perhaps because of a reconfiguration, then this property controls the binding behavior for the project member. If \fBsystem.bind-default\fR is true, then the project member is bound to the default pool (identified as the pool for which \fBpool.default\fR is true); -otherise the project member is refused access to the system. Care should be +otherwise the project member is refused access to the system. Care should be taken with the pools configuration if this property is set to false, so as to avoid denying users access to the system. .sp @@ -280,7 +278,7 @@ There are two types of objectives that can be set on a \fBpset\fR: .sp .ne 2 .na -\fB\fBlocality\fR\fR +\fBlocality\fR .ad .RS 15n This objective influences the impact that locality, as measured by lgroup data, @@ -288,7 +286,7 @@ has upon the chosen configuration. This objective can take one of three values: .sp .ne 2 .na -\fB\fBtight\fR\fR +\fBtight\fR .ad .RS 9n If set, configurations that maximize resource locality are favored. @@ -297,7 +295,7 @@ If set, configurations that maximize resource locality are favored. .sp .ne 2 .na -\fB\fBloose\fR\fR +\fBloose\fR .ad .RS 9n If set, configurations that minimize resource locality are favored. @@ -306,7 +304,7 @@ If set, configurations that minimize resource locality are favored. .sp .ne 2 .na -\fB\fBnone\fR\fR +\fBnone\fR .ad .RS 9n This is the default value for this objective. If set, configuration @@ -318,7 +316,7 @@ favorability is uninfluenced by resource locality. .sp .ne 2 .na -\fB\fButilization\fR\fR +\fButilization\fR .ad .RS 15n This objective favors configurations that allocate resources to partitions that @@ -332,7 +330,7 @@ operators are .sp .ne 2 .na -\fB\fB<\fR\fR +\fB<\fR .ad .RS 5n The ``less than'' operator is used to indicate that the specified value should @@ -342,7 +340,7 @@ be treated as a maximum target value. .sp .ne 2 .na -\fB\fB>\fR\fR +\fB>\fR .ad .RS 5n The ``greater than'' operator is used to indicate that the specified value @@ -352,7 +350,7 @@ should be treated as a minimum target value. .sp .ne 2 .na -\fB\fB~\fR\fR +\fB~\fR .ad .RS 5n The ``about'' operator is used to indicate that the specified value should be @@ -389,7 +387,7 @@ The \fBcpu.status\fR property can be set only to the following values: .sp .ne 2 .na -\fB\fBoff-line\fR\fR +\fBoff-line\fR .ad .RS 12n Set the CPU offline. @@ -398,7 +396,7 @@ Set the CPU offline. .sp .ne 2 .na -\fB\fBon-line\fR\fR +\fBon-line\fR .ad .RS 12n Set the CPU online. @@ -407,7 +405,7 @@ Set the CPU online. .sp .ne 2 .na -\fB\fBno-intr\fR\fR +\fBno-intr\fR .ad .RS 12n Disable interrupt processing on the CPU. @@ -418,7 +416,6 @@ Disable interrupt processing on the CPU. These values are defined in <\fBsys/processor.h\fR> as the \fBPS_OFFLINE\fR, \fBPS_ONLINE\fR, and \fBPS_NOINTR\fR macros. .SH INTERFACES -.LP The shared object \fBlibpool.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -462,13 +459,13 @@ l l . \fBpool_value_set_string\fR \fBpool_value_set_uint64\fR \fBpool_version\fR \fBpool_walk_components\fR \fBpool_walk_pools\fR \fBpool_walk_properties\fR -\fBpool_walk_resources\fR +\fBpool_walk_resources\fR .TE .SH FILES .ne 2 .na -\fB\fB/usr/lib/libpool.so.1\fR\fR +\fB/usr/lib/libpool.so.1\fR .ad .RS 28n shared object @@ -477,14 +474,13 @@ shared object .sp .ne 2 .na -\fB\fB/usr/lib/64/libpool.so.1\fR\fR +\fB/usr/lib/64/libpool.so.1\fR .ad .RS 28n 64-bit shared object .RE .SH ATTRIBUTES -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -503,7 +499,6 @@ MT-Level Safe .TE .SH SEE ALSO -.LP \fBIntro\fR(3), \fBpool_component_info\fR(3POOL), \fBpool_conf_open\fR(3POOL), \fBpool_conf_to_elem\fR(3POOL), \fBpool_create\fR(3POOL), \fBpool_error\fR(3POOL), \fBpool_get_binding\fR(3POOL), @@ -511,7 +506,6 @@ MT-Level Safe \fBpool_resource_create\fR(3POOL), \fBpool_value_alloc\fR(3POOL), \fBpool_walk_pools\fR(3POOL), \fBattributes\fR(5), \fBsmf\fR(5) .SH NOTES -.LP Functions in \fBlibpool\fR can be used to manipulate static configurations even when the pools facility is not enabled. See \fBpooladm\fR(1M) and \fBpool_set_status\fR(3POOL) for more information about enabling the pools diff --git a/usr/src/man/man3lib/libpthread.3lib b/usr/src/man/man3lib/libpthread.3lib index 63d5a3e8eb..9e65618e8d 100644 --- a/usr/src/man/man3lib/libpthread.3lib +++ b/usr/src/man/man3lib/libpthread.3lib @@ -4,17 +4,15 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBPTHREAD 3LIB "Oct 1, 2014" +.TH LIBPTHREAD 3LIB "Aug 19, 2019" .SH NAME libpthread \- POSIX threads library .SH SYNOPSIS -.LP .nf -cc -mt [ \fIflag\fR... ] \fIfile\fR... \fB-lpthread\fR [ \fB -lrt \fR \fIlibrary\fR... ] +cc -mt [ \fIflag\fR... ] \fIfile\fR... \fB-lpthread\fR [ \fIlibrary\fR... ] .fi .SH DESCRIPTION -.LP Historically, functions in this library provided POSIX threading support. See \fBstandards\fR(5). This functionality now resides in \fBlibc\fR(3LIB). .LP @@ -23,7 +21,6 @@ and compilation environments. The shared object is implemented as a filter on \fBlibc.so.1\fR. New application development need not specify \fB-lpthread\fR although doing so has no effect. .SH INTERFACES -.LP The shared object \fBlibpthread.so.1\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -74,13 +71,13 @@ l l . \fBpthread_setcancelstate\fR \fBpthread_setcanceltype\fR \fBpthread_setconcurrency\fR \fBpthread_setschedparam\fR \fBpthread_setspecific\fR \fBpthread_sigmask\fR -\fBpthread_testcancel\fR +\fBpthread_testcancel\fR .TE .SH FILES .ne 2 .na -\fB\fB/lib/libpthread.so.1\fR\fR +\fB/lib/libpthread.so.1\fR .ad .RS 27n a filter on \fB/lib/libc.so.1\fR @@ -89,14 +86,13 @@ a filter on \fB/lib/libc.so.1\fR .sp .ne 2 .na -\fB\fB/lib/64/libpthread.so.1\fR\fR +\fB/lib/64/libpthread.so.1\fR .ad .RS 27n a filter on \fB/lib/64/libc.so.1\fR .RE .SH ATTRIBUTES -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -111,7 +107,6 @@ MT-Level Safe .TE .SH SEE ALSO -.LP \fBpvs\fR(1), \fBIntro\fR(2), \fBIntro\fR(3), \fBlibc\fR(3LIB), \fBlibc_db\fR(3LIB), \fBlibthread\fR(3LIB), \fBattributes\fR(5), \fBstandards\fR(5), \fBthreads\fR(5) diff --git a/usr/src/man/man3lib/libresolv.3lib b/usr/src/man/man3lib/libresolv.3lib index f2ccb048c8..70c83174bb 100644 --- a/usr/src/man/man3lib/libresolv.3lib +++ b/usr/src/man/man3lib/libresolv.3lib @@ -3,13 +3,12 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBRESOLV 3LIB "Mar 24, 2004" +.TH LIBRESOLV 3LIB "Aug 19, 2019" .SH NAME libresolv \- resolver library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR... ] \fIfile\fR... \fB-lresolv\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-lresolv\fR \fB-lsocket\fR \fB-lnsl\fR [ \fIlibrary\fR... ] #include <\fBsys/types.h\fR> #include <\fBnetinet/in.h\fR> #include <\fBarpa/nameser.h\fR> @@ -18,13 +17,9 @@ cc [ \fIflag\fR... ] \fIfile\fR... \fB-lresolv\fR \fB -lsocket \fR \fB -lnsl \fR .fi .SH DESCRIPTION -.sp -.LP Functions in this library provide for creating, sending, and interpreting packets to the Internet domain name servers. .SH INTERFACES -.sp -.LP The shared object \fBlibresolv.so.2\fR provides the public interfaces defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -64,7 +59,7 @@ Use of the routines in the first column is discouraged. .TS c c l l . -\fBFUNCTION REFERENCED\fR \fBALIAS TO USE\fR +\fBFUNCTION REFERENCED\fR \fBALIAS TO USE\fR \fB__dn_skipname\fR \fBdn_skipname\fR \fB__fp_query\fR \fBfp_query\fR \fB__putlong\fR \fBputlong\fR @@ -75,10 +70,9 @@ l l . .TE .SH FILES -.sp .ne 2 .na -\fB\fB/lib/libresolv.so.1\fR\fR +\fB/lib/libresolv.so.1\fR .ad .RS 26n shared object for backward compatibility only @@ -87,7 +81,7 @@ shared object for backward compatibility only .sp .ne 2 .na -\fB\fB/lib/64/libresolv.so.1\fR\fR +\fB/lib/64/libresolv.so.1\fR .ad .RS 26n 64-bit shared object for backward compatibility only @@ -96,7 +90,7 @@ shared object for backward compatibility only .sp .ne 2 .na -\fB\fB/lib/libresolv.so.2\fR\fR +\fB/lib/libresolv.so.2\fR .ad .RS 26n shared object @@ -105,15 +99,13 @@ shared object .sp .ne 2 .na -\fB\fB/lib/64/libresolv.so.2\fR\fR +\fB/lib/64/libresolv.so.2\fR .ad .RS 26n 64-bit shared object .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -130,6 +122,4 @@ MT-Level See \fBresolver\fR(3RESOLV) .TE .SH SEE ALSO -.sp -.LP \fBpvs\fR(1), \fBIntro\fR(3), \fBresolver\fR(3RESOLV), \fBattributes\fR(5) diff --git a/usr/src/man/man3lib/libtsnet.3lib b/usr/src/man/man3lib/libtsnet.3lib index 224cc4eca0..5d653fbb2f 100644 --- a/usr/src/man/man3lib/libtsnet.3lib +++ b/usr/src/man/man3lib/libtsnet.3lib @@ -3,27 +3,22 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LIBTSNET 3LIB "Mar 7, 2006" +.TH LIBTSNET 3LIB "Aug 19, 2019" .SH NAME libtsnet \- Solaris Trusted Extensions network library .SH SYNOPSIS -.LP .nf -cc [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ] +cc [ \fIflag\fR... ] \fIfile\fR... \fB-ltsnet\fR [ \fIlibrary\fR... ] #include <\fBlibtsnet.h\fR> #include <\fBsys/tsol/tndb.h\fR> .fi .SH DESCRIPTION -.sp -.LP Functions in this library provide programmatic access to Solaris Trusted Extensions features such as labels and Mandatory Access Policy (MAC). These functions are available on systems that are configured with Trusted Extensions software. .SH INTERFACES -.sp -.LP The shared object \fBlibtsnet.so.1\fR provides the public interfaces that are defined below. See \fBIntro\fR(3) for additional information on shared object interfaces. @@ -32,14 +27,13 @@ interfaces. .sp .TS l l . -\fBtsol_getrhtype\fR +\fBtsol_getrhtype\fR .TE .SH FILES -.sp .ne 2 .na -\fB\fB/lib/libtsnet.so.1\fR\fR +\fB/lib/libtsnet.so.1\fR .ad .RS 25n shared object @@ -48,15 +42,13 @@ shared object .sp .ne 2 .na -\fB\fB/lib/64/libtsnet.so.1\fR\fR +\fB/lib/64/libtsnet.so.1\fR .ad .RS 25n 64-bit shared object .RE .SH ATTRIBUTES -.sp -.LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -72,6 +64,4 @@ MT-Level Safe .TE .SH SEE ALSO -.sp -.LP \fBIntro\fR(3), \fBlibtsol\fR(3LIB), \fBattributes\fR(5) diff --git a/usr/src/uts/common/fs/smbsrv/smb2_aapl.c b/usr/src/uts/common/fs/smbsrv/smb2_aapl.c index 3deac16513..d4d6bd607e 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_aapl.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_aapl.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* @@ -68,8 +68,8 @@ static int smb_aapl_ext_maxlen = 512; */ uint32_t smb2_aapl_crctx(smb_request_t *sr, - mbuf_chain_t *mbcin, - mbuf_chain_t *mbcout) + mbuf_chain_t *mbcin, + mbuf_chain_t *mbcout) { uint32_t cmdcode; uint32_t status; @@ -105,7 +105,7 @@ smb2_aapl_crctx(smb_request_t *sr, */ static uint32_t smb2_aapl_srv_query(smb_request_t *sr, - mbuf_chain_t *mbcin, mbuf_chain_t *mbcout) + mbuf_chain_t *mbcin, mbuf_chain_t *mbcout) { uint64_t client_bitmap; uint64_t client_caps; @@ -164,8 +164,8 @@ smb2_aapl_srv_query(smb_request_t *sr, */ int smb2_aapl_get_macinfo(smb_request_t *sr, smb_odir_t *od, - smb_fileinfo_t *fileinfo, smb_macinfo_t *mi, - char *tbuf, size_t tbuflen) + smb_fileinfo_t *fileinfo, smb_macinfo_t *mi, + char *tbuf, size_t tbuflen) { int rc; cred_t *kcr = zone_kcred(); @@ -224,7 +224,7 @@ smb2_aapl_get_macinfo(smb_request_t *sr, smb_odir_t *od, uio.uio_resid = sizeof (AfpInfo); uio.uio_segflg = UIO_SYSSPACE; uio.uio_extflg = UIO_COPY_DEFAULT; - rc = smb_fsop_read(sr, kcr, snode, NULL, &uio); + rc = smb_fsop_read(sr, kcr, snode, NULL, &uio, 0); if (rc == 0 && uio.uio_resid == 0) { bcopy(&AfpInfo[4], &mi->mi_finderinfo, sizeof (mi->mi_finderinfo)); diff --git a/usr/src/uts/common/fs/smbsrv/smb2_durable.c b/usr/src/uts/common/fs/smbsrv/smb2_durable.c index 7b65924ca4..56dda62832 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_durable.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_durable.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* @@ -844,7 +844,7 @@ smb2_dh_read_nvlist(smb_request_t *sr, smb_node_t *node, uio.uio_resid = flen; uio.uio_segflg = UIO_SYSSPACE; uio.uio_extflg = UIO_COPY_DEFAULT; - rc = smb_fsop_read(sr, kcr, node, NULL, &uio); + rc = smb_fsop_read(sr, kcr, node, NULL, &uio, 0); if (rc != 0) { cmn_err(CE_NOTE, "CA import (%s/%s) read, rc=%d", shr->shr_path, node->od_name, rc); diff --git a/usr/src/uts/common/fs/smbsrv/smb2_fsctl_sparse.c b/usr/src/uts/common/fs/smbsrv/smb2_fsctl_sparse.c index db89469cc0..90bb254670 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_fsctl_sparse.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_fsctl_sparse.c @@ -377,7 +377,7 @@ smb2_sparse_copy( uio.uio_extflg = UIO_COPY_DEFAULT; rc = smb_fsop_read(sr, src_ofile->f_cr, - src_ofile->f_node, src_ofile, &uio); + src_ofile->f_node, src_ofile, &uio, 0); if (rc != 0) { status = smb_errno2status(rc); return (status); diff --git a/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c b/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c index 5bc7b01260..52a5dd3a96 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* @@ -74,6 +74,7 @@ static uint16_t smb2_versions[] = { 0x202, /* SMB 2.002 */ 0x210, /* SMB 2.1 */ 0x300, /* SMB 3.0 */ + 0x302, /* SMB 3.02 */ }; static uint16_t smb2_nversions = sizeof (smb2_versions) / sizeof (smb2_versions[0]); diff --git a/usr/src/uts/common/fs/smbsrv/smb2_read.c b/usr/src/uts/common/fs/smbsrv/smb2_read.c index 9ef2aa57c4..f8c91c878f 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_read.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_read.c @@ -20,6 +20,8 @@ #include <smbsrv/smb2_kproto.h> #include <smbsrv/smb_fsops.h> +extern boolean_t smb_allow_unbuffered; + smb_sdrc_t smb2_read(smb_request_t *sr) { @@ -29,6 +31,7 @@ smb2_read(smb_request_t *sr) struct mbuf *m = NULL; uint16_t StructSize; uint8_t Padding; + uint8_t Flags; uint8_t DataOff; uint32_t Length; uint64_t Offset; @@ -41,15 +44,18 @@ smb2_read(smb_request_t *sr) uint32_t XferCount; uint32_t status; int rc = 0; + boolean_t unbuffered = B_FALSE; + int ioflag = 0; /* * SMB2 Read request */ rc = smb_mbc_decodef( &sr->smb_data, - "wb.lqqqlllww", + "wbblqqqlllww", &StructSize, /* w */ - &Padding, /* b. */ + &Padding, /* b */ + &Flags, /* b */ &Length, /* l */ &Offset, /* q */ &smb2fid.persistent, /* q */ @@ -104,6 +110,21 @@ smb2_read(smb_request_t *sr) sr->raw_data.max_bytes = Length; m = smb_mbuf_allocate(&vdb->vdb_uio); + /* + * Unbuffered refers to the MS-FSA Read argument by the same name. + * It indicates that the cache for this range should be flushed to disk, + * and data read directly from disk, bypassing the cache. + * We don't allow that degree of cache management. + * Translate this directly as FRSYNC, + * which should at least flush the cache first. + */ + + if (smb_allow_unbuffered && + (Flags & SMB2_READFLAG_READ_UNBUFFERED) != 0) { + unbuffered = B_TRUE; + ioflag = FRSYNC; + } + switch (of->f_tree->t_res_type & STYPE_MASK) { case STYPE_DISKTREE: if (!smb_node_is_dir(of->f_node)) { @@ -116,10 +137,13 @@ smb2_read(smb_request_t *sr) } } rc = smb_fsop_read(sr, of->f_cr, of->f_node, of, - &vdb->vdb_uio); + &vdb->vdb_uio, ioflag); break; case STYPE_IPC: - rc = smb_opipe_read(sr, &vdb->vdb_uio); + if (unbuffered) + rc = EINVAL; + else + rc = smb_opipe_read(sr, &vdb->vdb_uio); break; default: case STYPE_PRINTQ: diff --git a/usr/src/uts/common/fs/smbsrv/smb2_write.c b/usr/src/uts/common/fs/smbsrv/smb2_write.c index 9e0795e21f..776ea24ae1 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_write.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_write.c @@ -20,6 +20,8 @@ #include <smbsrv/smb2_kproto.h> #include <smbsrv/smb_fsops.h> +boolean_t smb_allow_unbuffered = B_TRUE; + smb_sdrc_t smb2_write(smb_request_t *sr) { @@ -41,6 +43,7 @@ smb2_write(smb_request_t *sr) int data_chain_off, skip; int stability = 0; int rc = 0; + boolean_t unbuffered = B_FALSE; /* * Decode SMB2 Write request @@ -111,6 +114,19 @@ smb2_write(smb_request_t *sr) if (Length == 0) goto errout; + /* + * Unbuffered refers to the MS-FSA Write argument by the same name. + * It indicates that the cache for this range should be flushed to disk, + * and data written directly to disk, bypassing the cache. + * We don't allow that degree of cache management. + * Translate this directly as FSYNC, + * which should at least flush the cache. + */ + + if (smb_allow_unbuffered && + (Flags & SMB2_WRITEFLAG_WRITE_UNBUFFERED) != 0) + unbuffered = B_TRUE; + switch (of->f_tree->t_res_type & STYPE_MASK) { case STYPE_DISKTREE: case STYPE_PRINTQ: @@ -123,8 +139,9 @@ smb2_write(smb_request_t *sr) break; } } - if ((Flags & SMB2_WRITEFLAG_WRITE_THROUGH) || - (of->f_node->flags & NODE_FLAGS_WRITE_THROUGH)) { + + if (unbuffered || (Flags & SMB2_WRITEFLAG_WRITE_THROUGH) != 0 || + (of->f_node->flags & NODE_FLAGS_WRITE_THROUGH) != 0) { stability = FSYNC; } rc = smb_fsop_write(sr, of->f_cr, of->f_node, of, @@ -137,7 +154,10 @@ smb2_write(smb_request_t *sr) break; case STYPE_IPC: - rc = smb_opipe_write(sr, &vdb->vdb_uio); + if (unbuffered || (Flags & SMB2_WRITEFLAG_WRITE_THROUGH) != 0) + rc = EINVAL; + else + rc = smb_opipe_write(sr, &vdb->vdb_uio); if (rc == 0) XferCount = Length; break; diff --git a/usr/src/uts/common/fs/smbsrv/smb_fsops.c b/usr/src/uts/common/fs/smbsrv/smb_fsops.c index 1b7c3a9fa9..8fafac5f60 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_fsops.c +++ b/usr/src/uts/common/fs/smbsrv/smb_fsops.c @@ -1380,7 +1380,7 @@ smb_fsop_freesp( */ int smb_fsop_read(smb_request_t *sr, cred_t *cr, smb_node_t *snode, - smb_ofile_t *ofile, uio_t *uio) + smb_ofile_t *ofile, uio_t *uio, int ioflag) { caller_context_t ct; cred_t *kcr = zone_kcred(); @@ -1449,7 +1449,7 @@ smb_fsop_read(smb_request_t *sr, cred_t *cr, smb_node_t *snode, } } - rc = smb_vop_read(snode->vp, uio, cr); + rc = smb_vop_read(snode->vp, uio, ioflag, cr); smb_node_end_crit(snode); return (rc); @@ -1980,7 +1980,7 @@ smb_fsop_lookup( if ((flags & SMB_FOLLOW_LINKS) && (vp->v_type == VLNK) && ((attr.sa_dosattr & FILE_ATTRIBUTE_REPARSE_POINT) == 0)) { rc = smb_pathname(sr, od_name, FOLLOW, root_node, dnode, - &lnk_dnode, &lnk_target_node, cr); + &lnk_dnode, &lnk_target_node, cr, NULL); if (rc != 0) { /* diff --git a/usr/src/uts/common/fs/smbsrv/smb_node.c b/usr/src/uts/common/fs/smbsrv/smb_node.c index 3e9933d51a..4a932b2f0b 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_node.c +++ b/usr/src/uts/common/fs/smbsrv/smb_node.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* * SMB Node State Machine @@ -599,7 +599,7 @@ smb_node_root_init(smb_server_t *sv, smb_node_t **svrootp) * so need to use kcred, not zone_kcred(). */ error = smb_pathname(NULL, zone->zone_rootpath, 0, - smb_root_node, smb_root_node, NULL, svrootp, kcred); + smb_root_node, smb_root_node, NULL, svrootp, kcred, NULL); return (error); } diff --git a/usr/src/uts/common/fs/smbsrv/smb_pathname.c b/usr/src/uts/common/fs/smbsrv/smb_pathname.c index fbf003c7c0..b1c096cde5 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_pathname.c +++ b/usr/src/uts/common/fs/smbsrv/smb_pathname.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. */ #include <smbsrv/smb_kproto.h> @@ -151,24 +151,26 @@ smb_pathname_reduce( char *last_component) { smb_node_t *root_node; - pathname_t ppn; + pathname_t ppn, mnt_pn; char *usepath; int lookup_flags = FOLLOW; int trailing_slash = 0; int err = 0; int len; - smb_node_t *vss_cur_node; - smb_node_t *vss_root_node; + smb_node_t *vss_node; smb_node_t *local_cur_node; smb_node_t *local_root_node; + boolean_t chk_vss; + char *gmttoken; ASSERT(dir_node); ASSERT(last_component); *dir_node = NULL; *last_component = '\0'; - vss_cur_node = NULL; - vss_root_node = NULL; + vss_node = NULL; + gmttoken = NULL; + chk_vss = B_FALSE; if (sr && sr->tid_tree) { if (STYPE_ISIPC(sr->tid_tree->t_res_type)) @@ -224,24 +226,27 @@ smb_pathname_reduce( } if (sr != NULL) { - boolean_t chk_vss; - if (sr->session->dialect >= SMB_VERS_2_BASE) + if (sr->session->dialect >= SMB_VERS_2_BASE) { chk_vss = sr->arg.open.create_timewarp; - else + } else { chk_vss = (sr->smb_flg2 & SMB_FLAGS2_REPARSE_PATH) != 0; - if (chk_vss) { - err = smb_vss_lookup_nodes(sr, root_node, cur_node, - usepath, &vss_cur_node, &vss_root_node); - if (err != 0) { - kmem_free(usepath, SMB_MAXPATHLEN); - return (err); - } - len = strlen(usepath); - local_cur_node = vss_cur_node; - local_root_node = vss_root_node; + if (chk_vss) { + gmttoken = kmem_alloc(SMB_VSS_GMT_SIZE, + KM_SLEEP); + err = smb_vss_extract_gmttoken(usepath, + gmttoken); + if (err != 0) { + kmem_free(usepath, SMB_MAXPATHLEN); + kmem_free(gmttoken, SMB_VSS_GMT_SIZE); + return (err); + } + len = strlen(usepath); + } } + if (chk_vss) + (void) pn_alloc(&mnt_pn); } if (usepath[len - 1] == '/') @@ -254,10 +259,10 @@ smb_pathname_reduce( if ((err = pn_set(&ppn, usepath)) != 0) { (void) pn_free(&ppn); kmem_free(usepath, SMB_MAXPATHLEN); - if (vss_cur_node != NULL) - (void) smb_node_release(vss_cur_node); - if (vss_root_node != NULL) - (void) smb_node_release(vss_root_node); + if (chk_vss) + (void) pn_free(&mnt_pn); + if (gmttoken != NULL) + kmem_free(gmttoken, SMB_VSS_GMT_SIZE); return (err); } @@ -266,14 +271,21 @@ smb_pathname_reduce( * last component. (We only need to return an smb_node for * the second to last component; a name is returned for the * last component.) + * + * For VSS requests, the last component might be a filesystem of its + * own, and we need to discover that before exiting this function, + * so allow the lookup to happen on the last component. + * We'll correct this later when we convert to the snapshot. */ - if (trailing_slash) { - (void) strlcpy(last_component, ".", MAXNAMELEN); - } else { - (void) pn_setlast(&ppn); - (void) strlcpy(last_component, ppn.pn_path, MAXNAMELEN); - ppn.pn_path[0] = '\0'; + if (!chk_vss) { + if (trailing_slash) { + (void) strlcpy(last_component, ".", MAXNAMELEN); + } else { + (void) pn_setlast(&ppn); + (void) strlcpy(last_component, ppn.pn_path, MAXNAMELEN); + ppn.pn_path[0] = '\0'; + } } if ((strcmp(ppn.pn_buf, "/") == 0) || (ppn.pn_buf[0] == '\0')) { @@ -281,13 +293,63 @@ smb_pathname_reduce( *dir_node = local_cur_node; } else { err = smb_pathname(sr, ppn.pn_buf, lookup_flags, - local_root_node, local_cur_node, NULL, dir_node, cred); + local_root_node, local_cur_node, NULL, dir_node, cred, + chk_vss ? &mnt_pn : NULL); } (void) pn_free(&ppn); kmem_free(usepath, SMB_MAXPATHLEN); /* + * We need to try and convert to snapshots, even on error. + * This is to handle the following cases: + * - We're on the lowest level filesystem, but a directory got renamed + * on the live version. We'll get ENOENT, but can still find it in + * the snapshot. + * - The last component was actually a file. We need to leave the last + * component in in case it is, itself, a mountpoint, but that means + * we might get ENOTDIR if it's not actually a directory. + * + * Note that if you change the share-relative name of a mountpoint, + * you won't be able to access previous versions of files under it. + */ + if (chk_vss && *dir_node != NULL) { + if ((err = smb_vss_lookup_nodes(sr, *dir_node, &vss_node, + gmttoken)) == 0) { + char *p = mnt_pn.pn_path; + size_t pathleft; + + smb_node_release(*dir_node); + *dir_node = NULL; + pathleft = pn_pathleft(&mnt_pn); + + if (pathleft == 0 || trailing_slash) { + (void) strlcpy(last_component, ".", MAXNAMELEN); + } else { + (void) pn_setlast(&mnt_pn); + (void) strlcpy(last_component, mnt_pn.pn_path, + MAXNAMELEN); + mnt_pn.pn_path[0] = '\0'; + pathleft -= strlen(last_component); + } + + if (pathleft != 0) { + err = smb_pathname(sr, p, lookup_flags, + vss_node, vss_node, NULL, dir_node, cred, + NULL); + } else { + *dir_node = vss_node; + vss_node = NULL; + } + } + } + + if (chk_vss) + (void) pn_free(&mnt_pn); + if (gmttoken != NULL) + kmem_free(gmttoken, SMB_VSS_GMT_SIZE); + + /* * Prevent traversal to another file system if mount point * traversal is disabled. * @@ -318,11 +380,8 @@ smb_pathname_reduce( *last_component = 0; } - if (vss_cur_node != NULL) - (void) smb_node_release(vss_cur_node); - if (vss_root_node != NULL) - (void) smb_node_release(vss_root_node); - + if (vss_node != NULL) + (void) smb_node_release(vss_node); return (err); } @@ -357,11 +416,11 @@ smb_pathname_reduce( int smb_pathname(smb_request_t *sr, char *path, int flags, smb_node_t *root_node, smb_node_t *cur_node, smb_node_t **dir_node, - smb_node_t **ret_node, cred_t *cred) + smb_node_t **ret_node, cred_t *cred, pathname_t *mnt_pn) { char *component, *real_name, *namep; pathname_t pn, rpn, upn, link_pn; - smb_node_t *dnode, *fnode; + smb_node_t *dnode, *fnode, *mnt_node; smb_attr_t attr; vnode_t *rootvp, *vp; size_t pathleft; @@ -370,6 +429,7 @@ smb_pathname(smb_request_t *sr, char *path, int flags, int local_flags; uint32_t abe_flag = 0; char namebuf[MAXNAMELEN]; + vnode_t *fsrootvp = NULL; if (path == NULL) return (EINVAL); @@ -390,6 +450,11 @@ smb_pathname(smb_request_t *sr, char *path, int flags, return (err); } + if (mnt_pn != NULL && (err = pn_set(mnt_pn, path) != 0)) { + (void) pn_free(&upn); + return (err); + } + if (SMB_TREE_SUPPORTS_ABE(sr)) abe_flag = SMB_ABE; @@ -399,6 +464,11 @@ smb_pathname(smb_request_t *sr, char *path, int flags, component = kmem_alloc(MAXNAMELEN, KM_SLEEP); real_name = kmem_alloc(MAXNAMELEN, KM_SLEEP); + if (mnt_pn != NULL) { + mnt_node = cur_node; + smb_node_ref(cur_node); + } else + mnt_node = NULL; fnode = NULL; dnode = cur_node; smb_node_ref(dnode); @@ -531,18 +601,53 @@ smb_pathname(smb_request_t *sr, char *path, int flags, upn.pn_pathlen--; } + /* + * If the node we looked up is the root of a filesystem, + * snapshot the lookup so we can replay this after discovering + * the lowest mounted filesystem. + */ + if (mnt_pn != NULL && + fnode != NULL && + (err = VFS_ROOT(fnode->vp->v_vfsp, &fsrootvp)) == 0) { + if (fsrootvp == fnode->vp) { + mnt_pn->pn_pathlen = pn_pathleft(&upn); + mnt_pn->pn_path = mnt_pn->pn_buf + + ((ptrdiff_t)upn.pn_path - + (ptrdiff_t)upn.pn_buf); + + smb_node_ref(fnode); + if (mnt_node != NULL) + smb_node_release(mnt_node); + mnt_node = fnode; + + } + VN_RELE(fsrootvp); + } } if ((pathleft) && (err == ENOENT)) err = ENOTDIR; - if (err) { + if (mnt_node == NULL) + mnt_pn = NULL; + + /* + * We always want to return a node when we're doing VSS + * (mnt_pn != NULL) + */ + if (mnt_pn == NULL && err != 0) { if (fnode) smb_node_release(fnode); if (dnode) smb_node_release(dnode); } else { - *ret_node = fnode; + if (mnt_pn != NULL) { + *ret_node = mnt_node; + if (fnode != NULL) + smb_node_release(fnode); + } else { + *ret_node = fnode; + } if (dir_node) *dir_node = dnode; diff --git a/usr/src/uts/common/fs/smbsrv/smb_read.c b/usr/src/uts/common/fs/smbsrv/smb_read.c index 1cd046a1eb..0b982337d0 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_read.c +++ b/usr/src/uts/common/fs/smbsrv/smb_read.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ #include <smbsrv/smb_kproto.h> @@ -438,7 +438,7 @@ smb_common_read(smb_request_t *sr, smb_rw_param_t *param) top = smb_mbuf_allocate(&vdb->vdb_uio); rc = smb_fsop_read(sr, sr->user_cr, node, ofile, - &vdb->vdb_uio); + &vdb->vdb_uio, 0); sr->raw_data.max_bytes -= vdb->vdb_uio.uio_resid; smb_mbuf_trim(top, sr->raw_data.max_bytes); diff --git a/usr/src/uts/common/fs/smbsrv/smb_vops.c b/usr/src/uts/common/fs/smbsrv/smb_vops.c index 4b0f99839f..675b4dd6e3 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_vops.c +++ b/usr/src/uts/common/fs/smbsrv/smb_vops.c @@ -250,12 +250,12 @@ smb_vop_other_opens(vnode_t *vp, int mode) */ int -smb_vop_read(vnode_t *vp, uio_t *uiop, cred_t *cr) +smb_vop_read(vnode_t *vp, uio_t *uiop, int ioflag, cred_t *cr) { int error; (void) VOP_RWLOCK(vp, V_WRITELOCK_FALSE, &smb_ct); - error = VOP_READ(vp, uiop, 0, cr, &smb_ct); + error = VOP_READ(vp, uiop, ioflag, cr, &smb_ct); VOP_RWUNLOCK(vp, V_WRITELOCK_FALSE, &smb_ct); return (error); } diff --git a/usr/src/uts/common/fs/smbsrv/smb_vss.c b/usr/src/uts/common/fs/smbsrv/smb_vss.c index 72657ae3be..d0339e7352 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_vss.c +++ b/usr/src/uts/common/fs/smbsrv/smb_vss.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* @@ -78,18 +78,22 @@ smb_vss_enum_snapshots(smb_request_t *sr, smb_fsctl_t *fsctl) uint32_t count = 0; char *root_path; uint32_t status = NT_STATUS_SUCCESS; - smb_node_t *tnode; smb_gmttoken_response_t snaps; - ASSERT(sr->tid_tree); - ASSERT(sr->tid_tree->t_snode); + ASSERT(sr->fid_ofile); + ASSERT(sr->fid_ofile->f_node); if (fsctl->MaxOutputResp < SMB_VSS_COUNT_SIZE) return (NT_STATUS_INVALID_PARAMETER); - tnode = sr->tid_tree->t_snode; + /* + * smbd will find the root of the lowest filesystem from mntpath of a + * file by comparing it agaisnt mnttab, repeatedly removing components + * until one matches. + */ root_path = kmem_zalloc(MAXPATHLEN, KM_SLEEP); - if (smb_node_getmntpath(tnode, root_path, MAXPATHLEN) != 0) + if (smb_node_getmntpath(sr->fid_ofile->f_node, root_path, + MAXPATHLEN) != 0) return (NT_STATUS_INVALID_PARAMETER); if (fsctl->MaxOutputResp == SMB_VSS_COUNT_SIZE) { @@ -118,71 +122,43 @@ smb_vss_enum_snapshots(smb_request_t *sr, smb_fsctl_t *fsctl) * sr - the request info, used to find root of dataset, * unicode or ascii, where the share is rooted in the * dataset - * root_node - root of the share * cur_node - where in the share for the command - * buf - is the path for the command to be processed - * returned without @GMT if processed * vss_cur_node - returned value for the snapshot version * of the cur_node - * vss_root_node - returned value for the snapshot version - * of the root_node + * gmttoken - if SMB1, the gmttoken to be used to find the snapshot. + * Otherwise, NULL. * * This routine is the processing for handling the * SMB_FLAGS2_REPARSE_PATH bit being set in the smb header. * * By using the cur_node passed in, a new node is found or * created that is the same place in the directory tree, but - * in the snapshot. We also use root_node to do the same for - * the root. - * Once the new smb node is found, the path is modified by - * removing the @GMT token from the path in the buf. + * in the snapshot. */ int -smb_vss_lookup_nodes(smb_request_t *sr, smb_node_t *root_node, - smb_node_t *cur_node, char *buf, smb_node_t **vss_cur_node, - smb_node_t **vss_root_node) +smb_vss_lookup_nodes(smb_request_t *sr, smb_node_t *cur_node, + smb_node_t **vss_cur_node, char *gmttoken) { smb_arg_open_t *op = &sr->arg.open; - smb_node_t *tnode; char *snapname, *path; - char *gmttoken; - char gmttok_buf[SMB_VSS_GMT_SIZE]; vnode_t *fsrootvp = NULL; time_t toktime; int err = 0; - boolean_t smb1; if (sr->tid_tree == NULL) return (ESTALE); - tnode = sr->tid_tree->t_snode; - - ASSERT(tnode); - ASSERT(tnode->vp); - ASSERT(tnode->vp->v_vfsp); - - smb1 = (sr->session->dialect < SMB_VERS_2_BASE); - if (smb1) { - const char *p; - - /* get gmttoken from buf */ - if ((p = smb_vss_find_gmttoken(buf)) == NULL) - return (ENOENT); - - bcopy(p, gmttok_buf, SMB_VSS_GMT_SIZE); - gmttok_buf[SMB_VSS_GMT_SIZE - 1] = '\0'; - gmttoken = gmttok_buf; + if (gmttoken != NULL) { toktime = 0; } else { /* SMB2 and later */ - gmttoken = NULL; toktime = op->timewarp.tv_sec; } path = smb_srm_alloc(sr, MAXPATHLEN); snapname = smb_srm_alloc(sr, MAXPATHLEN); - err = smb_node_getmntpath(tnode, path, MAXPATHLEN); + err = smb_node_getmntpath(cur_node, path, MAXPATHLEN); if (err != 0) return (err); @@ -197,26 +173,16 @@ smb_vss_lookup_nodes(smb_request_t *sr, smb_node_t *root_node, return (ENOENT); /* find snapshot nodes */ - err = VFS_ROOT(tnode->vp->v_vfsp, &fsrootvp); + err = VFS_ROOT(cur_node->vp->v_vfsp, &fsrootvp); if (err != 0) return (err); - /* find snapshot node corresponding to root_node */ - err = smb_vss_lookup_node(sr, root_node, fsrootvp, - snapname, cur_node, vss_root_node); - if (err == 0) { - /* find snapshot node corresponding to cur_node */ - err = smb_vss_lookup_node(sr, cur_node, fsrootvp, - snapname, cur_node, vss_cur_node); - if (err != 0) - smb_node_release(*vss_root_node); - } + /* find snapshot node corresponding to cur_node */ + err = smb_vss_lookup_node(sr, cur_node, fsrootvp, + snapname, cur_node, vss_cur_node); VN_RELE(fsrootvp); - if (smb1) - smb_vss_remove_first_token_from_path(buf); - return (err); } @@ -426,7 +392,7 @@ smb_vss_get_snapshots_free(smb_gmttoken_response_t *reply) */ static void smb_vss_map_gmttoken(smb_tree_t *tree, char *path, char *gmttoken, - time_t toktime, char *snapname) + time_t toktime, char *snapname) { smb_gmttoken_snapname_t request; smb_string_t result; @@ -442,3 +408,20 @@ smb_vss_map_gmttoken(smb_tree_t *tree, char *path, char *gmttoken, &request, smb_gmttoken_snapname_xdr, &result, smb_string_xdr); } + +int +smb_vss_extract_gmttoken(char *buf, char *gmttoken) +{ + const char *p; + + /* get gmttoken from buf */ + if ((p = smb_vss_find_gmttoken(buf)) == NULL) + return (ENOENT); + + bcopy(p, gmttoken, SMB_VSS_GMT_SIZE); + gmttoken[SMB_VSS_GMT_SIZE - 1] = '\0'; + + smb_vss_remove_first_token_from_path(buf); + + return (0); +} diff --git a/usr/src/uts/common/smbsrv/smb2.h b/usr/src/uts/common/smbsrv/smb2.h index d58b3cbb0b..f18fcbd379 100644 --- a/usr/src/uts/common/smbsrv/smb2.h +++ b/usr/src/uts/common/smbsrv/smb2.h @@ -10,7 +10,7 @@ */ /* - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SMB_SMB2_H @@ -318,9 +318,15 @@ typedef enum { #define SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB 0x0001 /* + * SMB2 Read + */ +#define SMB2_READFLAG_READ_UNBUFFERED 0x00000001 + +/* * SMB2 Write */ #define SMB2_WRITEFLAG_WRITE_THROUGH 0x00000001 +#define SMB2_WRITEFLAG_WRITE_UNBUFFERED 0x00000002 /* * SMB2 Lock Request diff --git a/usr/src/uts/common/smbsrv/smb_fsops.h b/usr/src/uts/common/smbsrv/smb_fsops.h index 22cbd665bf..395ad5d397 100644 --- a/usr/src/uts/common/smbsrv/smb_fsops.h +++ b/usr/src/uts/common/smbsrv/smb_fsops.h @@ -22,7 +22,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SMBSRV_SMB_FSOPS_H @@ -78,7 +78,7 @@ int smb_fsop_freesp(smb_request_t *sr, cred_t *cr, smb_ofile_t *, off64_t, off64_t); int smb_fsop_read(smb_request_t *, cred_t *, smb_node_t *, smb_ofile_t *, - uio_t *); + uio_t *, int); int smb_fsop_write(smb_request_t *, cred_t *, smb_node_t *, smb_ofile_t *, uio_t *, uint32_t *, int); diff --git a/usr/src/uts/common/smbsrv/smb_kproto.h b/usr/src/uts/common/smbsrv/smb_kproto.h index 751f047e0c..aeb780dc35 100644 --- a/usr/src/uts/common/smbsrv/smb_kproto.h +++ b/usr/src/uts/common/smbsrv/smb_kproto.h @@ -22,7 +22,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Syneto S.R.L. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ /* @@ -552,7 +552,7 @@ int smb_pathname_reduce(smb_request_t *, cred_t *, const char *, smb_node_t *, smb_node_t *, smb_node_t **, char *); int smb_pathname(smb_request_t *, char *, int, smb_node_t *, - smb_node_t *, smb_node_t **, smb_node_t **, cred_t *); + smb_node_t *, smb_node_t **, smb_node_t **, cred_t *, pathname_t *); /* * smb_notify.c @@ -861,9 +861,9 @@ boolean_t smb_ace_is_access(int); boolean_t smb_ace_is_audit(int); uint32_t smb_vss_enum_snapshots(smb_request_t *, smb_fsctl_t *); -int smb_vss_lookup_nodes(smb_request_t *, smb_node_t *, smb_node_t *, - char *, smb_node_t **, smb_node_t **); +int smb_vss_lookup_nodes(smb_request_t *, smb_node_t *, smb_node_t **, char *); vnode_t *smb_lookuppathvptovp(smb_request_t *, char *, vnode_t *, vnode_t *); +int smb_vss_extract_gmttoken(char *, char *); void smb_panic(char *, const char *, int); #pragma does_not_return(smb_panic) diff --git a/usr/src/uts/common/smbsrv/smb_vops.h b/usr/src/uts/common/smbsrv/smb_vops.h index 4c869de38c..cf275d2a19 100644 --- a/usr/src/uts/common/smbsrv/smb_vops.h +++ b/usr/src/uts/common/smbsrv/smb_vops.h @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2016 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SMBSRV_SMB_VOPS_H @@ -125,7 +125,7 @@ void smb_vop_fini(void); void smb_vop_start(void); int smb_vop_open(vnode_t **, int, cred_t *); void smb_vop_close(vnode_t *, int, cred_t *); -int smb_vop_read(vnode_t *, uio_t *, cred_t *); +int smb_vop_read(vnode_t *, uio_t *, int, cred_t *); int smb_vop_write(vnode_t *, uio_t *, int, uint32_t *, cred_t *); int smb_vop_ioctl(vnode_t *, int, void *, cred_t *); int smb_vop_getattr(vnode_t *, vnode_t *, smb_attr_t *, int, cred_t *); diff --git a/usr/src/uts/common/smbsrv/smbinfo.h b/usr/src/uts/common/smbsrv/smbinfo.h index bc2e4a769b..dcbe82a10b 100644 --- a/usr/src/uts/common/smbsrv/smbinfo.h +++ b/usr/src/uts/common/smbsrv/smbinfo.h @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2017 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SMBSRV_SMBINFO_H @@ -230,6 +230,7 @@ const char *smbnative_lm_str(smb_version_t *); #define SMB_VERS_2_002 0x202 /* "2.002" */ #define SMB_VERS_2_1 0x210 /* "2.1" */ #define SMB_VERS_3_0 0x300 /* "3.0" */ +#define SMB_VERS_3_02 0x302 /* "3.02" */ #ifdef __cplusplus } |