summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
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) {