summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2019-06-07 12:08:09 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2019-06-07 12:08:09 +0000
commit215e9bce5b9163b526372d29a4eb6625fa076466 (patch)
treed42bad5b2e0c8bd1652a5314b05cc93068b99c39
parentaa2898c4ff7db0df94db22a2ce5d7958a806e4d8 (diff)
parente32fc5b22ae6b7fc68456ddf6ca2c9abe50d8485 (diff)
downloadillumos-joyent-215e9bce5b9163b526372d29a4eb6625fa076466.tar.gz
[illumos-gate merge]
commit e32fc5b22ae6b7fc68456ddf6ca2c9abe50d8485 11097 SPARC needs some instances of POST_PROCESS_O to be POST_PROCESS_S_O commit 96dd34fce4380f5569e21176b9b310b458e5fb13 11136 SPARC build fails with ctfconvert error in libucb commit a11fb0e740178d9398c8aeb4281d1a0434402933 11135 SPARC build fails due to missing libmlsvc in mdb commit 94725e8ca08a7fafbd28e237d62672843e06032f 11099 libfksmbsrv Makefiles need updating on SPARC too commit 9e6ea9213154ef7c52331a70f1ebe24181db43f1 11096 SPARC build failure due to typo in mp_startup.c commit 38a8ff6cfbcf4832d77452cb1d68109eb629fcd1 11095 SPARC build failure after ht.h was renamed commit 685c1a21304711e8d0a21bade51b783487d53044 11175 libm should use signbit() correctly 11188 c99 math macros should return strictly backward compatible values commit d0bed8f264c913bf83285b0beed22bd3a9f7eb08 11006 idmap fall-back to DC discovery is broken commit a774f103e3771c7c04da927df024cf184248ad8f 11005 ads_site broken in sharectl get/set smb commit fea136a04b3f86ab3ec31e4c157379030fee9ade 11004 Several door servers don't properly handle exiting threads 11198 Allow adjustment of max_threads for idmapd commit ce43d0aebcca79dc3b939e594d0615a700a4d1bd 11003 smbutil: broken formatting in usage message commit a24b1e64b69e2297f103cf07335ccbf50ad77648 11002 recursive mutex detection in libfakekernel commit 5831d79bf54a743911bb94d7dcf465c178e62d4c 11001 smbd segfaults while running smbtorture.rpc commit 9dc305594346dde9c1a26d5cd4575dfa718d62ef 11000 assertion failed in common/fs/smbsrv/smb_sd.c commit f76ff24c761689d2859f3bc5faa7ec9e84f92234 11186 mdb's output autowrapping should be optional -- and disabled commit aa5acf16d728e573cbc426dacec80819b7b9cef2 10940 open(9E) should talk more about FEXCL Conflicts: usr/src/man/man9e/open.9e usr/src/cmd/mdb/test/options/tst.autowrap.mdb usr/src/cmd/mdb/common/mdb/mdb_io.c
-rw-r--r--usr/src/cmd/fs.d/smbclnt/smbutil/smbutil.c23
-rw-r--r--usr/src/cmd/idmap/idmapd/idmap.xml22
-rw-r--r--usr/src/cmd/idmap/idmapd/idmap_config.c44
-rw-r--r--usr/src/cmd/idmap/idmapd/idmap_config.h5
-rw-r--r--usr/src/cmd/idmap/idmapd/idmapd.c19
-rw-r--r--usr/src/cmd/idmap/idmapd/init.c3
-rw-r--r--usr/src/cmd/idmap/test-getdc/getdc_main.c9
-rw-r--r--usr/src/cmd/ldapcachemgr/cachemgr.c8
-rw-r--r--usr/src/cmd/mdb/sparc/v7/libfksmbsrv/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v7/libmlsvc/Makefile46
-rw-r--r--usr/src/cmd/mdb/sparc/v9/libfksmbsrv/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v9/libmlsvc/Makefile47
-rw-r--r--usr/src/cmd/nscd/nscd_frontend.c4
-rw-r--r--usr/src/head/iso/math_c99.h10
-rw-r--r--usr/src/lib/libadutils/common/addisc.c197
-rw-r--r--usr/src/lib/libc/sparc/Makefile.com3
-rw-r--r--usr/src/lib/libc/sparcv9/Makefile.com3
-rw-r--r--usr/src/lib/libfakekernel/common/mapfile-vers2
-rw-r--r--usr/src/lib/libfakekernel/common/mutex.c10
-rw-r--r--usr/src/lib/libm/common/C/jn.c244
-rw-r--r--usr/src/lib/libm/common/C/tanh.c7
-rw-r--r--usr/src/lib/libm/common/LD/__rem_pio2l.c5
-rw-r--r--usr/src/lib/libm/common/LD/jnl.c253
-rw-r--r--usr/src/lib/libm/common/Q/__rem_pio2l.c15
-rw-r--r--usr/src/lib/libm/common/Q/atan2l.c14
-rw-r--r--usr/src/lib/libm/common/Q/jnl.c266
-rw-r--r--usr/src/lib/libmd/Makefile.targ3
-rw-r--r--usr/src/lib/libsys/Makefile.targ3
-rw-r--r--usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.targ7
-rw-r--r--usr/src/lib/smbsrv/libmlsvc/common/lsalib.c5
-rw-r--r--usr/src/lib/smbsrv/libmlsvc/common/srvsvc_svc.c14
-rw-r--r--usr/src/lib/smbsrv/libmlsvc/common/winreg_svc.c4
-rw-r--r--usr/src/lib/smbsrv/libsmb/common/smb_cfg.c35
-rw-r--r--usr/src/man/man9e/open.9e2
-rwxr-xr-xusr/src/tools/quick/make-idmap1
-rw-r--r--usr/src/ucblib/libucb/Makefile.com4
-rw-r--r--usr/src/ucblib/libucb/sparc/Makefile6
-rw-r--r--usr/src/ucblib/libucb/sparcv9/Makefile6
-rw-r--r--usr/src/uts/common/fs/smbsrv/smb_nt_transact_security.c11
-rw-r--r--usr/src/uts/sun4/os/mp_startup.c3
-rw-r--r--usr/src/uts/sun4u/sys/Makefile1
41 files changed, 856 insertions, 514 deletions
diff --git a/usr/src/cmd/fs.d/smbclnt/smbutil/smbutil.c b/usr/src/cmd/fs.d/smbclnt/smbutil/smbutil.c
index aa10f999ee..fb9ce4aa86 100644
--- a/usr/src/cmd/fs.d/smbclnt/smbutil/smbutil.c
+++ b/usr/src/cmd/fs.d/smbclnt/smbutil/smbutil.c
@@ -34,7 +34,7 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2018 Nexenta Systems, Inc.
*/
#include <sys/param.h>
@@ -190,17 +190,16 @@ help(void)
printf("\n");
printf(gettext("usage: %s [-hv] subcommand [args]\n"), __progname);
printf(gettext("where subcommands are:\n"
- " crypt slightly obscure password\n"
- " help display help on specified subcommand\n"
- /* " lc display active connections\n" */
- " info display server type and version\n"
- " login login to specified host\n"
- " logout logout from specified host\n"
- " logoutall logout all users (requires privilege)\n"
- " lookup resolve NetBIOS name to IP address\n"
- " print print file to the specified remote printer\n"
- " status resolve IP address or DNS name to NetBIOS names\n"
- " view list resources on specified host\n"
+ " crypt slightly obscure password\n"
+ " help display help on specified subcommand\n"
+ " info display server type and version\n"
+ " login login to specified host\n"
+ " logout logout from specified host\n"
+ " logoutall logout all users (requires privilege)\n"
+ " lookup resolve NetBIOS name to IP address\n"
+ " print print file to the specified remote printer\n"
+ " status resolve IP address or DNS name to NetBIOS names\n"
+ " view list resources on specified host\n"
"\n"));
exit(1);
}
diff --git a/usr/src/cmd/idmap/idmapd/idmap.xml b/usr/src/cmd/idmap/idmapd/idmap.xml
index c1461616bc..2b6f7b7ad5 100644
--- a/usr/src/cmd/idmap/idmapd/idmap.xml
+++ b/usr/src/cmd/idmap/idmapd/idmap.xml
@@ -2,7 +2,7 @@
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
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.
CDDL HEADER START
@@ -41,12 +41,12 @@
<single_instance />
<dependency
- name='rpcbind'
- grouping='require_all'
- restart_on='restart'
- type='service'>
- <service_fmri value='svc:/network/rpc/bind' />
- </dependency>
+ name='rpcbind'
+ grouping='require_all'
+ restart_on='restart'
+ type='service'>
+ <service_fmri value='svc:/network/rpc/bind' />
+ </dependency>
<dependency name='filesystem-minimal'
grouping='require_all'
@@ -94,6 +94,10 @@
type='count'
value='0' />
<propval
+ name='max_threads'
+ type='count'
+ value='40' />
+ <propval
name='value_authorization'
type='astring'
value='solaris.smf.value.idmap' />
@@ -114,6 +118,10 @@
type='count'
value='3600' />
<propval
+ name='site_name'
+ type='astring'
+ value='' />
+ <propval
name='use_ads'
type='boolean'
value='true' />
diff --git a/usr/src/cmd/idmap/idmapd/idmap_config.c b/usr/src/cmd/idmap/idmapd/idmap_config.c
index ad3c70b932..5d92d12503 100644
--- a/usr/src/cmd/idmap/idmapd/idmap_config.c
+++ b/usr/src/cmd/idmap/idmapd/idmap_config.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 2019 Nexenta Systems, Inc. All rights reserved.
*/
@@ -45,6 +45,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <note.h>
+#include <limits.h>
#include "idmapd.h"
#include "addisc.h"
@@ -77,6 +78,11 @@
*/
#define MIN_REDISCOVERY_INTERVAL 60
+/*
+ * Max number of concurrent door calls
+ */
+#define MAX_THREADS_DEFAULT 40
+
enum event_type {
EVENT_NOTHING, /* Woke up for no good reason */
EVENT_TIMEOUT, /* Timeout expired */
@@ -1481,7 +1487,8 @@ idmap_cfg_start_updates(void)
*/
static
int
-valid_ldap_attr(const char *attr) {
+valid_ldap_attr(const char *attr)
+{
for (; *attr; attr++) {
if (!isalnum(*attr) && *attr != '-' &&
*attr != '_' && *attr != '.' && *attr != ';')
@@ -1601,6 +1608,15 @@ idmap_cfg_load_smf(idmap_cfg_handles_t *handles, idmap_pg_config_t *pgcfg,
if (rc != 0)
(*errors)++;
+ rc = get_val_int(handles, "max_threads",
+ &pgcfg->max_threads, SCF_TYPE_COUNT);
+ if (rc != 0)
+ (*errors)++;
+ if (pgcfg->max_threads == 0)
+ pgcfg->max_threads = MAX_THREADS_DEFAULT;
+ if (pgcfg->max_threads > UINT_MAX)
+ pgcfg->max_threads = UINT_MAX;
+
rc = get_val_int(handles, "id_cache_timeout",
&pgcfg->id_cache_timeout, SCF_TYPE_COUNT);
if (rc != 0)
@@ -1632,9 +1648,10 @@ idmap_cfg_load_smf(idmap_cfg_handles_t *handles, idmap_pg_config_t *pgcfg,
free(pgcfg->domain_name);
pgcfg->domain_name = NULL;
}
+ if (pgcfg->domain_name != NULL)
+ pgcfg->domain_name_auto_disc = B_FALSE;
(void) ad_disc_set_DomainName(handles->ad_ctx,
pgcfg->domain_name);
- pgcfg->domain_name_auto_disc = B_FALSE;
}
rc = get_val_astring(handles, "default_domain",
@@ -1727,16 +1744,30 @@ idmap_cfg_load_smf(idmap_cfg_handles_t *handles, idmap_pg_config_t *pgcfg,
if (rc != 0)
(*errors)++;
else {
+ if (pgcfg->forest_name != NULL &&
+ pgcfg->forest_name[0] == '\0') {
+ free(pgcfg->forest_name);
+ pgcfg->forest_name = NULL;
+ }
+ if (pgcfg->forest_name != NULL)
+ pgcfg->forest_name_auto_disc = B_FALSE;
(void) ad_disc_set_ForestName(handles->ad_ctx,
pgcfg->forest_name);
- pgcfg->forest_name_auto_disc = B_FALSE;
}
rc = get_val_astring(handles, "site_name", &pgcfg->site_name);
if (rc != 0)
(*errors)++;
- else
+ else {
+ if (pgcfg->site_name != NULL &&
+ pgcfg->site_name[0] == '\0') {
+ free(pgcfg->site_name);
+ pgcfg->site_name = NULL;
+ }
+ if (pgcfg->site_name != NULL)
+ pgcfg->site_name_auto_disc = B_FALSE;
(void) ad_disc_set_SiteName(handles->ad_ctx, pgcfg->site_name);
+ }
rc = get_val_ds(handles, "global_catalog", 3268,
&pgcfg->global_catalog);
@@ -2198,6 +2229,9 @@ idmap_cfg_load(idmap_cfg_t *cfg, int flags)
changed += update_uint64(&live_pgcfg->list_size_limit,
&new_pgcfg.list_size_limit, "list_size_limit");
+ changed += update_uint64(&live_pgcfg->max_threads,
+ &new_pgcfg.max_threads, "max_threads");
+
changed += update_uint64(&live_pgcfg->id_cache_timeout,
&new_pgcfg.id_cache_timeout, "id_cache_timeout");
diff --git a/usr/src/cmd/idmap/idmapd/idmap_config.h b/usr/src/cmd/idmap/idmapd/idmap_config.h
index 6792d77774..c3d0567fbd 100644
--- a/usr/src/cmd/idmap/idmapd/idmap_config.h
+++ b/usr/src/cmd/idmap/idmapd/idmap_config.h
@@ -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.
*/
#ifndef _IDMAP_CONFIG_H
@@ -75,6 +75,7 @@ typedef struct idmap_trustedforest {
typedef struct idmap_pg_config {
uint64_t list_size_limit;
+ uint64_t max_threads;
uint64_t id_cache_timeout;
uint64_t name_cache_timeout;
uint64_t rediscovery_interval;
@@ -125,7 +126,7 @@ typedef struct idmap_cfg {
} idmap_cfg_t;
-extern void idmap_cfg_unload(idmap_pg_config_t *);
+extern void idmap_cfg_unload(idmap_pg_config_t *);
extern int idmap_cfg_load(idmap_cfg_t *, int);
extern idmap_cfg_t *idmap_cfg_init(void);
extern int idmap_cfg_fini(idmap_cfg_t *);
diff --git a/usr/src/cmd/idmap/idmapd/idmapd.c b/usr/src/cmd/idmap/idmapd/idmapd.c
index 3698270ab6..cec90531bd 100644
--- a/usr/src/cmd/idmap/idmapd/idmapd.c
+++ b/usr/src/cmd/idmap/idmapd/idmapd.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.
*/
@@ -84,13 +84,14 @@ static uint32_t max_threads = 40;
* Server door thread start routine.
*
* Set a TSD value to the door thread. This enables the destructor to
- * be called when this thread exits.
+ * be called when this thread exits. Note that we need a non-NULL
+ * value for this or the TSD destructor is not called.
*/
/*ARGSUSED*/
static void *
idmapd_door_thread_start(void *arg)
{
- static void *value = 0;
+ static void *value = "NON-NULL TSD";
/*
* Disable cancellation to avoid memory leaks from not running
@@ -136,6 +137,8 @@ idmapd_door_thread_cleanup(void *arg)
{
int num;
+ /* set TSD to NULL so we don't loop infinitely */
+ (void) pthread_setspecific(create_threads_key, NULL);
num = atomic_dec_32_nv(&num_threads);
idmapdlog(LOG_DEBUG,
"exiting thread ID %d - %d threads currently active",
@@ -379,6 +382,13 @@ init_idmapd()
exit(error < -2 ? SMF_EXIT_ERR_CONFIG : 1);
}
+ /*
+ * This means max_threads can't be updated without restarting idmap.
+ */
+ RDLOCK_CONFIG();
+ max_threads = _idmapdstate.cfg->pgcfg.max_threads;
+ UNLOCK_CONFIG();
+
(void) door_server_create(idmapd_door_thread_create);
if ((error = pthread_key_create(&create_threads_key,
idmapd_door_thread_cleanup)) != 0) {
@@ -521,7 +531,8 @@ restore_svc(void)
/* printflike */
void
-idmapdlog(int pri, const char *format, ...) {
+idmapdlog(int pri, const char *format, ...)
+{
static time_t prev_ts;
va_list args;
char cbuf[CBUFSIZ];
diff --git a/usr/src/cmd/idmap/idmapd/init.c b/usr/src/cmd/idmap/idmapd/init.c
index 8516e07f4f..a96a90df96 100644
--- a/usr/src/cmd/idmap/idmapd/init.c
+++ b/usr/src/cmd/idmap/idmapd/init.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.
*/
/*
@@ -357,6 +357,7 @@ print_idmapdstate(void)
pgcfg = &_idmapdstate.cfg->pgcfg;
idmapdlog(LOG_DEBUG, "list_size_limit=%llu", pgcfg->list_size_limit);
+ idmapdlog(LOG_DEBUG, "max_threads=%llu", pgcfg->max_threads);
idmapdlog(LOG_DEBUG, "default_domain=%s",
CHECK_NULL(pgcfg->default_domain));
idmapdlog(LOG_DEBUG, "domain_name=%s", CHECK_NULL(pgcfg->domain_name));
diff --git a/usr/src/cmd/idmap/test-getdc/getdc_main.c b/usr/src/cmd/idmap/test-getdc/getdc_main.c
index a0465bcc07..8fb3a8c65f 100644
--- a/usr/src/cmd/idmap/test-getdc/getdc_main.c
+++ b/usr/src/cmd/idmap/test-getdc/getdc_main.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2019 Nexenta Systems, Inc. All rights reserved.
*/
@@ -23,6 +23,7 @@
int debug;
char *domainname = NULL;
+char *sitename = NULL;
void print_ds(ad_disc_ds_t *);
void mylogger(int pri, const char *format, ...);
@@ -48,7 +49,9 @@ main(int argc, char *argv[])
}
if (optind < argc)
- domainname = argv[optind];
+ domainname = argv[optind++];
+ if (optind < argc)
+ sitename = argv[optind++];
adutils_set_logger(mylogger);
adutils_set_debug(AD_DEBUG_ALL, debug);
@@ -58,6 +61,8 @@ main(int argc, char *argv[])
if (domainname)
(void) ad_disc_set_DomainName(ad_ctx, domainname);
+ if (sitename)
+ (void) ad_disc_set_SiteName(ad_ctx, sitename);
ad_disc_refresh(ad_ctx);
diff --git a/usr/src/cmd/ldapcachemgr/cachemgr.c b/usr/src/cmd/ldapcachemgr/cachemgr.c
index 8ba7e1800e..5d053859ac 100644
--- a/usr/src/cmd/ldapcachemgr/cachemgr.c
+++ b/usr/src/cmd/ldapcachemgr/cachemgr.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2019 Nexenta Systems, Inc.
*/
/*
@@ -225,13 +226,13 @@ static thread_key_t server_key;
static void *
server_tsd_bind(void *arg)
{
- static void *value = 0;
+ static void *value = "NON-NULL TSD";
/*
* disable cancellation to prevent hangs when server
* threads disappear
*/
-
+ (void) pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
(void) thr_setspecific(server_key, value);
(void) door_return(NULL, 0, NULL, 0);
@@ -268,6 +269,7 @@ server_destroy(void *arg)
(void) mutex_lock(&create_lock);
num_servers--;
(void) mutex_unlock(&create_lock);
+ (void) thr_setspecific(server_key, NULL);
}
static void client_killserver();
@@ -1198,7 +1200,7 @@ client_showstats(admin_t *ptr)
static void
detachfromtty(char *pgm)
{
- int status;
+ int status;
pid_t pid, wret;
(void) close(0);
diff --git a/usr/src/cmd/mdb/sparc/v7/libfksmbsrv/Makefile b/usr/src/cmd/mdb/sparc/v7/libfksmbsrv/Makefile
index 4136306433..1ff6f2bca4 100644
--- a/usr/src/cmd/mdb/sparc/v7/libfksmbsrv/Makefile
+++ b/usr/src/cmd/mdb/sparc/v7/libfksmbsrv/Makefile
@@ -25,12 +25,13 @@
#
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
# Copyright 2015 Gary Mills
+# Copyright 2019 Peter Tribble.
#
MODULE = libfksmbsrv.so
MDBTGT = proc
-MODSRCS = smbsrv.c list.c
+MODSRCS = smbsrv.c smbsrv_pcap.c list.c
include ../../../../Makefile.cmd
include ../../Makefile.sparcv7
diff --git a/usr/src/cmd/mdb/sparc/v7/libmlsvc/Makefile b/usr/src/cmd/mdb/sparc/v7/libmlsvc/Makefile
new file mode 100644
index 0000000000..047773589a
--- /dev/null
+++ b/usr/src/cmd/mdb/sparc/v7/libmlsvc/Makefile
@@ -0,0 +1,46 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (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]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# Copyright 2018 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2019 Peter Tribble.
+#
+
+MODULE = libmlsvc.so
+MDBTGT = proc
+
+MODSRCS = mlsvc.c smb_ht.c
+
+include ../../../../Makefile.cmd
+include ../../Makefile.sparcv7
+include ../../../Makefile.module
+
+MODSRCS_DIR = ../../../common/modules/libmlsvc
+
+# CPPFLAGS += -I$(SRC)/lib/smbsrv/libmlsvc
+CPPFLAGS += -I$(SRC)/uts/common
+
+CSTD= $(CSTD_GNU99)
+C99MODE= -xc99=%all
+C99LMODE= -Xc99=%all
diff --git a/usr/src/cmd/mdb/sparc/v9/libfksmbsrv/Makefile b/usr/src/cmd/mdb/sparc/v9/libfksmbsrv/Makefile
index 3d7f2e9dd4..2c3589005e 100644
--- a/usr/src/cmd/mdb/sparc/v9/libfksmbsrv/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/libfksmbsrv/Makefile
@@ -25,12 +25,13 @@
#
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
# Copyright 2015 Gary Mills
+# Copyright 2019 Peter Tribble.
#
MODULE = libfksmbsrv.so
MDBTGT = proc
-MODSRCS = smbsrv.c list.c
+MODSRCS = smbsrv.c smbsrv_pcap.c list.c
include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
diff --git a/usr/src/cmd/mdb/sparc/v9/libmlsvc/Makefile b/usr/src/cmd/mdb/sparc/v9/libmlsvc/Makefile
new file mode 100644
index 0000000000..0144f56208
--- /dev/null
+++ b/usr/src/cmd/mdb/sparc/v9/libmlsvc/Makefile
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (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]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# Copyright 2018 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2019 Peter Tribble.
+#
+
+MODULE = libmlsvc.so
+MDBTGT = proc
+
+MODSRCS = mlsvc.c smb_ht.c
+
+include ../../../../Makefile.cmd
+include ../../../../Makefile.cmd.64
+include ../../Makefile.sparcv9
+include ../../../Makefile.module
+
+MODSRCS_DIR = ../../../common/modules/libmlsvc
+
+# CPPFLAGS += -I$(SRC)/lib/smbsrv/libmlsvc
+CPPFLAGS += -I$(SRC)/uts/common
+
+CSTD= $(CSTD_GNU99)
+C99MODE= -xc99=%all
+C99LMODE= -Xc99=%all
diff --git a/usr/src/cmd/nscd/nscd_frontend.c b/usr/src/cmd/nscd/nscd_frontend.c
index 134da3f280..b763c897e7 100644
--- a/usr/src/cmd/nscd/nscd_frontend.c
+++ b/usr/src/cmd/nscd/nscd_frontend.c
@@ -23,6 +23,7 @@
* Use is subject to license terms.
* Copyright 2012 Milan Jurik. All rights reserved.
* Copyright 2018 Joyent, Inc.
+ * Copyright 2019 Nexenta Systems, Inc.
*/
#include <stdlib.h>
@@ -88,7 +89,7 @@ static thread_key_t server_key;
static void *
server_tsd_bind(void *arg)
{
- static void *value = 0;
+ static void *value = "NON-NULL TSD";
(void) thr_setname(thr_self(), "server_tsd_bind");
@@ -129,6 +130,7 @@ server_destroy(void *arg)
(void) mutex_lock(&create_lock);
num_servers--;
(void) mutex_unlock(&create_lock);
+ (void) thr_setspecific(server_key, NULL);
}
/*
diff --git a/usr/src/head/iso/math_c99.h b/usr/src/head/iso/math_c99.h
index cf2d64bb95..1a3cdd907a 100644
--- a/usr/src/head/iso/math_c99.h
+++ b/usr/src/head/iso/math_c99.h
@@ -66,13 +66,13 @@ extern "C" {
#undef isnan
#undef isinf
#if __GNUC__ >= 4
-#define isnan(x) __builtin_isnan(x)
-#define isinf(x) __builtin_isinf(x)
#define fpclassify(x) __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, \
FP_SUBNORMAL, FP_ZERO, x)
-#define isfinite(x) __builtin_isfinite(x)
-#define isnormal(x) __builtin_isnormal(x)
-#define signbit(x) (__builtin_signbit(x) > 0)
+#define isnan(x) __builtin_isnan(x)
+#define isinf(x) __builtin_isinf(x)
+#define isfinite(x) (__builtin_isfinite(x) != 0)
+#define isnormal(x) (__builtin_isnormal(x) != 0)
+#define signbit(x) (__builtin_signbit(x) != 0)
#else /* __GNUC__ >= 4 */
#define isnan(x) __extension__( \
{ __typeof(x) __x_n = (x); \
diff --git a/usr/src/lib/libadutils/common/addisc.c b/usr/src/lib/libadutils/common/addisc.c
index f6ac98d11a..80cec2d305 100644
--- a/usr/src/lib/libadutils/common/addisc.c
+++ b/usr/src/lib/libadutils/common/addisc.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2019 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -157,7 +157,7 @@
#define is_fixed(item) \
((item)->state == AD_STATE_FIXED)
-#define is_changed(item, num, param) \
+#define is_changed(item, num, param) \
((item)->param_version[num] != (param)->version)
void * uuid_dup(void *);
@@ -641,13 +641,13 @@ static
LDAP *
ldap_lookup_init(ad_disc_ds_t *ds)
{
- int i;
+ int i;
int rc, ldversion;
int zero = 0;
- int timeoutms = 5 * 1000;
- char *saslmech = "GSSAPI";
+ int timeoutms = 5 * 1000;
+ char *saslmech = "GSSAPI";
uint32_t saslflags = LDAP_SASL_INTERACTIVE;
- LDAP *ld = NULL;
+ LDAP *ld = NULL;
for (i = 0; ds[i].host[0] != '\0'; i++) {
if (DBG(LDAP, 2)) {
@@ -861,7 +861,7 @@ ldap_lookup_domains_in_forest(LDAP **ld, ad_disc_ds_t *globalCatalogs)
struct berval **sid_ber;
adutils_sid_t sid;
char *sid_str;
- char *name;
+ char *name;
char *dn;
sid_ber = ldap_get_values_len(*ld, entry,
@@ -1222,8 +1222,10 @@ validate_DomainController(ad_disc_t ctx, enum ad_disc_req req)
return (&ctx->domain_controller);
domain_name_item = validate_DomainName(ctx);
- if (domain_name_item == NULL)
+ if (domain_name_item == NULL) {
+ DEBUG1STATUS(ctx, "(no domain name)");
return (NULL);
+ }
domain_name = (char *)domain_name_item->value;
/* Get (optional) preferred DC. */
@@ -1236,29 +1238,41 @@ validate_DomainController(ad_disc_t ctx, enum ad_disc_req req)
else {
if (is_fixed(&ctx->site_name))
validate_site = B_TRUE;
- else if (req == AD_DISC_PREFER_SITE)
+ if (req == AD_DISC_PREFER_SITE)
validate_global = B_TRUE;
}
- if (validate_global) {
- if (!is_valid(&ctx->domain_controller) ||
- is_changed(&ctx->domain_controller, PARAM1,
- domain_name_item)) {
+ /*
+ * If we're trying both site-specific and global,
+ * try the site-specific first, then fall-back.
+ */
+ if (validate_site) {
+ site_name_item = &ctx->site_name;
+ site_name = (char *)site_name_item->value;
+
+ if (!is_valid(&ctx->site_domain_controller) ||
+ is_changed(&ctx->site_domain_controller, PARAM1,
+ domain_name_item) ||
+ is_changed(&ctx->site_domain_controller, PARAM2,
+ site_name_item)) {
+ char rr_name[DNS_MAX_NAME];
/*
* Lookup DNS SRV RR named
- * _ldap._tcp.dc._msdcs.<DomainName>
+ * _ldap._tcp.<SiteName>._sites.dc._msdcs.<DomainName>
*/
- DEBUG1STATUS(ctx, "DNS SRV query, dom=%s",
- domain_name);
+ DEBUG1STATUS(ctx, "DNS SRV query, dom=%s, site=%s",
+ domain_name, site_name);
+ (void) snprintf(rr_name, sizeof (rr_name),
+ LDAP_SRV_HEAD SITE_SRV_MIDDLE DC_SRV_TAIL,
+ site_name);
DO_RES_NINIT(ctx);
- cdc = srv_query(&ctx->res_state,
- LDAP_SRV_HEAD DC_SRV_TAIL,
+ cdc = srv_query(&ctx->res_state, rr_name,
domain_name, prefer_dc);
if (cdc == NULL) {
DEBUG1STATUS(ctx, "(no DNS response)");
- return (NULL);
+ goto try_global;
}
log_cds(ctx, cdc);
@@ -1276,40 +1290,36 @@ validate_DomainController(ad_disc_t ctx, enum ad_disc_req req)
if (dc == NULL) {
DEBUG1STATUS(ctx, "(no LDAP response)");
- return (NULL);
+ goto try_global;
}
log_ds(ctx, dc);
- update_item(&ctx->domain_controller, dc,
+ update_item(&ctx->site_domain_controller, dc,
AD_STATE_AUTO, dc->ttl);
- update_version(&ctx->domain_controller, PARAM1,
+ update_version(&ctx->site_domain_controller, PARAM1,
domain_name_item);
+ update_version(&ctx->site_domain_controller, PARAM2,
+ site_name_item);
}
- return (&ctx->domain_controller);
+ return (&ctx->site_domain_controller);
}
- if (validate_site) {
- site_name_item = &ctx->site_name;
- site_name = (char *)site_name_item->value;
+try_global:
- if (!is_valid(&ctx->site_domain_controller) ||
- is_changed(&ctx->site_domain_controller, PARAM1,
- domain_name_item) ||
- is_changed(&ctx->site_domain_controller, PARAM2,
- site_name_item)) {
- char rr_name[DNS_MAX_NAME];
+ if (validate_global) {
+ if (!is_valid(&ctx->domain_controller) ||
+ is_changed(&ctx->domain_controller, PARAM1,
+ domain_name_item)) {
/*
* Lookup DNS SRV RR named
- * _ldap._tcp.<SiteName>._sites.dc._msdcs.<DomainName>
+ * _ldap._tcp.dc._msdcs.<DomainName>
*/
- DEBUG1STATUS(ctx, "DNS SRV query, dom=%s, site=%s",
- domain_name, site_name);
- (void) snprintf(rr_name, sizeof (rr_name),
- LDAP_SRV_HEAD SITE_SRV_MIDDLE DC_SRV_TAIL,
- site_name);
+ DEBUG1STATUS(ctx, "DNS SRV query, dom=%s",
+ domain_name);
DO_RES_NINIT(ctx);
- cdc = srv_query(&ctx->res_state, rr_name,
+ cdc = srv_query(&ctx->res_state,
+ LDAP_SRV_HEAD DC_SRV_TAIL,
domain_name, prefer_dc);
if (cdc == NULL) {
@@ -1336,15 +1346,14 @@ validate_DomainController(ad_disc_t ctx, enum ad_disc_req req)
}
log_ds(ctx, dc);
- update_item(&ctx->site_domain_controller, dc,
+ update_item(&ctx->domain_controller, dc,
AD_STATE_AUTO, dc->ttl);
- update_version(&ctx->site_domain_controller, PARAM1,
+ update_version(&ctx->domain_controller, PARAM1,
domain_name_item);
- update_version(&ctx->site_domain_controller, PARAM2,
- site_name_item);
}
- return (&ctx->site_domain_controller);
+ return (&ctx->domain_controller);
}
+
return (NULL);
}
@@ -1516,8 +1525,10 @@ validate_GlobalCatalog(ad_disc_t ctx, enum ad_disc_req req)
return (&ctx->global_catalog);
forest_name_item = validate_ForestName(ctx);
- if (forest_name_item == NULL)
+ if (forest_name_item == NULL) {
+ DEBUG1STATUS(ctx, "(no forrest name)");
return (NULL);
+ }
forest_name = (char *)forest_name_item->value;
if (req == AD_DISC_GLOBAL)
@@ -1525,14 +1536,24 @@ validate_GlobalCatalog(ad_disc_t ctx, enum ad_disc_req req)
else {
if (is_fixed(&ctx->site_name))
validate_site = B_TRUE;
- else if (req == AD_DISC_PREFER_SITE)
+ if (req == AD_DISC_PREFER_SITE)
validate_global = B_TRUE;
}
- if (validate_global) {
- if (!is_valid(&ctx->global_catalog) ||
- is_changed(&ctx->global_catalog, PARAM1,
- forest_name_item)) {
+ /*
+ * If we're trying both site-specific and global,
+ * try the site-specific first, then fall-back.
+ */
+ if (validate_site) {
+ site_name_item = &ctx->site_name;
+ site_name = (char *)site_name_item->value;
+
+ if (!is_valid(&ctx->site_global_catalog) ||
+ is_changed(&ctx->site_global_catalog, PARAM1,
+ forest_name_item) ||
+ is_changed(&ctx->site_global_catalog, PARAM2,
+ site_name_item)) {
+ char rr_name[DNS_MAX_NAME];
/*
* See if our DC is also a GC.
@@ -1542,30 +1563,33 @@ validate_GlobalCatalog(ad_disc_t ctx, enum ad_disc_req req)
ad_disc_ds_t *ds = dc_item->value;
if ((ds->flags & DS_GC_FLAG) != 0) {
DEBUG1STATUS(ctx,
- "DC is also a GC for %s",
- forest_name);
+ "DC is also a GC for %s in %s",
+ forest_name, site_name);
gc = ds_dup(ds);
if (gc != NULL) {
gc->port = GC_PORT;
- goto update_global;
+ goto update_site;
}
}
}
/*
* Lookup DNS SRV RR named:
- * _ldap._tcp.gc._msdcs.<ForestName>
+ * _ldap._tcp.<siteName>._sites.gc.
+ * _msdcs.<ForestName>
*/
- DEBUG1STATUS(ctx, "DNS SRV query, forest=%s",
- forest_name);
+ DEBUG1STATUS(ctx, "DNS SRV query, forest=%s, site=%s",
+ forest_name, site_name);
+ (void) snprintf(rr_name, sizeof (rr_name),
+ LDAP_SRV_HEAD SITE_SRV_MIDDLE GC_SRV_TAIL,
+ site_name);
DO_RES_NINIT(ctx);
- cgc = srv_query(&ctx->res_state,
- LDAP_SRV_HEAD GC_SRV_TAIL,
+ cgc = srv_query(&ctx->res_state, rr_name,
forest_name, NULL);
if (cgc == NULL) {
DEBUG1STATUS(ctx, "(no DNS response)");
- return (NULL);
+ goto try_global;
}
log_cds(ctx, cgc);
@@ -1583,29 +1607,27 @@ validate_GlobalCatalog(ad_disc_t ctx, enum ad_disc_req req)
if (gc == NULL) {
DEBUG1STATUS(ctx, "(no LDAP response)");
- return (NULL);
+ goto try_global;
}
log_ds(ctx, gc);
- update_global:
- update_item(&ctx->global_catalog, gc,
+ update_site:
+ update_item(&ctx->site_global_catalog, gc,
AD_STATE_AUTO, gc->ttl);
- update_version(&ctx->global_catalog, PARAM1,
+ update_version(&ctx->site_global_catalog, PARAM1,
forest_name_item);
+ update_version(&ctx->site_global_catalog, PARAM2,
+ site_name_item);
}
- return (&ctx->global_catalog);
+ return (&ctx->site_global_catalog);
}
- if (validate_site) {
- site_name_item = &ctx->site_name;
- site_name = (char *)site_name_item->value;
+try_global:
- if (!is_valid(&ctx->site_global_catalog) ||
- is_changed(&ctx->site_global_catalog, PARAM1,
- forest_name_item) ||
- is_changed(&ctx->site_global_catalog, PARAM2,
- site_name_item)) {
- char rr_name[DNS_MAX_NAME];
+ if (validate_global) {
+ if (!is_valid(&ctx->global_catalog) ||
+ is_changed(&ctx->global_catalog, PARAM1,
+ forest_name_item)) {
/*
* See if our DC is also a GC.
@@ -1615,28 +1637,25 @@ validate_GlobalCatalog(ad_disc_t ctx, enum ad_disc_req req)
ad_disc_ds_t *ds = dc_item->value;
if ((ds->flags & DS_GC_FLAG) != 0) {
DEBUG1STATUS(ctx,
- "DC is also a GC for %s in %s",
- forest_name, site_name);
+ "DC is also a GC for %s",
+ forest_name);
gc = ds_dup(ds);
if (gc != NULL) {
gc->port = GC_PORT;
- goto update_site;
+ goto update_global;
}
}
}
/*
* Lookup DNS SRV RR named:
- * _ldap._tcp.<siteName>._sites.gc.
- * _msdcs.<ForestName>
+ * _ldap._tcp.gc._msdcs.<ForestName>
*/
- DEBUG1STATUS(ctx, "DNS SRV query, forest=%s, site=%s",
- forest_name, site_name);
- (void) snprintf(rr_name, sizeof (rr_name),
- LDAP_SRV_HEAD SITE_SRV_MIDDLE GC_SRV_TAIL,
- site_name);
+ DEBUG1STATUS(ctx, "DNS SRV query, forest=%s",
+ forest_name);
DO_RES_NINIT(ctx);
- cgc = srv_query(&ctx->res_state, rr_name,
+ cgc = srv_query(&ctx->res_state,
+ LDAP_SRV_HEAD GC_SRV_TAIL,
forest_name, NULL);
if (cgc == NULL) {
@@ -1663,15 +1682,13 @@ validate_GlobalCatalog(ad_disc_t ctx, enum ad_disc_req req)
}
log_ds(ctx, gc);
- update_site:
- update_item(&ctx->site_global_catalog, gc,
+ update_global:
+ update_item(&ctx->global_catalog, gc,
AD_STATE_AUTO, gc->ttl);
- update_version(&ctx->site_global_catalog, PARAM1,
+ update_version(&ctx->global_catalog, PARAM1,
forest_name_item);
- update_version(&ctx->site_global_catalog, PARAM2,
- site_name_item);
}
- return (&ctx->site_global_catalog);
+ return (&ctx->global_catalog);
}
return (NULL);
}
diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com
index ee254984b5..9f68ffd661 100644
--- a/usr/src/lib/libc/sparc/Makefile.com
+++ b/usr/src/lib/libc/sparc/Makefile.com
@@ -26,6 +26,7 @@
# Copyright 2018 Nexenta Systems, Inc.
# Copyright 2018 Joyent, Inc.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2019 Peter Tribble.
#
LIBCDIR= $(SRC)/lib/libc
@@ -1331,7 +1332,7 @@ $(LIB_PIC): pics $$(PICS)
# special cases
$(STRETS:%=pics/%): $(LIBCBASE)/crt/stret.s
$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) $(LIBCBASE)/crt/stret.s -o $@
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com
index 0292db23f5..19efed24ae 100644
--- a/usr/src/lib/libc/sparcv9/Makefile.com
+++ b/usr/src/lib/libc/sparcv9/Makefile.com
@@ -27,6 +27,7 @@
# Copyright 2018 Nexenta Systems, Inc.
# Copyright 2018 Joyent, Inc.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2019 Peter Tribble.
#
LIBCDIR= $(SRC)/lib/libc
@@ -1254,7 +1255,7 @@ $(LIB_PIC): pics $$(PICS)
# special cases
#$(STRETS:%=pics/%): crt/stret.s
# $(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
-# $(POST_PROCESS_O)
+# $(POST_PROCESS_S_O)
#crt/_rtbootld.s: crt/_rtboot.s crt/_rtld.c
# $(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
diff --git a/usr/src/lib/libfakekernel/common/mapfile-vers b/usr/src/lib/libfakekernel/common/mapfile-vers
index 9f18fac781..51067103f7 100644
--- a/usr/src/lib/libfakekernel/common/mapfile-vers
+++ b/usr/src/lib/libfakekernel/common/mapfile-vers
@@ -122,9 +122,9 @@ SYMBOL_VERSION SUNWprivate_1.1 {
kmem_zalloc;
kmutex_destroy;
- kmutex_init;
kmutex_enter;
kmutex_exit;
+ kmutex_init;
ksema_destroy;
ksema_init;
diff --git a/usr/src/lib/libfakekernel/common/mutex.c b/usr/src/lib/libfakekernel/common/mutex.c
index 1200d589dc..0dff58c553 100644
--- a/usr/src/lib/libfakekernel/common/mutex.c
+++ b/usr/src/lib/libfakekernel/common/mutex.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
* Copyright 2017 RackTop Systems.
*/
@@ -31,8 +31,9 @@ int _lwp_mutex_trylock(lwp_mutex_t *);
extern clock_t ddi_get_lbolt(void);
+/* See: head/synch.h ERRORCHECKMUTEX */
static const lwp_mutex_t default_mutex =
- {{0, 0, 0, {USYNC_THREAD}, _MUTEX_MAGIC},
+ {{0, 0, 0, {USYNC_THREAD|LOCK_ERRORCHECK}, _MUTEX_MAGIC},
{{{0, 0, 0, 0, 0, 0, 0, 0}}}, 0};
/* ARGSUSED */
@@ -53,8 +54,11 @@ kmutex_destroy(kmutex_t *mp)
void
kmutex_enter(kmutex_t *mp)
{
+ kthread_t *t = _curthread();
+
+ VERIFY(mp->m_owner != t);
VERIFY(0 == _lwp_mutex_lock(&mp->m_lock));
- mp->m_owner = _curthread();
+ mp->m_owner = t;
}
int
diff --git a/usr/src/lib/libm/common/C/jn.c b/usr/src/lib/libm/common/C/jn.c
index d65dfb0a97..bfdaefecf6 100644
--- a/usr/src/lib/libm/common/C/jn.c
+++ b/usr/src/lib/libm/common/C/jn.c
@@ -69,7 +69,8 @@ static const GENERIC
one = 1.0;
GENERIC
-jn(int n, GENERIC x) {
+jn(int n, GENERIC x)
+{
int i, sgn;
GENERIC a, b, temp = 0;
GENERIC z, w, ox, on;
@@ -78,16 +79,18 @@ jn(int n, GENERIC x) {
* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x)
* Thus, J(-n,x) = J(n,-x)
*/
- ox = x; on = (GENERIC)n;
+ ox = x;
+ on = (GENERIC)n;
+
if (n < 0) {
n = -n;
x = -x;
}
if (isnan(x))
return (x*x); /* + -> * for Cheetah */
- if (!((int) _lib_version == libm_ieee ||
- (__xpg6 & _C99SUSv3_math_errexcept) != 0)) {
- if (fabs(x) > X_TLOSS)
+ if (!((int)_lib_version == libm_ieee ||
+ (__xpg6 & _C99SUSv3_math_errexcept) != 0)) {
+ if (fabs(x) > X_TLOSS)
return (_SVID_libm_err(on, ox, 38));
}
if (n == 0)
@@ -95,7 +98,7 @@ jn(int n, GENERIC x) {
if (n == 1)
return (j1(x));
if ((n&1) == 0)
- sgn = 0; /* even n */
+ sgn = 0; /* even n */
else
sgn = signbit(x); /* old n */
x = fabs(x);
@@ -105,7 +108,7 @@ jn(int n, GENERIC x) {
* Safe to use
* J(n+1,x)=2n/x *J(n,x)-J(n-1,x)
*/
- if (x > 1.0e91) {
+ if (x > 1.0e91) {
/*
* x >> n**2
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
@@ -116,124 +119,147 @@ jn(int n, GENERIC x) {
* n sin(xn)*sqt2 cos(xn)*sqt2
* ----------------------------------
* 0 s-c c+s
- * 1 -s-c -c+s
+ * 1 -s-c -c+s
* 2 -s+c -c-s
* 3 s+c c-s
*/
- switch (n&3) {
- case 0: temp = cos(x)+sin(x); break;
- case 1: temp = -cos(x)+sin(x); break;
- case 2: temp = -cos(x)-sin(x); break;
- case 3: temp = cos(x)-sin(x); break;
- }
- b = invsqrtpi*temp/sqrt(x);
- } else {
+ switch (n&3) {
+ case 0:
+ temp = cos(x)+sin(x);
+ break;
+ case 1:
+ temp = -cos(x)+sin(x);
+ break;
+ case 2:
+ temp = -cos(x)-sin(x);
+ break;
+ case 3:
+ temp = cos(x)-sin(x);
+ break;
+ }
+ b = invsqrtpi*temp/sqrt(x);
+ } else {
a = j0(x);
b = j1(x);
for (i = 1; i < n; i++) {
- temp = b;
- b = b*((GENERIC)(i+i)/x) - a; /* avoid underflow */
- a = temp;
+ temp = b;
+ /* avoid underflow */
+ b = b*((GENERIC)(i+i)/x) - a;
+ a = temp;
}
- }
- } else {
- if (x < 1e-9) { /* use J(n,x) = 1/n!*(x/2)^n */
- b = pow(0.5*x, (GENERIC) n);
- if (b != zero) {
- for (a = one, i = 1; i <= n; i++) a *= (GENERIC)i;
- b = b/a;
- }
- } else {
- /*
- * use backward recurrence
- * x x^2 x^2
- * J(n,x)/J(n-1,x) = ---- ------ ------ .....
- * 2n - 2(n+1) - 2(n+2)
- *
- * 1 1 1
- * (for large x) = ---- ------ ------ .....
- * 2n 2(n+1) 2(n+2)
- * -- - ------ - ------ -
- * x x x
- *
- * Let w = 2n/x and h = 2/x, then the above quotient
- * is equal to the continued fraction:
- * 1
- * = -----------------------
- * 1
- * w - -----------------
- * 1
- * w+h - ---------
- * w+2h - ...
- *
- * To determine how many terms needed, let
- * Q(0) = w, Q(1) = w(w+h) - 1,
- * Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
- * When Q(k) > 1e4 good for single
- * When Q(k) > 1e9 good for double
- * When Q(k) > 1e17 good for quaduple
- */
- /* determin k */
- GENERIC t, v;
- double q0, q1, h, tmp; int k, m;
- w = (n+n)/(double)x; h = 2.0/(double)x;
- q0 = w; z = w + h; q1 = w*z - 1.0; k = 1;
- while (q1 < 1.0e9) {
- k += 1; z += h;
- tmp = z*q1 - q0;
- q0 = q1;
- q1 = tmp;
}
- m = n+n;
- for (t = zero, i = 2*(n+k); i >= m; i -= 2) t = one/(i/x-t);
- a = t;
- b = one;
- /*
- * estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
- * hence, if n*(log(2n/x)) > ...
- * single 8.8722839355e+01
- * double 7.09782712893383973096e+02
- * long double 1.1356523406294143949491931077970765006170e+04
- * then recurrent value may overflow and the result is
- * likely underflow to zero
- */
- tmp = n;
- v = two/x;
- tmp = tmp*log(fabs(v*tmp));
- if (tmp < 7.09782712893383973096e+02) {
- for (i = n-1; i > 0; i--) {
- temp = b;
- b = ((i+i)/x)*b - a;
- a = temp;
- }
+ } else {
+ if (x < 1e-9) { /* use J(n,x) = 1/n!*(x/2)^n */
+ b = pow(0.5*x, (GENERIC) n);
+ if (b != zero) {
+ for (a = one, i = 1; i <= n; i++)
+ a *= (GENERIC)i;
+ b = b/a;
+ }
} else {
+ /*
+ * use backward recurrence
+ * x x^2 x^2
+ * J(n,x)/J(n-1,x) = ---- ------ ------ .....
+ * 2n - 2(n+1) - 2(n+2)
+ *
+ * 1 1 1
+ * (for large x) = ---- ------ ------ .....
+ * 2n 2(n+1) 2(n+2)
+ * -- - ------ - ------ -
+ * x x x
+ *
+ * Let w = 2n/x and h = 2/x, then the above quotient
+ * is equal to the continued fraction:
+ * 1
+ * = -----------------------
+ * 1
+ * w - -----------------
+ * 1
+ * w+h - ---------
+ * w+2h - ...
+ *
+ * To determine how many terms needed, let
+ * Q(0) = w, Q(1) = w(w+h) - 1,
+ * Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
+ * When Q(k) > 1e4 good for single
+ * When Q(k) > 1e9 good for double
+ * When Q(k) > 1e17 good for quaduple
+ */
+ /* determine k */
+ GENERIC t, v;
+ double q0, q1, h, tmp;
+ int k, m;
+ w = (n+n)/(double)x;
+ h = 2.0/(double)x;
+ q0 = w;
+ z = w + h;
+ q1 = w*z - 1.0;
+ k = 1;
+
+ while (q1 < 1.0e9) {
+ k += 1;
+ z += h;
+ tmp = z*q1 - q0;
+ q0 = q1;
+ q1 = tmp;
+ }
+ m = n+n;
+ for (t = zero, i = 2*(n+k); i >= m; i -= 2)
+ t = one/(i/x-t);
+ a = t;
+ b = one;
+ /*
+ * estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
+ * hence, if n*(log(2n/x)) > ...
+ * single:
+ * 8.8722839355e+01
+ * double:
+ * 7.09782712893383973096e+02
+ * long double:
+ * 1.1356523406294143949491931077970765006170e+04
+ * then recurrent value may overflow and the result is
+ * likely underflow to zero
+ */
+ tmp = n;
+ v = two/x;
+ tmp = tmp*log(fabs(v*tmp));
+ if (tmp < 7.09782712893383973096e+02) {
+ for (i = n-1; i > 0; i--) {
+ temp = b;
+ b = ((i+i)/x)*b - a;
+ a = temp;
+ }
+ } else {
for (i = n-1; i > 0; i--) {
- temp = b;
- b = ((i+i)/x)*b - a;
- a = temp;
+ temp = b;
+ b = ((i+i)/x)*b - a;
+ a = temp;
if (b > 1e100) {
a /= b;
t /= b;
b = 1.0;
}
}
- }
+ }
b = (t*j0(x)/b);
- }
+ }
}
- if (sgn == 1)
+ if (sgn != 0)
return (-b);
else
return (b);
}
GENERIC
-yn(int n, GENERIC x) {
+yn(int n, GENERIC x)
+{
int i;
int sign;
GENERIC a, b, temp = 0, ox, on;
- ox = x; on = (GENERIC)n;
+ ox = x;
+ on = (GENERIC)n;
if (isnan(x))
return (x*x); /* + -> * for Cheetah */
if (x <= zero) {
@@ -245,9 +271,9 @@ yn(int n, GENERIC x) {
return (_SVID_libm_err((GENERIC)n, x, 13));
}
}
- if (!((int) _lib_version == libm_ieee ||
- (__xpg6 & _C99SUSv3_math_errexcept) != 0)) {
- if (x > X_TLOSS)
+ if (!((int)_lib_version == libm_ieee ||
+ (__xpg6 & _C99SUSv3_math_errexcept) != 0)) {
+ if (x > X_TLOSS)
return (_SVID_libm_err(on, ox, 39));
}
sign = 1;
@@ -273,15 +299,23 @@ yn(int n, GENERIC x) {
* n sin(xn)*sqt2 cos(xn)*sqt2
* ----------------------------------
* 0 s-c c+s
- * 1 -s-c -c+s
+ * 1 -s-c -c+s
* 2 -s+c -c-s
* 3 s+c c-s
*/
switch (n&3) {
- case 0: temp = sin(x)-cos(x); break;
- case 1: temp = -sin(x)-cos(x); break;
- case 2: temp = -sin(x)+cos(x); break;
- case 3: temp = sin(x)+cos(x); break;
+ case 0:
+ temp = sin(x)-cos(x);
+ break;
+ case 1:
+ temp = -sin(x)-cos(x);
+ break;
+ case 2:
+ temp = -sin(x)+cos(x);
+ break;
+ case 3:
+ temp = sin(x)+cos(x);
+ break;
}
b = invsqrtpi*temp/sqrt(x);
} else {
diff --git a/usr/src/lib/libm/common/C/tanh.c b/usr/src/lib/libm/common/C/tanh.c
index 2c3d5f6deb..6bf6b471e8 100644
--- a/usr/src/lib/libm/common/C/tanh.c
+++ b/usr/src/lib/libm/common/C/tanh.c
@@ -67,7 +67,8 @@ static const double
/* INDENT ON */
double
-tanh(double x) {
+tanh(double x)
+{
double t, y, z;
int signx;
volatile double dummy __unused;
@@ -94,7 +95,7 @@ tanh(double x) {
} else if (!finite(t))
return (copysign(1.0, x));
else
- return (signx == 1 ? -z + small * small : z - small * small);
+ return ((signx != 0) ? -z + small * small : z - small * small);
- return (signx == 1 ? -z : z);
+ return ((signx != 0) ? -z : z);
}
diff --git a/usr/src/lib/libm/common/LD/__rem_pio2l.c b/usr/src/lib/libm/common/LD/__rem_pio2l.c
index 6633ece604..07abbc312a 100644
--- a/usr/src/lib/libm/common/LD/__rem_pio2l.c
+++ b/usr/src/lib/libm/common/LD/__rem_pio2l.c
@@ -27,7 +27,8 @@
* Use is subject to license terms.
*/
-/* __rem_pio2l(x,y)
+/*
+ * __rem_pio2l(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* by calling __rem_pio2m
@@ -70,7 +71,7 @@ __rem_pio2l(long double x, long double *y)
w = (long double)v[0];
y[0] = z + w;
y[1] = z - (y[0] - w);
- if (sign == 1) {
+ if (sign != 0) {
y[0] = -y[0];
y[1] = -y[1];
return (-n);
diff --git a/usr/src/lib/libm/common/LD/jnl.c b/usr/src/lib/libm/common/LD/jnl.c
index ad7d1c6ae7..22f467d9e7 100644
--- a/usr/src/lib/libm/common/LD/jnl.c
+++ b/usr/src/lib/libm/common/LD/jnl.c
@@ -68,7 +68,8 @@ zero = 0.0L,
one = 1.0L;
GENERIC
-jnl(n, x) int n; GENERIC x; {
+jnl(int n, GENERIC x)
+{
int i, sgn;
GENERIC a, b, temp = 0, z, w;
@@ -80,11 +81,14 @@ jnl(n, x) int n; GENERIC x; {
n = -n;
x = -x;
}
- if (n == 0) return (j0l(x));
- if (n == 1) return (j1l(x));
- if (x != x) return x+x;
+ if (n == 0)
+ return (j0l(x));
+ if (n == 1)
+ return (j1l(x));
+ if (x != x)
+ return (x+x);
if ((n&1) == 0)
- sgn = 0; /* even n */
+ sgn = 0; /* even n */
else
sgn = signbitl(x); /* old n */
x = fabsl(x);
@@ -94,7 +98,7 @@ jnl(n, x) int n; GENERIC x; {
* Safe to use
* J(n+1,x)=2n/x *J(n,x)-J(n-1,x)
*/
- if (x > 1.0e91L) {
+ if (x > 1.0e91L) {
/*
* x >> n**2
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
@@ -105,139 +109,166 @@ jnl(n, x) int n; GENERIC x; {
* n sin(xn)*sqt2 cos(xn)*sqt2
* ----------------------------------
* 0 s-c c+s
- * 1 -s-c -c+s
+ * 1 -s-c -c+s
* 2 -s+c -c-s
* 3 s+c c-s
*/
- switch (n&3) {
- case 0: temp = cosl(x)+sinl(x); break;
- case 1: temp = -cosl(x)+sinl(x); break;
- case 2: temp = -cosl(x)-sinl(x); break;
- case 3: temp = cosl(x)-sinl(x); break;
- }
- b = invsqrtpi*temp/sqrtl(x);
- } else {
+ switch (n&3) {
+ case 0:
+ temp = cosl(x)+sinl(x);
+ break;
+ case 1:
+ temp = -cosl(x)+sinl(x);
+ break;
+ case 2:
+ temp = -cosl(x)-sinl(x);
+ break;
+ case 3:
+ temp = cosl(x)-sinl(x);
+ break;
+ }
+ b = invsqrtpi*temp/sqrtl(x);
+ } else {
a = j0l(x);
b = j1l(x);
for (i = 1; i < n; i++) {
- temp = b;
- b = b*((GENERIC)(i+i)/x) - a; /* avoid underflow */
- a = temp;
+ temp = b;
+ /* avoid underflow */
+ b = b*((GENERIC)(i+i)/x) - a;
+ a = temp;
}
- }
- } else {
- if (x < 1e-17L) { /* use J(n,x) = 1/n!*(x/2)^n */
- b = powl(0.5L*x, (GENERIC) n);
- if (b != zero) {
- for (a = one, i = 1; i <= n; i++) a *= (GENERIC)i;
- b = b/a;
- }
- } else {
- /*
- * use backward recurrence
- * x x^2 x^2
- * J(n,x)/J(n-1,x) = ---- ------ ------ .....
- * 2n - 2(n+1) - 2(n+2)
- *
- * 1 1 1
- * (for large x) = ---- ------ ------ .....
- * 2n 2(n+1) 2(n+2)
- * -- - ------ - ------ -
- * x x x
- *
- * Let w = 2n/x and h=2/x, then the above quotient
- * is equal to the continued fraction:
- * 1
- * = -----------------------
- * 1
- * w - -----------------
- * 1
- * w+h - ---------
- * w+2h - ...
- *
- * To determine how many terms needed, let
- * Q(0) = w, Q(1) = w(w+h) - 1,
- * Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
- * When Q(k) > 1e4 good for single
- * When Q(k) > 1e9 good for double
- * When Q(k) > 1e17 good for quaduple
- */
- /* determin k */
- GENERIC t, v;
- double q0, q1, h, tmp; int k, m;
- w = (n+n)/(double)x; h = 2.0/(double)x;
- q0 = w; z = w+h; q1 = w*z - 1.0; k = 1;
- while (q1 < 1.0e17) {
- k += 1; z += h;
- tmp = z*q1 - q0;
- q0 = q1;
- q1 = tmp;
}
- m = n+n;
- for (t = zero, i = 2*(n+k); i >= m; i -= 2) t = one/(i/x-t);
- a = t;
- b = one;
+ } else {
+ if (x < 1e-17L) { /* use J(n,x) = 1/n!*(x/2)^n */
+ b = powl(0.5L*x, (GENERIC)n);
+ if (b != zero) {
+ for (a = one, i = 1; i <= n; i++)
+ a *= (GENERIC)i;
+ b = b/a;
+ }
+ } else {
+ /* BEGIN CSTYLED */
+ /*
+ * use backward recurrence
+ * x x^2 x^2
+ * J(n,x)/J(n-1,x) = ---- ------ ------ .....
+ * 2n - 2(n+1) - 2(n+2)
+ *
+ * 1 1 1
+ * (for large x) = ---- ------ ------ .....
+ * 2n 2(n+1) 2(n+2)
+ * -- - ------ - ------ -
+ * x x x
+ *
+ * Let w = 2n/x and h=2/x, then the above quotient
+ * is equal to the continued fraction:
+ * 1
+ * = -----------------------
+ * 1
+ * w - -----------------
+ * 1
+ * w+h - ---------
+ * w+2h - ...
+ *
+ * To determine how many terms needed, let
+ * Q(0) = w, Q(1) = w(w+h) - 1,
+ * Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
+ * When Q(k) > 1e4 good for single
+ * When Q(k) > 1e9 good for double
+ * When Q(k) > 1e17 good for quaduple
+ */
+ /* END CSTYLED */
+ /* determine k */
+ GENERIC t, v;
+ double q0, q1, h, tmp;
+ int k, m;
+ w = (n+n)/(double)x;
+ h = 2.0/(double)x;
+ q0 = w;
+ z = w+h;
+ q1 = w*z - 1.0;
+ k = 1;
+ while (q1 < 1.0e17) {
+ k += 1;
+ z += h;
+ tmp = z*q1 - q0;
+ q0 = q1;
+ q1 = tmp;
+ }
+ m = n+n;
+ for (t = zero, i = 2*(n+k); i >= m; i -= 2)
+ t = one/(i/x-t);
+ a = t;
+ b = one;
/*
* Estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
* hence, if n*(log(2n/x)) > ...
- * single 8.8722839355e+01
- * double 7.09782712893383973096e+02
- * long double 1.1356523406294143949491931077970765006170e+04
+ * single:
+ * 8.8722839355e+01
+ * double:
+ * 7.09782712893383973096e+02
+ * long double:
+ * 1.1356523406294143949491931077970765006170e+04
* then recurrent value may overflow and the result is
* likely underflow to zero.
*/
- tmp = n;
- v = two/x;
- tmp = tmp*logl(fabsl(v*tmp));
- if (tmp < 1.1356523406294143949491931077970765e+04L) {
+ tmp = n;
+ v = two/x;
+ tmp = tmp*logl(fabsl(v*tmp));
+ if (tmp < 1.1356523406294143949491931077970765e+04L) {
for (i = n-1; i > 0; i--) {
- temp = b;
- b = ((i+i)/x)*b - a;
- a = temp;
+ temp = b;
+ b = ((i+i)/x)*b - a;
+ a = temp;
}
- } else {
+ } else {
for (i = n-1; i > 0; i--) {
- temp = b;
- b = ((i+i)/x)*b - a;
- a = temp;
- if (b > 1e1000L) {
+ temp = b;
+ b = ((i+i)/x)*b - a;
+ a = temp;
+ if (b > 1e1000L) {
a /= b;
t /= b;
b = 1.0;
}
}
- }
+ }
b = (t*j0l(x)/b);
- }
+ }
}
- if (sgn == 1)
- return -b;
+ if (sgn != 0)
+ return (-b);
else
- return b;
+ return (b);
}
GENERIC
-ynl(n, x) int n; GENERIC x; {
+ynl(int n, GENERIC x)
+{
int i;
int sign;
GENERIC a, b, temp = 0;
if (x != x)
- return x+x;
+ return (x+x);
if (x <= zero) {
if (x == zero)
- return -one/zero;
+ return (-one/zero);
else
- return zero/zero;
+ return (zero/zero);
}
sign = 1;
if (n < 0) {
n = -n;
- if ((n&1) == 1) sign = -1;
+ if ((n&1) == 1)
+ sign = -1;
}
- if (n == 0) return (y0l(x));
- if (n == 1) return (sign*y1l(x));
- if (!finitel(x)) return zero;
+ if (n == 0)
+ return (y0l(x));
+ if (n == 1)
+ return (sign*y1l(x));
+ if (!finitel(x))
+ return (zero);
if (x > 1.0e91L) {
/*
@@ -249,16 +280,24 @@ ynl(n, x) int n; GENERIC x; {
*
* n sin(xn)*sqt2 cos(xn)*sqt2
* ----------------------------------
- * 0 s-c c+s
- * 1 -s-c -c+s
- * 2 -s+c -c-s
+ * 0 s-c c+s
+ * 1 -s-c -c+s
+ * 2 -s+c -c-s
* 3 s+c c-s
*/
switch (n&3) {
- case 0: temp = sinl(x)-cosl(x); break;
- case 1: temp = -sinl(x)-cosl(x); break;
- case 2: temp = -sinl(x)+cosl(x); break;
- case 3: temp = sinl(x)+cosl(x); break;
+ case 0:
+ temp = sinl(x)-cosl(x);
+ break;
+ case 1:
+ temp = -sinl(x)-cosl(x);
+ break;
+ case 2:
+ temp = -sinl(x)+cosl(x);
+ break;
+ case 3:
+ temp = sinl(x)+cosl(x);
+ break;
}
b = invsqrtpi*temp/sqrtl(x);
} else {
@@ -277,7 +316,7 @@ ynl(n, x) int n; GENERIC x; {
}
}
if (sign > 0)
- return b;
+ return (b);
else
- return -b;
+ return (-b);
}
diff --git a/usr/src/lib/libm/common/Q/__rem_pio2l.c b/usr/src/lib/libm/common/Q/__rem_pio2l.c
index 1ac009edcc..15750a9aaa 100644
--- a/usr/src/lib/libm/common/Q/__rem_pio2l.c
+++ b/usr/src/lib/libm/common/Q/__rem_pio2l.c
@@ -50,7 +50,8 @@ static const long double
pio4 = 0.7853981633974483096156608458198757210495L;
int
-__rem_pio2l(long double x, long double *y) {
+__rem_pio2l(long double x, long double *y)
+{
long double z, w;
double t[5], v[5];
int e0, i, nx, n, sign;
@@ -66,19 +67,19 @@ __rem_pio2l(long double x, long double *y) {
e0 = ilogbl(z) - 23;
z = scalbnl(z, -e0);
for (i = 0; i < 5; i++) {
- t[i] = (double) ((int) (z));
- z = (z - (long double) t[i]) * two24l;
+ t[i] = (double)((int)(z));
+ z = (z - (long double)t[i]) * two24l;
}
nx = 5;
while (t[nx - 1] == 0.0)
nx--; /* skip zero term */
ipio2 = _TBL_ipio2l_inf;
- n = __rem_pio2m(t, v, e0, nx, 3, (const int *) ipio2);
- z = (long double) v[2] + (long double) v[1];
- w = (long double) v[0];
+ n = __rem_pio2m(t, v, e0, nx, 3, (const int *)ipio2);
+ z = (long double)v[2] + (long double)v[1];
+ w = (long double)v[0];
y[0] = z + w;
y[1] = z - (y[0] - w);
- if (sign == 1) {
+ if (sign != 0) {
y[0] = -y[0];
y[1] = -y[1];
return (-n);
diff --git a/usr/src/lib/libm/common/Q/atan2l.c b/usr/src/lib/libm/common/Q/atan2l.c
index 46c4a5fb58..1739ed4576 100644
--- a/usr/src/lib/libm/common/Q/atan2l.c
+++ b/usr/src/lib/libm/common/Q/atan2l.c
@@ -63,7 +63,7 @@
static const long double
zero = 0.0L,
- tiny = 1.0e-40L,
+ tiny = 1.0e-40L,
one = 1.0L,
half = 0.5L,
PI3o4 = 2.356194490192344928846982537459627163148L,
@@ -73,7 +73,8 @@ static const long double
PI_lo = 8.671810130123781024797044026043351968762e-35L;
long double
-atan2l(long double y, long double x) {
+atan2l(long double y, long double x)
+{
long double t, z;
int k, m, signy, signx;
@@ -83,7 +84,8 @@ atan2l(long double y, long double x) {
signx = signbitl(x);
if (x == one)
return (atanl(y));
- m = signy + signx + signx;
+ /* Ensure sign indicators are boolean */
+ m = (signy != 0) + (signx != 0) + (signx != 0);
/* when y = 0 */
if (y == zero)
@@ -100,7 +102,7 @@ atan2l(long double y, long double x) {
/* when x = 0 */
if (x == zero)
- return (signy == 1 ? -PIo2 - tiny : PIo2 + tiny);
+ return (signy != 0 ? -PIo2 - tiny : PIo2 + tiny);
/* when x is INF */
if (!finitel(x)) {
@@ -130,7 +132,7 @@ atan2l(long double y, long double x) {
}
/* when y is INF */
if (!finitel(y))
- return (signy == 1 ? -PIo2 - tiny : PIo2 + tiny);
+ return (signy != 0 ? -PIo2 - tiny : PIo2 + tiny);
/* compute y/x */
x = fabsl(x);
@@ -156,5 +158,5 @@ atan2l(long double y, long double x) {
return ((z - t) - PI); /* atan(-,-) */
}
/* NOTREACHED */
- return 0.0L;
+ return (0.0L);
}
diff --git a/usr/src/lib/libm/common/Q/jnl.c b/usr/src/lib/libm/common/Q/jnl.c
index adc1bc9017..db3229b949 100644
--- a/usr/src/lib/libm/common/Q/jnl.c
+++ b/usr/src/lib/libm/common/Q/jnl.c
@@ -68,7 +68,8 @@ zero = 0.0L,
one = 1.0L;
GENERIC
-jnl(n, x) int n; GENERIC x; {
+jnl(int n, GENERIC x)
+{
int i, sgn;
GENERIC a, b, temp, z, w;
@@ -87,7 +88,7 @@ jnl(n, x) int n; GENERIC x; {
if (x != x)
return (x+x);
if ((n&1) == 0)
- sgn = 0; /* even n */
+ sgn = 0; /* even n */
else
sgn = signbitl(x); /* old n */
x = fabsl(x);
@@ -97,7 +98,7 @@ jnl(n, x) int n; GENERIC x; {
* Safe to use
* J(n+1,x)=2n/x *J(n,x)-J(n-1,x)
*/
- if (x > 1.0e91L) {
+ if (x > 1.0e91L) {
/*
* x >> n**2
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
@@ -108,119 +109,142 @@ jnl(n, x) int n; GENERIC x; {
* n sin(xn)*sqt2 cos(xn)*sqt2
* ----------------------------------
* 0 s-c c+s
- * 1 -s-c -c+s
+ * 1 -s-c -c+s
* 2 -s+c -c-s
* 3 s+c c-s
*/
- switch (n&3) {
- case 0: temp = cosl(x)+sinl(x); break;
- case 1: temp = -cosl(x)+sinl(x); break;
- case 2: temp = -cosl(x)-sinl(x); break;
- case 3: temp = cosl(x)-sinl(x); break;
- }
- b = invsqrtpi*temp/sqrtl(x);
- } else {
+ switch (n&3) {
+ case 0:
+ temp = cosl(x)+sinl(x);
+ break;
+ case 1:
+ temp = -cosl(x)+sinl(x);
+ break;
+ case 2:
+ temp = -cosl(x)-sinl(x);
+ break;
+ case 3:
+ temp = cosl(x)-sinl(x);
+ break;
+ }
+ b = invsqrtpi*temp/sqrtl(x);
+ } else {
a = j0l(x);
b = j1l(x);
for (i = 1; i < n; i++) {
- temp = b;
- b = b*((GENERIC)(i+i)/x) - a; /* avoid underflow */
- a = temp;
+ temp = b;
+ /* avoid underflow */
+ b = b*((GENERIC)(i+i)/x) - a;
+ a = temp;
}
- }
- } else {
- if (x < 1e-17L) { /* use J(n,x) = 1/n!*(x/2)^n */
- b = powl(0.5L*x, (GENERIC)n);
- if (b != zero) {
- for (a = one, i = 1; i <= n; i++) a *= (GENERIC)i;
- b = b/a;
- }
- } else {
- /* use backward recurrence */
- /*
- * x x^2 x^2
- * J(n,x)/J(n-1,x) = ---- ------ ------ .....
- * 2n - 2(n+1) - 2(n+2)
- *
- * 1 1 1
- * (for large x) = ---- ------ ------ .....
- * 2n 2(n+1) 2(n+2)
- * -- - ------ - ------ -
- * x x x
- *
- * Let w = 2n/x and h=2/x, then the above quotient
- * is equal to the continued fraction:
- * 1
- * = -----------------------
- * 1
- * w - -----------------
- * 1
- * w+h - ---------
- * w+2h - ...
- *
- * To determine how many terms needed, let
- * Q(0) = w, Q(1) = w(w+h) - 1,
- * Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
- * When Q(k) > 1e4 good for single
- * When Q(k) > 1e9 good for double
- * When Q(k) > 1e17 good for quaduple
- */
- /* determin k */
- GENERIC t, v;
- double q0, q1, h, tmp; int k, m;
- w = (n+n)/(double)x; h = 2.0/(double)x;
- q0 = w; z = w+h; q1 = w*z - 1.0; k = 1;
- while (q1 < 1.0e17) {
- k += 1; z += h;
- tmp = z*q1 - q0;
- q0 = q1;
- q1 = tmp;
}
- m = n+n;
- for (t = zero, i = 2*(n+k); i >= m; i -= 2) t = one/(i/x-t);
- a = t;
- b = one;
- /*
- * estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
- * hence, if n*(log(2n/x)) > ...
- * single 8.8722839355e+01
- * double 7.09782712893383973096e+02
- * long double 1.1356523406294143949491931077970765006170e+04
- * then recurrent value may overflow and the result is
- * likely underflow to zero
- */
- tmp = n;
- v = two/x;
- tmp = tmp*logl(fabsl(v*tmp));
- if (tmp < 1.1356523406294143949491931077970765e+04L) {
- for (i = n-1; i > 0; i--) {
- temp = b;
- b = ((i+i)/x)*b - a;
- a = temp;
- }
+ } else {
+ if (x < 1e-17L) { /* use J(n,x) = 1/n!*(x/2)^n */
+ b = powl(0.5L*x, (GENERIC)n);
+ if (b != zero) {
+ for (a = one, i = 1; i <= n; i++)
+ a *= (GENERIC)i;
+ b = b/a;
+ }
} else {
+ /* use backward recurrence */
+ /* BEGIN CSTYLED */
+ /*
+ * x x^2 x^2
+ * J(n,x)/J(n-1,x) = ---- ------ ------ .....
+ * 2n - 2(n+1) - 2(n+2)
+ *
+ * 1 1 1
+ * (for large x) = ---- ------ ------ .....
+ * 2n 2(n+1) 2(n+2)
+ * -- - ------ - ------ -
+ * x x x
+ *
+ * Let w = 2n/x and h=2/x, then the above quotient
+ * is equal to the continued fraction:
+ * 1
+ * = -----------------------
+ * 1
+ * w - -----------------
+ * 1
+ * w+h - ---------
+ * w+2h - ...
+ *
+ * To determine how many terms needed, let
+ * Q(0) = w, Q(1) = w(w+h) - 1,
+ * Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
+ * When Q(k) > 1e4 good for single
+ * When Q(k) > 1e9 good for double
+ * When Q(k) > 1e17 good for quaduple
+ */
+ /* END CSTYLED */
+ /* determine k */
+ GENERIC t, v;
+ double q0, q1, h, tmp;
+ int k, m;
+ w = (n+n)/(double)x;
+ h = 2.0/(double)x;
+ q0 = w;
+ z = w+h;
+ q1 = w*z - 1.0;
+ k = 1;
+ while (q1 < 1.0e17) {
+ k += 1;
+ z += h;
+ tmp = z*q1 - q0;
+ q0 = q1;
+ q1 = tmp;
+ }
+ m = n+n;
+ for (t = zero, i = 2*(n+k); i >= m; i -= 2)
+ t = one/(i/x-t);
+ a = t;
+ b = one;
+ /*
+ * estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
+ * hence, if n*(log(2n/x)) > ...
+ * single:
+ * 8.8722839355e+01
+ * double:
+ * 7.09782712893383973096e+02
+ * long double:
+ * 1.1356523406294143949491931077970765006170e+04
+ * then recurrent value may overflow and the result is
+ * likely underflow to zero
+ */
+ tmp = n;
+ v = two/x;
+ tmp = tmp*logl(fabsl(v*tmp));
+ if (tmp < 1.1356523406294143949491931077970765e+04L) {
+ for (i = n-1; i > 0; i--) {
+ temp = b;
+ b = ((i+i)/x)*b - a;
+ a = temp;
+ }
+ } else {
for (i = n-1; i > 0; i--) {
- temp = b;
- b = ((i+i)/x)*b - a;
- a = temp;
- if (b > 1e1000L) {
- a /= b;
- t /= b;
- b = 1.0;
- }
- }
+ temp = b;
+ b = ((i+i)/x)*b - a;
+ a = temp;
+ if (b > 1e1000L) {
+ a /= b;
+ t /= b;
+ b = 1.0;
+ }
+ }
+ }
+ b = (t*j0l(x)/b);
}
- b = (t*j0l(x)/b);
- }
}
- if (sgn == 1)
+ if (sgn != 0)
return (-b);
else
return (b);
}
-GENERIC ynl(n, x)
-int n; GENERIC x; {
+GENERIC
+ynl(int n, GENERIC x)
+{
int i;
int sign;
GENERIC a, b, temp;
@@ -245,24 +269,34 @@ int n; GENERIC x; {
if (!finitel(x))
return (zero);
- if (x > 1.0e91L) { /* x >> n**2
- Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
- Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi)
- Let s = sin(x), c = cos(x),
- xn = x-(2n+1)*pi/4, sqt2 = sqrt(2), then
-
- n sin(xn)*sqt2 cos(xn)*sqt2
- ----------------------------------
- 0 s-c c+s
- 1 -s-c -c+s
- 2 -s+c -c-s
- 3 s+c c-s
- */
+ if (x > 1.0e91L) {
+ /*
+ * x >> n**2
+ * Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
+ * Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi)
+ * Let s = sin(x), c = cos(x),
+ * xn = x-(2n+1)*pi/4, sqt2 = sqrt(2), then
+ *
+ * n sin(xn)*sqt2 cos(xn)*sqt2
+ * ----------------------------------
+ * 0 s-c c+s
+ * 1 -s-c -c+s
+ * 2 -s+c -c-s
+ * 3 s+c c-s
+ */
switch (n&3) {
- case 0: temp = sinl(x)-cosl(x); break;
- case 1: temp = -sinl(x)-cosl(x); break;
- case 2: temp = -sinl(x)+cosl(x); break;
- case 3: temp = sinl(x)+cosl(x); break;
+ case 0:
+ temp = sinl(x)-cosl(x);
+ break;
+ case 1:
+ temp = -sinl(x)-cosl(x);
+ break;
+ case 2:
+ temp = -sinl(x)+cosl(x);
+ break;
+ case 3:
+ temp = sinl(x)+cosl(x);
+ break;
}
b = invsqrtpi*temp/sqrtl(x);
} else {
diff --git a/usr/src/lib/libmd/Makefile.targ b/usr/src/lib/libmd/Makefile.targ
index fadc3d71ad..f15dc83396 100644
--- a/usr/src/lib/libmd/Makefile.targ
+++ b/usr/src/lib/libmd/Makefile.targ
@@ -22,6 +22,7 @@
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2013 Saso Kiselkov. All rights reserved.
+# Copyright 2019 Peter Tribble.
#
COMDIR = $(SRC)/common/crypto
@@ -45,7 +46,7 @@ pics/%.o: $(COMDIR)/sha1/%.c
pics/sha1_asm.o: $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
$(COMPILE.s) -o pics/sha1_asm.o \
$(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/%.o: $(COMDIR)/sha2/%.c
$(COMPILE.c) -I$(COMDIR)/sha2 -o $@ $<
diff --git a/usr/src/lib/libsys/Makefile.targ b/usr/src/lib/libsys/Makefile.targ
index 9738a9b9b6..e025958f2f 100644
--- a/usr/src/lib/libsys/Makefile.targ
+++ b/usr/src/lib/libsys/Makefile.targ
@@ -21,6 +21,7 @@
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2019 Peter Tribble.
#
BUILD.SO += $(PICS)
@@ -35,4 +36,4 @@ pics/%.o := ASFLAGS += $(AS_PICFLAGS)
pics/%.o: %.s
$(COMPILE.s) -o $@ $<
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
diff --git a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.targ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.targ
index 422f5f8c17..f28bd2db00 100644
--- a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.targ
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.targ
@@ -21,18 +21,19 @@
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2019 Peter Tribble.
#
include ../../Makefile.targ
pics/aes_crypt_asm.o: $(AES_DIR)/sun4u/aes_crypt_asm.s
$(COMPILE.s) -o $@ $(AES_DIR)/sun4u/aes_crypt_asm.s
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/arcfour_crypt_asm.o: $(ARCFOUR_DIR)/sun4u/arcfour_crypt_asm.s
$(COMPILE.s) -o $@ $(ARCFOUR_DIR)/sun4u/arcfour_crypt_asm.s
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
pics/des_crypt_asm.o: $(DES_DIR)/sun4u/des_crypt_asm.s
$(COMPILE.s) -o $@ $(DES_DIR)/sun4u/des_crypt_asm.s
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
diff --git a/usr/src/lib/smbsrv/libmlsvc/common/lsalib.c b/usr/src/lib/smbsrv/libmlsvc/common/lsalib.c
index e995cf1c68..47b9466fb4 100644
--- a/usr/src/lib/smbsrv/libmlsvc/common/lsalib.c
+++ b/usr/src/lib/smbsrv/libmlsvc/common/lsalib.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -81,6 +81,9 @@ lsa_lookup_name(char *account, uint16_t type, smb_account_t *info)
uint32_t status;
char *slash;
+ if (account == NULL)
+ return (NT_STATUS_NONE_MAPPED);
+
(void) strsubst(account, '/', '\\');
(void) strcanon(account, "\\");
/* \john -> john */
diff --git a/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_svc.c b/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_svc.c
index 89a395cca5..a511e08728 100644
--- a/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_svc.c
+++ b/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_svc.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -1002,11 +1002,11 @@ srvsvc_s_NetShareGetInfo(void *arg, ndr_xa_t *mxa)
status = srvsvc_share_getsd(mxa, &si, &sd);
if (status == ERROR_SUCCESS) {
- info503->shi503_reserved = sd.sd_size;
- info503->shi503_security_descriptor = sd.sd_buf;
+ info1501->shi1501_reserved = sd.sd_size;
+ info1501->shi1501_security_descriptor = sd.sd_buf;
} else {
- info503->shi503_reserved = 0;
- info503->shi503_security_descriptor = NULL;
+ info1501->shi1501_reserved = 0;
+ info1501->shi1501_security_descriptor = NULL;
}
param->result.ru.info1501 = info1501;
@@ -1622,8 +1622,8 @@ srvsvc_NetSessionEnumCommon(ndr_xa_t *mxa, srvsvc_infonres_t *info,
* On success, the return value is NERR_Success/ERROR_SUCCESS.
* On failure, the return value can be one of the following errors:
*
- * ERROR_ACCESS_DENIED The user does not have access to the
- * requested information.
+ * ERROR_ACCESS_DENIED The user does not have access to the
+ * requested information.
* ERROR_INVALID_PARAMETER The specified parameter is invalid.
* ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available.
* NERR_ClientNameNotFound A session does not exist with that
diff --git a/usr/src/lib/smbsrv/libmlsvc/common/winreg_svc.c b/usr/src/lib/smbsrv/libmlsvc/common/winreg_svc.c
index a53ad919e7..71ee4775da 100644
--- a/usr/src/lib/smbsrv/libmlsvc/common/winreg_svc.c
+++ b/usr/src/lib/smbsrv/libmlsvc/common/winreg_svc.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -907,7 +908,8 @@ winreg_s_QueryValue(void *arg, ndr_xa_t *mxa)
name = (char *)param->value_name.str;
- if (strcasecmp(name, "PrimaryModule") == 0) {
+ if (name == NULL ||
+ strcasecmp(name, "PrimaryModule") == 0) {
param->status = ERROR_FILE_NOT_FOUND;
return (NDR_DRC_OK);
}
diff --git a/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c b/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c
index a82e55f5ff..0bc13e4a3c 100644
--- a/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c
+++ b/usr/src/lib/smbsrv/libsmb/common/smb_cfg.c
@@ -66,10 +66,11 @@ struct str_val {
#define MACHINE_UUID "machine_uuid"
#define IDMAP_DOMAIN "domain_name"
#define IDMAP_PREF_DC "preferred_dc"
+#define IDMAP_SITE_NAME "site_name"
#define IDMAP_PG_NAME "config"
-#define SMB_SECMODE_WORKGRP_STR "workgroup"
-#define SMB_SECMODE_DOMAIN_STR "domain"
+#define SMB_SECMODE_WORKGRP_STR "workgroup"
+#define SMB_SECMODE_DOMAIN_STR "domain"
#define SMB_ENC_LEN 1024
#define SMB_DEC_LEN 256
@@ -156,6 +157,8 @@ static char *smb_base64_encode(char *str_to_encode);
static char *smb_base64_decode(char *encoded_str);
static int smb_config_get_idmap_preferred_dc(char *, int);
static int smb_config_set_idmap_preferred_dc(char *);
+static int smb_config_get_idmap_site_name(char *, int);
+static int smb_config_set_idmap_site_name(char *);
char *
smb_config_getname(smb_cfg_id_t id)
@@ -377,6 +380,8 @@ smb_config_getstr(smb_cfg_id_t id, char *cbuf, int bufsz)
cfg = smb_config_getent(id);
assert(cfg->sc_type == SCF_TYPE_ASTRING);
+ if (id == SMB_CI_ADS_SITE)
+ return (smb_config_get_idmap_site_name(cbuf, bufsz));
if (id == SMB_CI_DOMAIN_SRV)
return (smb_config_get_idmap_preferred_dc(cbuf, bufsz));
@@ -583,6 +588,8 @@ smb_config_setstr(smb_cfg_id_t id, char *value)
cfg = smb_config_getent(id);
assert(cfg->sc_type == SCF_TYPE_ASTRING);
+ if (id == SMB_CI_ADS_SITE)
+ return (smb_config_set_idmap_site_name(value));
if (id == SMB_CI_DOMAIN_SRV)
return (smb_config_set_idmap_preferred_dc(value));
@@ -877,6 +884,30 @@ smb_config_set_idmap_preferred_dc(char *value)
IDMAP_PREF_DC, value));
}
+static int
+smb_config_get_idmap_site_name(char *cbuf, int bufsz)
+{
+ char *s;
+ int len, rc = -1;
+
+ s = smb_config_getenv_generic(IDMAP_SITE_NAME,
+ IDMAP_FMRI_PREFIX, IDMAP_PG_NAME);
+ if (s != NULL) {
+ len = strlcpy(cbuf, s, bufsz);
+ if (len < bufsz)
+ rc = 0;
+ free(s);
+ }
+ return (rc);
+}
+
+static int
+smb_config_set_idmap_site_name(char *value)
+{
+ return (smb_config_setenv_generic(IDMAP_FMRI_PREFIX, IDMAP_PG_NAME,
+ IDMAP_SITE_NAME, value));
+}
+
/*
* smb_config_set_idmap_domain
*
diff --git a/usr/src/man/man9e/open.9e b/usr/src/man/man9e/open.9e
index 9f5e4ae797..ef041db5ef 100644
--- a/usr/src/man/man9e/open.9e
+++ b/usr/src/man/man9e/open.9e
@@ -256,7 +256,7 @@ using the user credentials pointed to by \fIcred_p\fR.
.sp
.LP
When exclusive access is requested by including the \fBFEXCL\fR flag in
-\fIflag\fR or \fIoflag\fR, if the caller cannot be granted exclusive access
+\fIflag\fR or \fIoflag\fR, but the caller cannot be granted exclusive access
to the device because it is already open, then the device driver should
conventionally return \fBEBUSY\fR. If instead, exclusive opens are not
supported, then the driver should return \fBENOTSUP\fR or \fBEINVAL\fR.
diff --git a/usr/src/tools/quick/make-idmap b/usr/src/tools/quick/make-idmap
index 13c52089aa..61b4fa4d2c 100755
--- a/usr/src/tools/quick/make-idmap
+++ b/usr/src/tools/quick/make-idmap
@@ -186,7 +186,6 @@ do_tags() {
do_tar() {
git_rev=`git rev-parse --short=8 HEAD`
files="
-kernel/misc/idmap
kernel/misc/amd64/idmap
lib/svc/manifest/system/idmap.xml
usr/lib/idmapd
diff --git a/usr/src/ucblib/libucb/Makefile.com b/usr/src/ucblib/libucb/Makefile.com
index bb277af674..94c24fe097 100644
--- a/usr/src/ucblib/libucb/Makefile.com
+++ b/usr/src/ucblib/libucb/Makefile.com
@@ -22,6 +22,8 @@
# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
#
# Copyright (c) 2018, Joyent, Inc.
+# Copyright 2019 Peter Tribble.
+#
LIBRARY= libucb.a
VERS= .1
@@ -133,7 +135,7 @@ pics/%.o: sys/%.c
pics/%.o: ../$(MACH)/sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
#
# Include library targets
diff --git a/usr/src/ucblib/libucb/sparc/Makefile b/usr/src/ucblib/libucb/sparc/Makefile
index bfa844235b..6b8f2d0c3e 100644
--- a/usr/src/ucblib/libucb/sparc/Makefile
+++ b/usr/src/ucblib/libucb/sparc/Makefile
@@ -22,8 +22,10 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2019 Peter Tribble.
+#
-SYSOBJS= \
+SYSOBJS= \
setjmp.o \
signal.o
@@ -35,7 +37,7 @@ BUILD.s= $(AS) $(ASFLAGS) $< -o $@
# sparc-specific rule
pics/%.o: sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
.KEEP_STATE:
diff --git a/usr/src/ucblib/libucb/sparcv9/Makefile b/usr/src/ucblib/libucb/sparcv9/Makefile
index 89af3cc63e..97883b2a05 100644
--- a/usr/src/ucblib/libucb/sparcv9/Makefile
+++ b/usr/src/ucblib/libucb/sparcv9/Makefile
@@ -22,8 +22,10 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2019 Peter Tribble.
+#
-SYSOBJS= \
+SYSOBJS= \
setjmp.o \
signal.o
@@ -41,7 +43,7 @@ pics/%.o: ../sparc/sys/%.c
pics/%.o: sys/%.s
$(BUILD.s)
- $(POST_PROCESS_O)
+ $(POST_PROCESS_S_O)
.KEEP_STATE:
diff --git a/usr/src/uts/common/fs/smbsrv/smb_nt_transact_security.c b/usr/src/uts/common/fs/smbsrv/smb_nt_transact_security.c
index 98056d1749..1c0f89238e 100644
--- a/usr/src/uts/common/fs/smbsrv/smb_nt_transact_security.c
+++ b/usr/src/uts/common/fs/smbsrv/smb_nt_transact_security.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
*/
#include <smbsrv/smb_kproto.h>
@@ -371,6 +371,7 @@ smb_decode_sd(mbuf_chain_t *mbc, smb_sd_t *sd)
uint32_t group_offs;
uint32_t sacl_offs;
uint32_t dacl_offs;
+ int rc;
smb_sd_init(sd, SECURITY_DESCRIPTOR_REVISION);
@@ -378,12 +379,14 @@ smb_decode_sd(mbuf_chain_t *mbc, smb_sd_t *sd)
mbc->chain_offset,
mbc->max_bytes - mbc->chain_offset);
- if (smb_mbc_decodef(&sdbuf, "b.wllll",
+ rc = smb_mbc_decodef(&sdbuf, "b.wllll",
&sd->sd_revision, &sd->sd_control,
- &owner_offs, &group_offs, &sacl_offs, &dacl_offs))
- goto decode_error;
+ &owner_offs, &group_offs, &sacl_offs, &dacl_offs);
+ /* Prevent disallowed flags in smb_sd_term. */
sd->sd_control &= ~SE_SELF_RELATIVE;
+ if (rc != 0)
+ goto decode_error;
if (owner_offs != 0) {
if (owner_offs < SMB_SD_HDRSIZE)
diff --git a/usr/src/uts/sun4/os/mp_startup.c b/usr/src/uts/sun4/os/mp_startup.c
index 8cf6e1fa81..8dc4021232 100644
--- a/usr/src/uts/sun4/os/mp_startup.c
+++ b/usr/src/uts/sun4/os/mp_startup.c
@@ -26,6 +26,7 @@
/*
* Copyright 2019 Joyent, Inc.
+ * Copyright 2019 Peter Tribble.
*/
#include <sys/sysmacros.h>
@@ -167,7 +168,7 @@ cold_flag_set(int cpuid)
cp = cpu[cpuid];
- if (!(cpu->cpu_flags & CPU_ENABLE))
+ if (!(cp->cpu_flags & CPU_ENABLE))
ncpus_intr_enabled++;
cp->cpu_flags |= CPU_RUNNING | CPU_ENABLE | CPU_EXISTS;
diff --git a/usr/src/uts/sun4u/sys/Makefile b/usr/src/uts/sun4u/sys/Makefile
index 34aad1b282..ae7f01fcf7 100644
--- a/usr/src/uts/sun4u/sys/Makefile
+++ b/usr/src/uts/sun4u/sys/Makefile
@@ -57,6 +57,7 @@ SUN4_HDRS= \
nexusdebug.h \
prom_debug.h \
scb.h \
+ smt.h \
sun4asi.h \
tod.h \
trapstat.h \