summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
authorDan McDonald <danmcd@mnx.io>2022-10-12 14:51:26 -0400
committerDan McDonald <danmcd@mnx.io>2022-10-12 14:51:26 -0400
commit7a4e97e5a1d05f864449da3567f81a5c56804ad2 (patch)
treefe37b37afe20c778bd90c68110347c8c26aeca04 /usr/src/lib
parent5e9232afcd2578bbade4d6c285ab7f62474a5a30 (diff)
parent374973c21804baf7ee038f3b1c3ee81a3613e0b3 (diff)
downloadillumos-joyent-7a4e97e5a1d05f864449da3567f81a5c56804ad2.tar.gz
[illumos-gate merge]
commit 374973c21804baf7ee038f3b1c3ee81a3613e0b3 15065 vmm: variable set but not used commit 1261b05561db859f9c9c1418718a0a9a2930e0cb 15069 dladm_str2bw() does not reset errno which is checked after string conversion commit 670f080b72593a4a43a509cd4a020ffe8a6484a6 14690 nvmeadm should refer to namespaces by their nsid commit 2841912edb2f7c5e77ae94d2ff7fe17ad82f2fcd 15051 SMB2 signature mismatch gets wrong error commit 11fb28bc14a13f8ca7aa0e0e8dd0c259dcb79049 15042 AD join fails if hostname longer than 14 characters commit ad1760fe5da149d8b902bd879789686794f383ce 15058 vmm: comparison is always true commit 7b0b8123e6101089b9e44e31f6b14b0762845fbb 15041 smbadm join reports clock skew as bad password commit 3cc2454804c6ebaa0b2a607ad425214c1e51c4ee 15037 cp_subr.s: Invalid instruction argument
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/commpage/amd64/cp_subr.s6
-rw-r--r--usr/src/lib/commpage/i386/cp_subr.s6
-rw-r--r--usr/src/lib/libdladm/common/libdladm.c1
-rw-r--r--usr/src/lib/smbsrv/libsmbns/common/libsmbns.h2
-rw-r--r--usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c13
-rw-r--r--usr/src/lib/smbsrv/libsmbns/common/smbns_krb.c21
6 files changed, 31 insertions, 18 deletions
diff --git a/usr/src/lib/commpage/amd64/cp_subr.s b/usr/src/lib/commpage/amd64/cp_subr.s
index ebae0ed307..36664578ff 100644
--- a/usr/src/lib/commpage/amd64/cp_subr.s
+++ b/usr/src/lib/commpage/amd64/cp_subr.s
@@ -107,7 +107,7 @@
/* Query the CPU ID and stash it in r10 for later comparison */
movl $GETCPU_GDT_OFFSET, %edx
- lsl %dx, %edx
+ lsl %edx, %edx
movl %edx, %r10d
3:
@@ -163,7 +163,7 @@
8:
movl $GETCPU_GDT_OFFSET, %edx
- lsl %dx, %edx
+ lsl %edx, %edx
cmpl %edx, %r10d
jne 9f
movq (%r9, %rdx, 8), %rdx
@@ -209,7 +209,7 @@
ret
1:
mov $GETCPU_GDT_OFFSET, %eax
- lsl %ax, %eax
+ lsl %eax, %eax
ret
SET_SIZE(__cp_getcpu)
diff --git a/usr/src/lib/commpage/i386/cp_subr.s b/usr/src/lib/commpage/i386/cp_subr.s
index 83b7dcff56..4028a0874a 100644
--- a/usr/src/lib/commpage/i386/cp_subr.s
+++ b/usr/src/lib/commpage/i386/cp_subr.s
@@ -84,7 +84,7 @@
movl $0, (%esp)
mov $GETCPU_GDT_OFFSET, %eax
- lsl %ax, %eax
+ lsl %eax, %eax
movl %eax, 0x4(%esp)
movl CP_TSC_TYPE(%edi), %eax
@@ -131,7 +131,7 @@
* since the cpu_id was first checked.
*/
movl $GETCPU_GDT_OFFSET, %ecx
- lsl %cx, %ecx
+ lsl %ecx, %ecx
movl 0x4(%esp), %esi
cmpl %ecx, %esi
jne 9f
@@ -196,6 +196,6 @@
ret
1:
mov $GETCPU_GDT_OFFSET, %eax
- lsl %ax, %eax
+ lsl %eax, %eax
ret
SET_SIZE(__cp_getcpu)
diff --git a/usr/src/lib/libdladm/common/libdladm.c b/usr/src/lib/libdladm/common/libdladm.c
index fc79a32c02..eec92e09ba 100644
--- a/usr/src/lib/libdladm/common/libdladm.c
+++ b/usr/src/lib/libdladm/common/libdladm.c
@@ -539,6 +539,7 @@ dladm_str2bw(char *oarg, uint64_t *bw)
int64_t n;
int mult = 1;
+ errno = 0;
n = strtoull(oarg, &endp, 10);
if ((errno != 0) || (strlen(endp) > 1))
diff --git a/usr/src/lib/smbsrv/libsmbns/common/libsmbns.h b/usr/src/lib/smbsrv/libsmbns/common/libsmbns.h
index 7cde269335..5ccd894b6f 100644
--- a/usr/src/lib/smbsrv/libsmbns/common/libsmbns.h
+++ b/usr/src/lib/smbsrv/libsmbns/common/libsmbns.h
@@ -64,7 +64,9 @@ typedef enum smb_ads_status {
SMB_ADS_KRB5_INIT_CTX,
SMB_ADS_KRB5_CC_DEFAULT,
SMB_ADS_KRB5_PARSE_PRINCIPAL,
+ SMB_ADS_KRB5_GET_INIT_CREDS_OTHER,
SMB_ADS_KRB5_GET_INIT_CREDS_PW,
+ SMB_ADS_KRB5_GET_INIT_CREDS_SKEW,
SMB_ADS_KRB5_CC_INITIALIZE,
SMB_ADS_KRB5_CC_STORE_CRED,
SMB_ADS_CANT_LOCATE_DC,
diff --git a/usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c b/usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c
index 8bbe0e8afb..0a07771985 100644
--- a/usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c
+++ b/usr/src/lib/smbsrv/libsmbns/common/smbns_ads.c
@@ -1599,7 +1599,8 @@ smb_ads_lookup_computer_n_attr(smb_ads_handle_t *ah, smb_ads_avpair_t *avpair,
{
char *attrs[3], filter[SMB_ADS_MAXBUFLEN];
LDAPMessage *res;
- char sam_acct[SMB_SAMACCT_MAXLEN], sam_acct2[SMB_SAMACCT_MAXLEN];
+ char sam_acct[SMB_SAMACCT_MAXLEN];
+ char tmpbuf[SMB_ADS_MAXBUFLEN];
smb_ads_qstat_t rc;
int err;
@@ -1618,12 +1619,12 @@ smb_ads_lookup_computer_n_attr(smb_ads_handle_t *ah, smb_ads_avpair_t *avpair,
attrs[1] = avpair->avp_attr;
}
- if (smb_ads_escape_search_filter_chars(sam_acct, sam_acct2) != 0)
+ if (smb_ads_escape_search_filter_chars(sam_acct, tmpbuf) != 0)
return (SMB_ADS_STAT_ERR);
(void) snprintf(filter, sizeof (filter),
- "(&(objectClass=computer)(%s=%s))", SMB_ADS_ATTR_SAMACCT,
- sam_acct2);
+ "(&(objectClass=computer)(%s=%s))",
+ SMB_ADS_ATTR_SAMACCT, tmpbuf);
syslog(LOG_DEBUG, "smbns: lookup_computer, "
"dn=%s, scope=%d", dn, scope);
@@ -1947,8 +1948,12 @@ adjoin_table[] = {
"Failed to resolve default credential cache." },
{ SMB_ADS_KRB5_PARSE_PRINCIPAL,
"Failed parsing the user principal name." },
+ { SMB_ADS_KRB5_GET_INIT_CREDS_OTHER,
+ "Failed getting initial credentials. (See svc. log)" },
{ SMB_ADS_KRB5_GET_INIT_CREDS_PW,
"Failed getting initial credentials. (Wrong password?)" },
+ { SMB_ADS_KRB5_GET_INIT_CREDS_SKEW,
+ "Failed getting initial credentials. (Clock skew too great)" },
{ SMB_ADS_KRB5_CC_INITIALIZE,
"Failed initializing the credential cache." },
{ SMB_ADS_KRB5_CC_STORE_CRED,
diff --git a/usr/src/lib/smbsrv/libsmbns/common/smbns_krb.c b/usr/src/lib/smbsrv/libsmbns/common/smbns_krb.c
index aebc6f8c06..b29963f0e9 100644
--- a/usr/src/lib/smbsrv/libsmbns/common/smbns_krb.c
+++ b/usr/src/lib/smbsrv/libsmbns/common/smbns_krb.c
@@ -68,7 +68,6 @@ smb_kinit(char *domain_name, char *principal_name, char *principal_passwd)
krb5_principal me = NULL;
krb5_creds my_creds;
krb5_error_code code;
- const char *errmsg = NULL;
const char *doing = NULL;
smb_ads_status_t err;
@@ -115,11 +114,20 @@ smb_kinit(char *domain_name, char *principal_name, char *principal_passwd)
principal_passwd, NULL, 0, (krb5_deltat)0,
NULL, NULL);
if (code != 0) {
- err = SMB_ADS_KRB5_GET_INIT_CREDS_PW;
doing = "smbns_krb: getting initial credentials";
+ switch (code) {
- if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) {
- errmsg = "smbns_krb: Password incorrect";
+ case KRB5KRB_AP_ERR_BAD_INTEGRITY:
+ err = SMB_ADS_KRB5_GET_INIT_CREDS_PW;
+ break;
+
+ case KRB5KRB_AP_ERR_SKEW:
+ err = SMB_ADS_KRB5_GET_INIT_CREDS_SKEW;
+ break;
+
+ default:
+ err = SMB_ADS_KRB5_GET_INIT_CREDS_OTHER;
+ break;
}
goto cleanup;
@@ -144,10 +152,7 @@ smb_kinit(char *domain_name, char *principal_name, char *principal_passwd)
cleanup:
if (code != 0) {
- if (errmsg == NULL)
- smb_krb5_log_errmsg(ctx, doing, code);
- else
- syslog(LOG_ERR, "%s (%s)", doing, errmsg);
+ smb_krb5_log_errmsg(ctx, doing, code);
}
if (my_creds.client == me) {