summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/cfgadm_plugins/shp/common/shp.c3
-rw-r--r--usr/src/lib/gss_mechs/mech_dh/backend/mech/context.c3
-rw-r--r--usr/src/lib/gss_mechs/mech_dummy/mech/dmech.c3
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/krb5/krb/sendauth.c21
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/krb5/os/def_realm.c31
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/krb5/os/kuserok.c17
-rw-r--r--usr/src/lib/krb5/dyn/dyn_delete.c13
-rw-r--r--usr/src/lib/libbc/libc/gen/common/ndbm.c25
-rw-r--r--usr/src/lib/libbsm/common/audit_crontab.c3
-rw-r--r--usr/src/lib/libc/port/gen/daemon.c3
-rw-r--r--usr/src/lib/libc/port/gen/getgrnam_r.c3
-rw-r--r--usr/src/lib/libc/port/gen/getpwnam_r.c3
-rw-r--r--usr/src/lib/libc/port/gen/getspent_r.c3
-rw-r--r--usr/src/lib/libc/port/gen/ndbm.c7
-rw-r--r--usr/src/lib/libc/port/locale/engine.c3
-rw-r--r--usr/src/lib/libc/port/threads/rwlock.c3
-rw-r--r--usr/src/lib/libc/port/threads/synch.c31
-rw-r--r--usr/src/lib/libc/port/threads/thr.c15
-rw-r--r--usr/src/lib/libcpc/common/libcpc.c3
-rw-r--r--usr/src/lib/libcurses/screen/tputs.c3
-rw-r--r--usr/src/lib/libdevinfo/devinfo_devlink.c3
-rw-r--r--usr/src/lib/libdhcpagent/common/dhcpagent_ipc.c5
-rw-r--r--usr/src/lib/libdhcputil/common/dhcp_inittab.c3
-rw-r--r--usr/src/lib/libnisdb/db_table.cc5
-rw-r--r--usr/src/lib/libnsl/nss/netdir_inet_sundry.c3
-rw-r--r--usr/src/lib/libnsl/rpc/clnt_dg.c5
-rw-r--r--usr/src/lib/libnsl/rpc/clnt_vc.c3
-rw-r--r--usr/src/lib/libnsl/rpc/svc.c5
-rw-r--r--usr/src/lib/libnsl/rpc/svcauth_des.c3
-rw-r--r--usr/src/lib/libnsl/yp/yp_enum.c5
-rw-r--r--usr/src/lib/libnsl/yp/yp_master.c3
-rw-r--r--usr/src/lib/libnsl/yp/yp_match.c3
-rw-r--r--usr/src/lib/libscf/common/lowlevel.c3
-rw-r--r--usr/src/lib/libsqlite/src/test1.c46
-rw-r--r--usr/src/lib/libtecla/common/getline.c51
-rw-r--r--usr/src/lib/libumem/common/getpcstack.c3
-rw-r--r--usr/src/lib/libvolmgt/common/volmgt_on_private.c5
-rw-r--r--usr/src/lib/pam_modules/authtok_check/authtok_check.c5
-rw-r--r--usr/src/lib/pam_modules/sample/sample_acct_mgmt.c3
-rw-r--r--usr/src/lib/pam_modules/unix_account/unix_acct.c3
-rw-r--r--usr/src/lib/passwdutil/files_attr.c3
-rw-r--r--usr/src/lib/passwdutil/ldap_attr.c5
-rw-r--r--usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c5
-rw-r--r--usr/src/lib/sasl_plugins/digestmd5/digestmd5.c1015
-rw-r--r--usr/src/lib/smbsrv/libmlsvc/common/smb_logon.c3
-rw-r--r--usr/src/lib/smbsrv/libsmbns/common/smbns_netbios_name.c5
-rw-r--r--usr/src/lib/storage/liba5k/common/mon.c3
47 files changed, 724 insertions, 676 deletions
diff --git a/usr/src/lib/cfgadm_plugins/shp/common/shp.c b/usr/src/lib/cfgadm_plugins/shp/common/shp.c
index 882350e229..50d335a1bc 100644
--- a/usr/src/lib/cfgadm_plugins/shp/common/shp.c
+++ b/usr/src/lib/cfgadm_plugins/shp/common/shp.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
@@ -381,7 +382,7 @@ typedef struct error_sum_cb_arg {
/*
* Callback function for hp_traverse(), to add the error
- * message to he table.
+ * message to the table.
*/
static int
error_sumup_cb(hp_node_t node, void *arg)
diff --git a/usr/src/lib/gss_mechs/mech_dh/backend/mech/context.c b/usr/src/lib/gss_mechs/mech_dh/backend/mech/context.c
index d50eaec280..c1ae0008a5 100644
--- a/usr/src/lib/gss_mechs/mech_dh/backend/mech/context.c
+++ b/usr/src/lib/gss_mechs/mech_dh/backend/mech/context.c
@@ -22,6 +22,7 @@
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -301,7 +302,7 @@ _NOTE(ARGUNUSED(ctx))
if ((*minor = __get_sig_size(qop_req, &sigsize)) != DH_SUCCESS)
return (GSS_S_BAD_QOP | stat);
- /* Just return if we can't give the caller what he ask for. */
+ /* Just return if we can't give the caller what it asked for. */
if (stat)
return (stat);
diff --git a/usr/src/lib/gss_mechs/mech_dummy/mech/dmech.c b/usr/src/lib/gss_mechs/mech_dummy/mech/dmech.c
index 9decae6c43..f00e9e137f 100644
--- a/usr/src/lib/gss_mechs/mech_dummy/mech/dmech.c
+++ b/usr/src/lib/gss_mechs/mech_dummy/mech/dmech.c
@@ -22,6 +22,7 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*
* A module that implements a dummy security mechanism.
* It's mainly used to test GSS-API application. Multiple tokens
@@ -333,7 +334,7 @@ dummy_gss_init_sec_context(ct, minor_status, claimant_cred_handle,
* information to perform per-message
* processing. So if initiator previously
* returned GSS_S_COMPLETE, and acceptor
- * says he needs more, then we have
+ * says it needs more, then we have
* a problem.
*/
ctx->last_stat = GSS_S_FAILURE;
diff --git a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/sendauth.c b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/sendauth.c
index f3f51d32f6..ef3324a9d2 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/sendauth.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/sendauth.c
@@ -1,6 +1,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
@@ -14,7 +15,7 @@
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
- *
+ *
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
@@ -28,7 +29,7 @@
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
- *
+ *
*
* convenience sendauth/recvauth functions
*/
@@ -62,7 +63,7 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointe
* First, send over the length of the sendauth version string;
* then, we send over the sendauth version. Next, we send
* over the length of the application version strings followed
- * by the string itself.
+ * by the string itself.
*/
outbuf.length = strlen(sendauth_version) + 1;
outbuf.data = (char *) sendauth_version;
@@ -110,7 +111,7 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointe
&creds.server)))
goto error_return;
if (client)
- retval = krb5_copy_principal(context, client,
+ retval = krb5_copy_principal(context, client,
&creds.client);
else
retval = krb5_cc_get_principal(context, use_ccache,
@@ -147,14 +148,14 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointe
d.length = sizeof (rnd_data);
d.data = rnd_data;
len2 = sizeof (rnd_data);
- if (getpeername (*(int*)fd, (GETPEERNAME_ARG2_TYPE *) rnd_data,
+ if (getpeername (*(int*)fd, (GETPEERNAME_ARG2_TYPE *) rnd_data,
&len2) == 0) {
d.length = len2;
/* Solaris Kerberos */
(void) krb5_c_random_seed (context, &d);
}
len2 = sizeof (rnd_data);
- if (getsockname (*(int*)fd, (GETSOCKNAME_ARG2_TYPE *) rnd_data,
+ if (getsockname (*(int*)fd, (GETSOCKNAME_ARG2_TYPE *) rnd_data,
&len2) == 0) {
d.length = len2;
/* Solaris Kerberos */
@@ -199,7 +200,7 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointe
krb5_xfree(inbuf.data);
goto error_return;
}
-
+
/*
* If we asked for mutual authentication, we should now get a
* length field, followed by a AP_REP message
@@ -222,9 +223,9 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointe
krb5_xfree(inbuf.data);
/*
* If the user wants to look at the AP_REP message,
- * copy it for him
+ * copy it for them.
*/
- if (rep_result)
+ if (rep_result)
*rep_result = repl;
else
krb5_free_ap_rep_enc_part(context, repl);
@@ -238,7 +239,7 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointe
error_return:
krb5_free_cred_contents(context, &creds);
if (credspout != NULL)
- krb5_free_creds(context, credspout);
+ krb5_free_creds(context, credspout);
/* Solaris Kerberos */
if (!ccache && use_ccache)
(void) krb5_cc_close(context, use_ccache);
diff --git a/usr/src/lib/gss_mechs/mech_krb5/krb5/os/def_realm.c b/usr/src/lib/gss_mechs/mech_krb5/krb5/os/def_realm.c
index c4034223e8..7f4cb2f386 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/krb5/os/def_realm.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/krb5/os/def_realm.c
@@ -8,7 +8,7 @@
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
- *
+ *
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
@@ -22,7 +22,7 @@
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
- *
+ *
*
* krb5_get_default_realm(), krb5_set_default_realm(),
* krb5_free_default_realm() functions.
@@ -33,19 +33,20 @@
* Use is subject to license terms.
*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include "k5-int.h"
#include "os-proto.h"
#include <stdio.h>
-/*
+/*
* Solaris Kerberos:
* For krb5int_foreach_localaddr()
*/
#include "foreachaddr.h"
-#ifdef KRB5_DNS_LOOKUP
+#ifdef KRB5_DNS_LOOKUP
#ifdef WSHELPER
#include <wshelper.h>
#else /* WSHELPER */
@@ -81,7 +82,7 @@ extern struct hostent *res_gethostbyaddr(const char *addr, int len, int type);
* used as a callback for krb5int_foreach_localaddr().
*/
static int krb5int_address_get_realm(void *data, struct sockaddr *addr) {
-
+
krb5_context context = data;
struct hostent *he = NULL;
@@ -104,7 +105,7 @@ static int krb5int_address_get_realm(void *data, struct sockaddr *addr) {
/* If a realm was found return 1 to immediately halt
* krb5int_foreach_localaddr()
- */
+ */
if (context->default_realm != 0) {
return (1);
}
@@ -117,7 +118,7 @@ static int krb5int_address_get_realm(void *data, struct sockaddr *addr) {
* Retrieves the default realm to be used if no user-specified realm is
* available. [e.g. to interpret a user-typed principal name with the
* realm omitted for convenience]
- *
+ *
* returns system errors, NOT_ENOUGH_SPACE, KV5M_CONTEXT
*/
@@ -137,7 +138,7 @@ krb5_get_default_realm(krb5_context context, char **lrealm)
(void) memset(localhost, 0, sizeof(localhost));
- if (!context || (context->magic != KV5M_CONTEXT))
+ if (!context || (context->magic != KV5M_CONTEXT))
return KV5M_CONTEXT;
/*
@@ -187,7 +188,7 @@ krb5_get_default_realm(krb5_context context, char **lrealm)
if ( localhost[0] ) {
p = localhost;
do {
- retval = krb5_try_realm_txt_rr("_kerberos", p,
+ retval = krb5_try_realm_txt_rr("_kerberos", p,
&context->default_realm);
p = strchr(p,'.');
if (p)
@@ -195,10 +196,10 @@ krb5_get_default_realm(krb5_context context, char **lrealm)
} while (retval && p && p[0]);
if (retval)
- retval = krb5_try_realm_txt_rr("_kerberos", "",
+ retval = krb5_try_realm_txt_rr("_kerberos", "",
&context->default_realm);
} else {
- retval = krb5_try_realm_txt_rr("_kerberos", "",
+ retval = krb5_try_realm_txt_rr("_kerberos", "",
&context->default_realm);
}
if (retval) {
@@ -231,7 +232,7 @@ krb5_get_default_realm(krb5_context context, char **lrealm)
if (res_ninit(&res) == 0) {
for (i = 0; res.dnsrch[i]; i++) {
krb5int_domain_get_realm(context,
- res.dnsrch[i], &context->default_realm);
+ res.dnsrch[i], &context->default_realm);
if (context->default_realm != 0)
break;
@@ -253,7 +254,7 @@ krb5_get_default_realm(krb5_context context, char **lrealm)
}
realm = context->default_realm;
-
+
/*LINTED*/
if (!(*lrealm = cp = malloc((unsigned int) strlen(realm) + 1)))
return ENOMEM;
@@ -264,7 +265,7 @@ krb5_get_default_realm(krb5_context context, char **lrealm)
krb5_error_code KRB5_CALLCONV
krb5_set_default_realm(krb5_context context, const char *lrealm)
{
- if (!context || (context->magic != KV5M_CONTEXT))
+ if (!context || (context->magic != KV5M_CONTEXT))
return KV5M_CONTEXT;
if (context->default_realm) {
@@ -272,7 +273,7 @@ krb5_set_default_realm(krb5_context context, const char *lrealm)
context->default_realm = 0;
}
- /* Allow the user to clear the default realm setting by passing in
+ /* Allow the user to clear the default realm setting by passing in
NULL */
if (!lrealm) return 0;
diff --git a/usr/src/lib/gss_mechs/mech_krb5/krb5/os/kuserok.c b/usr/src/lib/gss_mechs/mech_krb5/krb5/os/kuserok.c
index b9da89278f..ca80a0fc0c 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/krb5/os/kuserok.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/krb5/os/kuserok.c
@@ -1,6 +1,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
@@ -14,7 +15,7 @@
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
- *
+ *
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
@@ -28,7 +29,7 @@
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
- *
+ *
*
* krb5_kuserok()
*/
@@ -288,8 +289,8 @@ krb5_kuserok(krb5_context context, krb5_principal principal, const char *luser)
if (access(pbuf, F_OK)) { /* not accessible */
/*
- * if he's trying to log in as himself, and there is no .k5login file,
- * let him. First, have krb5 check it's rules. If no success,
+ * if they're trying to log in as themself, and there is no .k5login file,
+ * let them. First, have krb5 check it's rules. If no success,
* search the gsscred table (the sequence here should be consistent
* with the uid mappings done for gssd).
*/
@@ -385,10 +386,10 @@ krb5_gss_userok(OM_uint32 *minor,
*user_ok = 0;
- kret = krb5_gss_init_context(&ctxt);
- if (kret) {
- *minor = kret;
- return (GSS_S_FAILURE);
+ kret = krb5_gss_init_context(&ctxt);
+ if (kret) {
+ *minor = kret;
+ return (GSS_S_FAILURE);
}
if (! kg_validate_name(pname)) {
diff --git a/usr/src/lib/krb5/dyn/dyn_delete.c b/usr/src/lib/krb5/dyn/dyn_delete.c
index 7213bef887..7cb8c750ff 100644
--- a/usr/src/lib/krb5/dyn/dyn_delete.c
+++ b/usr/src/lib/krb5/dyn/dyn_delete.c
@@ -10,6 +10,7 @@
*
* Written by Barr3y Jaspan, Student Information Processing Board (SIPB)
* and MIT-Project Athena, 1989.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <stdio.h>
@@ -21,7 +22,7 @@
/*
* Checkers! Get away from that "hard disk erase" button!
* (Stupid dog. He almost did it to me again ...)
- */
+ */
int DynDelete(obj, idx)
DynObjectP obj;
int idx;
@@ -31,7 +32,7 @@ int DynDelete(obj, idx)
fprintf(stderr, "dyn: delete: bad index %d\n", idx);
return DYN_BADINDEX;
}
-
+
if (idx >= obj->num_el) {
if (obj->debug)
fprintf(stderr, "dyn: delete: Highest index is %d.\n",
@@ -49,14 +50,14 @@ int DynDelete(obj, idx)
if (obj->debug)
fprintf(stderr, "dyn: delete: last element, punting.\n");
}
- }
+ }
else {
if (obj->debug)
fprintf(stderr,
"dyn: delete: copying %d bytes from %d + %d to + %d.\n",
obj->el_size*(obj->num_el - idx), obj->array,
(idx+1)*obj->el_size, idx*obj->el_size);
-
+
#ifdef HAVE_MEMMOVE
memmove(obj->array + idx*obj->el_size,
obj->array + (idx+1)*obj->el_size,
@@ -76,9 +77,9 @@ int DynDelete(obj, idx)
obj->el_size);
}
}
-
+
--obj->num_el;
-
+
if (obj->debug)
fprintf(stderr, "dyn: delete: done.\n");
diff --git a/usr/src/lib/libbc/libc/gen/common/ndbm.c b/usr/src/lib/libbc/libc/gen/common/ndbm.c
index a62037d54d..b8315bdc7a 100644
--- a/usr/src/lib/libbc/libc/gen/common/ndbm.c
+++ b/usr/src/lib/libbc/libc/gen/common/ndbm.c
@@ -1,6 +1,7 @@
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
@@ -307,7 +308,7 @@ split:
return (-1);
}
dbm_clrdirty(db); /*clear dirty*/
- (void) lseek(db->dbm_pagf,
+ (void) lseek(db->dbm_pagf,
(long)((db->dbm_blkno+db->dbm_hmask+1)*PBLKSIZ), L_SET);
if (write(db->dbm_pagf, ovfbuf, PBLKSIZ) != PBLKSIZ) {
db->dbm_flags |= _DBM_IOERR;
@@ -494,7 +495,7 @@ dbm_do_nextkey(DBM *db, datum inkey)
else key=nullkey;
/* the keyptr pagbuf have failed us, the user must
- be an extra clever moron who depends on
+ be an extra clever moron who depends on
these variables and their former meaning.
If we set the variables this would have got
us the key for sure! So give him the old algorithm.*/
@@ -517,7 +518,7 @@ dbm_do_nextkey(DBM *db, datum inkey)
item.dsize = 0;
break; /*from below*/
}
- else {
+ else {
if (i > 0) item.dsize = sp[i] - sp[i+1];
else item.dsize = PBLKSIZ - sp[i+1];
item.dptr = db->dbm_pagbuf+sp[i+1];
@@ -541,7 +542,7 @@ dbm_do_nextkey(DBM *db, datum inkey)
p2 = item.dptr;
do
if(*p1++ != *p2++)
- if((*--p1 - *--p2) > 0) goto keep_going;
+ if((*--p1 - *--p2) > 0) goto keep_going;
else continue;
while(--n);
continue;
@@ -554,7 +555,7 @@ keep_going:
continue;*/
if (f) {
bitem = item;
- j=i;
+ j=i;
f = 0;
}
else {
@@ -566,7 +567,7 @@ keep_going:
{
if((n - item.dsize) <0) {
bitem = item;
- j=i;
+ j=i;
}
}
else if (n != 0) {
@@ -576,7 +577,7 @@ keep_going:
if(*p1++ != *p2++) {
if((*--p1 - *--p2) <0) {
bitem = item;
- j=i;
+ j=i;
}
break;
}
@@ -591,9 +592,9 @@ keep_going:
return (bitem);
}
- /*really need hash at this point*/
- /*if he gave us a key we have already calculated the hash*/
- /*if not get it*/
+ /* really need hash at this point */
+ /* if it gave us a key we have already calculated the hash */
+ /* if not get the hash */
if (inkey.dptr == NULL) hash=dcalchash(key);
hash = dbm_hashinc(db,hash);
@@ -662,12 +663,12 @@ dbm_access(DBM *db, long hash)
}
}
-static int
+static int
getbit(DBM *db)
{
long bn;
int b, i, n;
-
+
if (db->dbm_bitno > db->dbm_maxbno)
return (0);
diff --git a/usr/src/lib/libbsm/common/audit_crontab.c b/usr/src/lib/libbsm/common/audit_crontab.c
index 65b8b938bb..4c162c4060 100644
--- a/usr/src/lib/libbsm/common/audit_crontab.c
+++ b/usr/src/lib/libbsm/common/audit_crontab.c
@@ -22,6 +22,7 @@
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -269,7 +270,7 @@ audit_crontab_not_allowed(uid_t ruid, char *user) {
if (getpwnam_r(user, &pwd, buffer, PWD_BUFFER_SIZE) == NULL) {
rc = 1; /* deny access if invalid */
} else if (ruid == pwd.pw_uid)
- rc = 0; /* editing his own crontab */
+ rc = 0; /* editing their own crontab */
else
rc = audit_crontab_process_not_audited();
}
diff --git a/usr/src/lib/libc/port/gen/daemon.c b/usr/src/lib/libc/port/gen/daemon.c
index f1e6926c91..ed7db080c4 100644
--- a/usr/src/lib/libc/port/gen/daemon.c
+++ b/usr/src/lib/libc/port/gen/daemon.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include "lint.h"
@@ -79,7 +80,7 @@ daemon(int nochdir, int noclose)
/*
* Also, if any of the descriptor redirects fails we should
- * return with error to signal to the caller that his request
+ * return with error to signal to the caller that its request
* cannot be fulfilled properly. It is up to the caller to
* do the cleanup.
*/
diff --git a/usr/src/lib/libc/port/gen/getgrnam_r.c b/usr/src/lib/libc/port/gen/getgrnam_r.c
index 4761b77724..981125c3bc 100644
--- a/usr/src/lib/libc/port/gen/getgrnam_r.c
+++ b/usr/src/lib/libc/port/gen/getgrnam_r.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include "lint.h"
@@ -204,7 +205,7 @@ fgetgrent_r(FILE *f, struct group *result, char *buffer, int buflen)
extern void _nss_XbyY_fgets(FILE *, nss_XbyY_args_t *);
nss_XbyY_args_t arg;
- /* ... but in fgetXXent_r, the caller deserves any +/- entry he gets */
+ /* ... but in fgetXXent_r, the caller deserves any +/- entry it gets */
/* No key to fill in */
NSS_XbyY_INIT(&arg, result, buffer, buflen, str2group);
diff --git a/usr/src/lib/libc/port/gen/getpwnam_r.c b/usr/src/lib/libc/port/gen/getpwnam_r.c
index b8a87e98a6..a1dc20cb36 100644
--- a/usr/src/lib/libc/port/gen/getpwnam_r.c
+++ b/usr/src/lib/libc/port/gen/getpwnam_r.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include "lint.h"
@@ -201,7 +202,7 @@ fgetpwent_r(FILE *f, struct passwd *result, char *buffer, int buflen)
extern void _nss_XbyY_fgets(FILE *, nss_XbyY_args_t *);
nss_XbyY_args_t arg;
- /* ... but in fgetXXent_r, the caller deserves any +/- entry he gets */
+ /* ... but in fgetXXent_r, the caller deserves any +/- entry it gets */
/* No key to fill in */
NSS_XbyY_INIT(&arg, result, buffer, buflen, str2passwd);
diff --git a/usr/src/lib/libc/port/gen/getspent_r.c b/usr/src/lib/libc/port/gen/getspent_r.c
index d1edf7e9be..ae45338b8b 100644
--- a/usr/src/lib/libc/port/gen/getspent_r.c
+++ b/usr/src/lib/libc/port/gen/getspent_r.c
@@ -22,6 +22,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -100,7 +101,7 @@ fgetspent_r(FILE *f, struct spwd *result, char *buffer, int buflen)
extern void _nss_XbyY_fgets(FILE *, nss_XbyY_args_t *);
nss_XbyY_args_t arg;
- /* ... but in fgetXXent_r, the caller deserves any +/- entry he gets */
+ /* ... but in fgetXXent_r, the caller deserves any +/- entry it gets */
/* No key to fill in */
NSS_XbyY_INIT(&arg, result, buffer, buflen, str2spwd);
diff --git a/usr/src/lib/libc/port/gen/ndbm.c b/usr/src/lib/libc/port/gen/ndbm.c
index f16af50dee..f1fb3603be 100644
--- a/usr/src/lib/libc/port/gen/ndbm.c
+++ b/usr/src/lib/libc/port/gen/ndbm.c
@@ -22,6 +22,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -599,7 +600,7 @@ dbm_do_nextkey(DBM *db, datum inkey)
* be an extra clever moron who depends on
* these variables and their former meaning.
* If we set the variables this would have got
- * us the key for sure! So give him the old algorithm.
+ * us the key for sure! So give it the old algorithm.
*/
if (key.dptr == NULL)
return (dbm_slow_nextkey(db));
@@ -699,8 +700,8 @@ keep_going:
}
/* really need hash at this point */
- /* if he gave us a key we have already calculated the hash */
- /* if not get it */
+ /* if it gave us a key we have already calculated the hash */
+ /* if not get the hash */
if (inkey.dptr == NULL)
hash = dcalchash(key);
hash = dbm_hashinc(db, hash);
diff --git a/usr/src/lib/libc/port/locale/engine.c b/usr/src/lib/libc/port/locale/engine.c
index 9d9f33cd3f..8dab65c5b4 100644
--- a/usr/src/lib/libc/port/locale/engine.c
+++ b/usr/src/lib/libc/port/locale/engine.c
@@ -1,6 +1,7 @@
/*
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
* Copyright (c) 1992, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -281,7 +282,7 @@ matcher(struct re_guts *g,
if (nmatch == 1 && !g->backrefs)
break; /* no further info needed */
- /* oh my, he wants the subexpressions... */
+ /* oh my, it wants the subexpressions... */
if (m->pmatch == NULL)
m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) *
sizeof (regmatch_t));
diff --git a/usr/src/lib/libc/port/threads/rwlock.c b/usr/src/lib/libc/port/threads/rwlock.c
index a8f9caff18..9654b7daaf 100644
--- a/usr/src/lib/libc/port/threads/rwlock.c
+++ b/usr/src/lib/libc/port/threads/rwlock.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include "lint.h"
@@ -620,7 +621,7 @@ rwlock_lock(rwlock_t *rwlp, timespec_t *tsp, int rd_wr)
/*
* Do a priority check on the queued waiter (the
* highest priority thread on the queue) to see
- * if we should defer to him or just grab the lock.
+ * if we should defer to it or just grab the lock.
*/
int our_pri = real_priority(self);
int his_pri = real_priority(ulwp);
diff --git a/usr/src/lib/libc/port/threads/synch.c b/usr/src/lib/libc/port/threads/synch.c
index b4efb58d17..3ec76f7c21 100644
--- a/usr/src/lib/libc/port/threads/synch.c
+++ b/usr/src/lib/libc/port/threads/synch.c
@@ -23,6 +23,7 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2015, Joyent, Inc.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include "lint.h"
@@ -3717,11 +3718,11 @@ cond_signal(cond_t *cvp)
return (error);
/*
- * Move someone from the condvar sleep queue to the mutex sleep
- * queue for the mutex that he will acquire on being waked up.
- * We can do this only if we own the mutex he will acquire.
- * If we do not own the mutex, or if his ul_cv_wake flag
- * is set, just dequeue and unpark him.
+ * Move some thread from the condvar sleep queue to the mutex sleep
+ * queue for the mutex that it will acquire on being waked up.
+ * We can do this only if we own the mutex it will acquire.
+ * If we do not own the mutex, or if its ul_cv_wake flag
+ * is set, just dequeue and unpark it.
*/
qp = queue_lock(cvp, CV);
ulwpp = queue_slot(qp, &prev, &more);
@@ -3733,26 +3734,26 @@ cond_signal(cond_t *cvp)
ulwp = *ulwpp;
/*
- * Inform the thread that he was the recipient of a cond_signal().
- * This lets him deal with cond_signal() and, concurrently,
+ * Inform the thread that it was the recipient of a cond_signal().
+ * This lets it deal with cond_signal() and, concurrently,
* one or more of a cancellation, a UNIX signal, or a timeout.
* These latter conditions must not consume a cond_signal().
*/
ulwp->ul_signalled = 1;
/*
- * Dequeue the waiter but leave his ul_sleepq non-NULL
- * while we move him to the mutex queue so that he can
+ * Dequeue the waiter but leave its ul_sleepq non-NULL
+ * while we move it to the mutex queue so that it can
* deal properly with spurious wakeups.
*/
queue_unlink(qp, ulwpp, prev);
- mp = ulwp->ul_cvmutex; /* the mutex he will acquire */
+ mp = ulwp->ul_cvmutex; /* the mutex it will acquire */
ulwp->ul_cvmutex = NULL;
ASSERT(mp != NULL);
if (ulwp->ul_cv_wake || !MUTEX_OWNED(mp, self)) {
- /* just wake him up */
+ /* just wake it up */
lwpid = ulwp->ul_lwpid;
no_preempt(self);
ulwp->ul_sleepq = NULL;
@@ -3761,7 +3762,7 @@ cond_signal(cond_t *cvp)
(void) __lwp_unpark(lwpid);
preempt(self);
} else {
- /* move him to the mutex queue */
+ /* move it to the mutex queue */
mqp = queue_lock(mp, MX);
enqueue(mqp, ulwp, 0);
mp->mutex_waiters = 1;
@@ -3876,18 +3877,18 @@ cond_broadcast(cond_t *cvp)
break;
ASSERT(ulwp->ul_wchan == cvp);
queue_unlink(qp, &qrp->qr_head, NULL);
- mp = ulwp->ul_cvmutex; /* his mutex */
+ mp = ulwp->ul_cvmutex; /* its mutex */
ulwp->ul_cvmutex = NULL;
ASSERT(mp != NULL);
if (ulwp->ul_cv_wake || !MUTEX_OWNED(mp, self)) {
- /* just wake him up */
+ /* just wake it up */
ulwp->ul_sleepq = NULL;
ulwp->ul_wchan = NULL;
if (nlwpid == maxlwps)
lwpid = alloc_lwpids(lwpid, &nlwpid, &maxlwps);
lwpid[nlwpid++] = ulwp->ul_lwpid;
} else {
- /* move him to the mutex queue */
+ /* move it to the mutex queue */
if (mp != mp_cache) {
mp_cache = mp;
if (mqp != NULL)
diff --git a/usr/src/lib/libc/port/threads/thr.c b/usr/src/lib/libc/port/threads/thr.c
index 88ce377f21..116bb61125 100644
--- a/usr/src/lib/libc/port/threads/thr.c
+++ b/usr/src/lib/libc/port/threads/thr.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
* Copyright 2016 Joyent, Inc.
@@ -1786,17 +1787,17 @@ force_continue(ulwp_t *ulwp)
if (error != 0 && error != EINTR)
break;
error = 0;
- if (ulwp->ul_stopping) { /* he is stopping himself */
- ts.tv_sec = 0; /* give him a chance to run */
+ if (ulwp->ul_stopping) { /* it is stopping itsself */
+ ts.tv_sec = 0; /* give it a chance to run */
ts.tv_nsec = 100000; /* 100 usecs or clock tick */
(void) __nanosleep(&ts, NULL);
}
- if (!ulwp->ul_stopping) /* he is running now */
+ if (!ulwp->ul_stopping) /* it is running now */
break; /* so we are done */
/*
- * He is marked as being in the process of stopping
- * himself. Loop around and continue him again.
- * He may not have been stopped the first time.
+ * It is marked as being in the process of stopping
+ * itself. Loop around and continue it again.
+ * It may not have been stopped the first time.
*/
}
}
@@ -2480,7 +2481,7 @@ getlwpstatus(thread_t tid, struct lwpstatus *sp)
(void) __close(fd);
return (0);
}
- yield(); /* give him a chance to stop */
+ yield(); /* give it a chance to stop */
}
(void) __close(fd);
}
diff --git a/usr/src/lib/libcpc/common/libcpc.c b/usr/src/lib/libcpc/common/libcpc.c
index 9f4f6ac848..de6c13d33c 100644
--- a/usr/src/lib/libcpc/common/libcpc.c
+++ b/usr/src/lib/libcpc/common/libcpc.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <libcpc.h>
@@ -44,7 +45,7 @@
/*
* The library uses the cpc_lock field of the cpc_t struct to protect access to
* the linked lists inside the cpc_t, and only the linked lists. It is NOT used
- * to protect against a user shooting his/herself in the foot (such as, for
+ * to protect against users shooting themselves in the foot (such as, for
* instance, destroying the same set at the same time from different threads.).
*
* SIGEMT needs to be blocked while holding the lock, to prevent deadlock among
diff --git a/usr/src/lib/libcurses/screen/tputs.c b/usr/src/lib/libcurses/screen/tputs.c
index f16ad967a5..c364dbdb09 100644
--- a/usr/src/lib/libcurses/screen/tputs.c
+++ b/usr/src/lib/libcurses/screen/tputs.c
@@ -22,6 +22,7 @@
/*
* Copyright 1997 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* Copyright (c) 1988 AT&T */
@@ -62,7 +63,7 @@ _tpad(char *cp, int affcnt, int (*outc)(char x))
* in their terminfo entries, as that would break compatibility.
* We therefore, do it here.
*
- * When compatibility is to be broken, his will go away
+ * When compatibility is to be broken, it will go away
* and users will be informed that they MUST use mandatory
* padding for flash and bell.
*/
diff --git a/usr/src/lib/libdevinfo/devinfo_devlink.c b/usr/src/lib/libdevinfo/devinfo_devlink.c
index 9fbbdc7533..8d4d0ed709 100644
--- a/usr/src/lib/libdevinfo/devinfo_devlink.c
+++ b/usr/src/lib/libdevinfo/devinfo_devlink.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include "libdevinfo.h"
@@ -2000,7 +2001,7 @@ devlink_snapshot(const char *root_dir)
/*
* We don't need to lock. If a consumer wants the very latest db
- * then he must perform a di_devlink_init with the DI_MAKE_LINK
+ * then it must perform a di_devlink_init with the DI_MAKE_LINK
* flag to force a sync with devfsadm first. Otherwise, the
* current database file is opened and mmaped on demand: the rename
* associated with a db update does not change the contents
diff --git a/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.c b/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.c
index c27b738b29..a70eb2bbdc 100644
--- a/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.c
+++ b/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.c
@@ -22,6 +22,9 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2016 by Delphix. All rights reserved.
+ */
#include <string.h>
#include <unistd.h>
@@ -266,7 +269,7 @@ dhcp_ipc_recv_reply(int fd, dhcp_ipc_reply_t **reply, int32_t timeout)
{
/*
* If the caller doesn't want to wait forever, and the amount of time
- * he wants to wait is expressible as an integer number of milliseconds
+ * it wants to wait is expressible as an integer number of milliseconds
* (as needed by the msg function), then we wait that amount of time
* plus an extra two seconds for the daemon to do its work. The extra
* two seconds is arbitrary; it should allow plenty of time for the
diff --git a/usr/src/lib/libdhcputil/common/dhcp_inittab.c b/usr/src/lib/libdhcputil/common/dhcp_inittab.c
index 70db0fe59a..ddaf9d7ab9 100644
--- a/usr/src/lib/libdhcputil/common/dhcp_inittab.c
+++ b/usr/src/lib/libdhcputil/common/dhcp_inittab.c
@@ -21,6 +21,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <sys/types.h>
@@ -690,7 +691,7 @@ inittab_encode_e(const dhcp_symbol_t *ie, const char *value, uint16_t *lengthp,
/*
* User terminated \D or \DD
* with non-digit. An error,
- * but we can assume he means
+ * but we can assume they mean
* to treat as \00D or \0DD.
*/
*optstart++ = val;
diff --git a/usr/src/lib/libnisdb/db_table.cc b/usr/src/lib/libnisdb/db_table.cc
index f4eb620237..e68ea87d9a 100644
--- a/usr/src/lib/libnisdb/db_table.cc
+++ b/usr/src/lib/libnisdb/db_table.cc
@@ -26,6 +26,7 @@
* Use is subject to license terms.
*
* Copyright 2015 RackTop Systems.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <stdio.h>
@@ -192,7 +193,7 @@ db_free_list::push(entryp tabloc)
* n1 is the number of entries that should be in the freelist.
* n2 is the number of entries actually found in the freelist.
* [loc1...locn] are the entries. n2 <= n1 because we never count beyond n1.
- * It is up to the caller to free the returned vector when he is through.
+ * It is up to the caller to free the returned vector when it is through.
*/
long *
db_free_list::stats(int nslots)
@@ -738,7 +739,7 @@ db_table::delete_entry(entryp where)
/*
* Returns statistics of table.
* [vector_size][table_size][last_used][count][freelist].
- * It is up to the caller to free the returned vector when his is through.
+ * It is up to the caller to free the returned vector when it is through.
* The free list is included if 'fl' is TRUE.
*/
long *
diff --git a/usr/src/lib/libnsl/nss/netdir_inet_sundry.c b/usr/src/lib/libnsl/nss/netdir_inet_sundry.c
index 4e9473a8cf..c8d230d3d3 100644
--- a/usr/src/lib/libnsl/nss/netdir_inet_sundry.c
+++ b/usr/src/lib/libnsl/nss/netdir_inet_sundry.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*
* lib/libnsl/nss/netdir_inet_sundry.c
*
@@ -960,7 +961,7 @@ bindresvport(struct netconfig *nconf, int fd, struct netbuf *addr)
return (-1);
}
- tbindstr.qlen = 0; /* Always 0; user should change if he wants to */
+ tbindstr.qlen = 0; /* Always 0; user should change if they want to */
tbindstr.addr.buf = (char *)u.buf;
tbindstr.addr.len = tbindstr.addr.maxlen = __rpc_get_a_size(tinfo.addr);
diff --git a/usr/src/lib/libnsl/rpc/clnt_dg.c b/usr/src/lib/libnsl/rpc/clnt_dg.c
index c3299cb42d..df2c7f3f49 100644
--- a/usr/src/lib/libnsl/rpc/clnt_dg.c
+++ b/usr/src/lib/libnsl/rpc/clnt_dg.c
@@ -26,6 +26,7 @@
*/
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -229,7 +230,7 @@ clnt_dg_create(const int fd, struct netbuf *svcaddr, const rpcprog_t program,
/*
* By default, closeit is always FALSE. It is users responsibility
* to do a t_close on it, else the user may use clnt_control
- * to let clnt_destroy do it for him/her.
+ * to let clnt_destroy do it for them.
*/
cu->cu_closeit = FALSE;
cu->cu_fd = fd;
@@ -751,7 +752,7 @@ clnt_dg_control(CLIENT *cl, int request, char *info)
/* LINTED pointer alignment */
*(struct timeval *)info = cu->cu_total;
break;
- case CLGET_SERVER_ADDR: /* Give him the fd address */
+ case CLGET_SERVER_ADDR: /* Give it the fd address */
/* Now obsolete. Only for backword compatibility */
(void) memcpy(info, cu->cu_raddr.buf, (size_t)cu->cu_raddr.len);
break;
diff --git a/usr/src/lib/libnsl/rpc/clnt_vc.c b/usr/src/lib/libnsl/rpc/clnt_vc.c
index 4ab501046d..77c6d0b290 100644
--- a/usr/src/lib/libnsl/rpc/clnt_vc.c
+++ b/usr/src/lib/libnsl/rpc/clnt_vc.c
@@ -21,6 +21,7 @@
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
@@ -310,7 +311,7 @@ _clnt_vc_create_timed(int fd, struct netbuf *svcaddr, rpcprog_t prog,
/*
* By default, closeit is always FALSE. It is users responsibility
* to do a t_close on it, else the user may use clnt_control
- * to let clnt_destroy do it for him/her.
+ * to let clnt_destroy do it for them.
*/
ct->ct_closeit = FALSE;
diff --git a/usr/src/lib/libnsl/rpc/svc.c b/usr/src/lib/libnsl/rpc/svc.c
index 113c76ae39..7c4a8a6342 100644
--- a/usr/src/lib/libnsl/rpc/svc.c
+++ b/usr/src/lib/libnsl/rpc/svc.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
* Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved.
@@ -886,7 +887,7 @@ svc_reg(const SVCXPRT *xprt, const rpcprog_t prog, const rpcvers_t vers,
if (netid)
free(netid);
if (s->sc_dispatch == dispatch)
- goto rpcb_it; /* he is registering another xptr */
+ goto rpcb_it; /* it is registering another xptr */
(void) rw_unlock(&svc_lock);
return (FALSE);
}
@@ -995,7 +996,7 @@ svc_register(SVCXPRT *xprt, rpcprog_t prog, rpcvers_t vers,
if (netid)
free(netid);
if (s->sc_dispatch == dispatch)
- goto pmap_it; /* he is registering another xptr */
+ goto pmap_it; /* it is registering another xptr */
(void) rw_unlock(&svc_lock);
return (FALSE);
}
diff --git a/usr/src/lib/libnsl/rpc/svcauth_des.c b/usr/src/lib/libnsl/rpc/svcauth_des.c
index fd0b9abbb5..b8e6fd31e9 100644
--- a/usr/src/lib/libnsl/rpc/svcauth_des.c
+++ b/usr/src/lib/libnsl/rpc/svcauth_des.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
@@ -208,7 +209,7 @@ again:
if (!__getpublickey_cached(cred->adc_fullname.name,
pkey_data, &from_cache)) {
/*
- * if the user has no public key, treat him as the
+ * if the user has no public key, treat them as the
* unauthenticated identity - nobody. If this
* works, it means the client didn't find the
* user's keys and used nobody's secret key
diff --git a/usr/src/lib/libnsl/yp/yp_enum.c b/usr/src/lib/libnsl/yp/yp_enum.c
index f9d57e086c..48f265303c 100644
--- a/usr/src/lib/libnsl/yp/yp_enum.c
+++ b/usr/src/lib/libnsl/yp/yp_enum.c
@@ -23,6 +23,7 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -176,7 +177,7 @@ dofirst(domain, map, pdomb, timeout, key, keylen, val, vallen)
retval = ypprot_err(resp.status);
}
- /* Get some memory which the user can get rid of as he likes */
+ /* Get some memory which the user can get rid of as they like */
if (!retval) {
@@ -349,7 +350,7 @@ donext(domain, map, inkey, inkeylen, pdomb, timeout, outkey, outkeylen,
retval = ypprot_err(resp.status);
}
- /* Get some memory which the user can get rid of as he likes */
+ /* Get some memory which the user can get rid of as they like */
if (!retval) {
if ((*outkey = malloc((size_t)
diff --git a/usr/src/lib/libnsl/yp/yp_master.c b/usr/src/lib/libnsl/yp/yp_master.c
index 287bb13e75..41f3ec02f3 100644
--- a/usr/src/lib/libnsl/yp/yp_master.c
+++ b/usr/src/lib/libnsl/yp/yp_master.c
@@ -23,6 +23,7 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -201,7 +202,7 @@ domaster(char *domain, char *map, struct dom_binding *pdomb,
if (resp.status != YP_TRUE)
retval = ypprot_err(resp.status);
- /* Get some memory which the user can get rid of as he likes */
+ /* Get some memory which the user can get rid of as they like */
if (!retval && ((*master = malloc(strlen(resp.master) + 1)) == NULL))
retval = YPERR_RESRC;
diff --git a/usr/src/lib/libnsl/yp/yp_match.c b/usr/src/lib/libnsl/yp/yp_match.c
index 9e26615932..780610a2eb 100644
--- a/usr/src/lib/libnsl/yp/yp_match.c
+++ b/usr/src/lib/libnsl/yp/yp_match.c
@@ -23,6 +23,7 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -543,7 +544,7 @@ domatch(char *domain, char *map, char *key, int keylen,
retval = ypprot_err(resp.status);
}
- /* Get some memory which the user can get rid of as he likes */
+ /* Get some memory which the user can get rid of as they likes */
if (!retval && ((*val = malloc((size_t)
resp.valdat.dsize + 2)) == NULL)) {
diff --git a/usr/src/lib/libscf/common/lowlevel.c b/usr/src/lib/libscf/common/lowlevel.c
index a348f50db0..eb0d29b236 100644
--- a/usr/src/lib/libscf/common/lowlevel.c
+++ b/usr/src/lib/libscf/common/lowlevel.c
@@ -23,6 +23,7 @@
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013, Joyent, Inc. All rights reserved.
* Copyright 2016 RackTop Systems.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
@@ -110,7 +111,7 @@ static void scf_value_reset_locked(scf_value_t *val, int and_destroy);
/*
* Hold and release subhandles. We only allow one thread access to the
- * subhandles at a time, and he can use any subset, grabbing and releasing
+ * subhandles at a time, and it can use any subset, grabbing and releasing
* them in any order. The only restrictions are that you cannot hold an
* already-held subhandle, and all subhandles must be released before
* returning to the original caller.
diff --git a/usr/src/lib/libsqlite/src/test1.c b/usr/src/lib/libsqlite/src/test1.c
index 6434d90500..790b123023 100644
--- a/usr/src/lib/libsqlite/src/test1.c
+++ b/usr/src/lib/libsqlite/src/test1.c
@@ -34,7 +34,7 @@
** Decode a pointer to an sqlite object.
*/
static int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite **ppDb){
- if( sscanf(zA, PTR_FMT, (void**)ppDb)!=1 &&
+ if( sscanf(zA, PTR_FMT, (void**)ppDb)!=1 &&
(zA[0]!='0' || zA[1]!='x' || sscanf(&zA[2], PTR_FMT, (void**)ppDb)!=1)
){
Tcl_AppendResult(interp, "\"", zA, "\" is not a valid pointer value", 0);
@@ -62,7 +62,7 @@ static int getVmPointer(Tcl_Interp *interp, const char *zArg, sqlite_vm **ppVm){
** "%p" you cannot turn around and do a scanf with the same "%p" and
** get your pointer back. You have to prepend a "0x" before it will
** work. Or at least that is what is reported to me (drh). But this
-** behavior varies from machine to machine. The solution used her is
+** behavior varies from machine to machine. The solution used here is
** to test the string right after it is generated to see if it can be
** understood by scanf, and if not, try prepending an "0x" to see if
** that helps. If nothing works, a fatal error is generated.
@@ -151,7 +151,7 @@ static int test_exec_printf(
char *zErr = 0;
char zBuf[30];
if( argc!=4 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" DB FORMAT STRING", 0);
return TCL_ERROR;
}
@@ -169,7 +169,7 @@ static int test_exec_printf(
/*
** Usage: sqlite_mprintf_z_test SEPARATOR ARG0 ARG1 ...
**
-** Test the %z format of mprintf(). Use multiple mprintf() calls to
+** Test the %z format of mprintf(). Use multiple mprintf() calls to
** concatenate arg0 through argn using separator as the separator.
** Return the result.
*/
@@ -212,13 +212,13 @@ static int test_get_table_printf(
int i;
char zBuf[30];
if( argc!=4 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" DB FORMAT STRING", 0);
return TCL_ERROR;
}
if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
Tcl_DStringInit(&str);
- rc = sqlite_get_table_printf(db, argv[2], &aResult, &nRow, &nCol,
+ rc = sqlite_get_table_printf(db, argv[2], &aResult, &nRow, &nCol,
&zErr, argv[3]);
sprintf(zBuf, "%d", rc);
Tcl_AppendElement(interp, zBuf);
@@ -353,15 +353,15 @@ static int execFuncCallback(void *pData, int argc, char **argv, char **NotUsed){
** This is illegal and should set the SQLITE_MISUSE flag on the database.
**
** 2004-Jan-07: We have changed this to make it legal to call sqlite_exec()
-** from within a function call.
-**
+** from within a function call.
+**
** This routine simulates the effect of having two threads attempt to
** use the same database at the same time.
*/
static void sqliteExecFunc(sqlite_func *context, int argc, const char **argv){
struct dstr x;
memset(&x, 0, sizeof(x));
- sqlite_exec((sqlite*)sqlite_user_data(context), argv[0],
+ sqlite_exec((sqlite*)sqlite_user_data(context), argv[0],
execFuncCallback, &x, 0);
sqlite_set_result_string(context, x.z, x.nUsed);
sqliteFree(x.z);
@@ -414,7 +414,7 @@ static void countStep(sqlite_func *context, int argc, const char **argv){
if( (argc==0 || argv[0]) && p ){
p->n++;
}
-}
+}
static void countFinalize(sqlite_func *context){
CountCtx *p;
p = sqlite_aggregate_context(context, sizeof(*p));
@@ -667,7 +667,7 @@ static int test_register_func(
sqlite *db;
int rc;
if( argc!=3 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" DB FUNCTION-NAME", 0);
return TCL_ERROR;
}
@@ -720,7 +720,7 @@ static int sqlite_datatypes(
sqlite *db;
int rc;
if( argc!=3 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" DB SQL", 0);
return TCL_ERROR;
}
@@ -753,7 +753,7 @@ static int test_compile(
const char *zTail;
char zBuf[50];
if( argc!=3 && argc!=4 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" DB SQL TAILVAR", 0);
return TCL_ERROR;
}
@@ -794,7 +794,7 @@ static int test_step(
char *zRc;
char zBuf[50];
if( argc<2 || argc>5 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" VM NVAR VALUEVAR COLNAMEVAR", 0);
return TCL_ERROR;
}
@@ -835,7 +835,7 @@ static int test_step(
}
/*
-** Usage: sqlite_finalize VM
+** Usage: sqlite_finalize VM
**
** Shutdown a virtual machine.
*/
@@ -849,7 +849,7 @@ static int test_finalize(
int rc;
char *zErrMsg = 0;
if( argc!=2 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" VM\"", 0);
return TCL_ERROR;
}
@@ -866,7 +866,7 @@ static int test_finalize(
}
/*
-** Usage: sqlite_reset VM
+** Usage: sqlite_reset VM
**
** Reset a virtual machine and prepare it to be run again.
*/
@@ -880,7 +880,7 @@ static int test_reset(
int rc;
char *zErrMsg = 0;
if( argc!=2 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" VM\"", 0);
return TCL_ERROR;
}
@@ -922,7 +922,7 @@ static int test_bind(
int rc;
int idx;
if( argc!=5 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" VM IDX VALUE (null|static|normal)\"", 0);
return TCL_ERROR;
}
@@ -1014,13 +1014,13 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
}
- Tcl_LinkVar(interp, "sqlite_search_count",
+ Tcl_LinkVar(interp, "sqlite_search_count",
(char*)&sqlite_search_count, TCL_LINK_INT);
- Tcl_LinkVar(interp, "sqlite_interrupt_count",
+ Tcl_LinkVar(interp, "sqlite_interrupt_count",
(char*)&sqlite_interrupt_count, TCL_LINK_INT);
- Tcl_LinkVar(interp, "sqlite_open_file_count",
+ Tcl_LinkVar(interp, "sqlite_open_file_count",
(char*)&sqlite_open_file_count, TCL_LINK_INT);
- Tcl_LinkVar(interp, "sqlite_current_time",
+ Tcl_LinkVar(interp, "sqlite_current_time",
(char*)&sqlite_current_time, TCL_LINK_INT);
Tcl_LinkVar(interp, "sqlite_static_bind_value",
(char*)&sqlite_static_bind_value, TCL_LINK_STRING);
diff --git a/usr/src/lib/libtecla/common/getline.c b/usr/src/lib/libtecla/common/getline.c
index 9d91e97089..b717784666 100644
--- a/usr/src/lib/libtecla/common/getline.c
+++ b/usr/src/lib/libtecla/common/getline.c
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
- *
+ *
* All rights reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -12,7 +12,7 @@
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
@@ -22,7 +22,7 @@
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
+ *
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
@@ -32,6 +32,7 @@
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -225,7 +226,7 @@ typedef struct {
KtAction action; /* The last action function that made a */
/* change to the line. */
int count; /* The repeat count that was passed to the */
- /* above command. */
+ /* above command. */
int input_curpos; /* Whenever vi command mode is entered, the */
/* the position at which it was first left */
/* is recorded here. */
@@ -421,7 +422,7 @@ struct GetLine {
/* display the current input line. */
int buff_mark; /* A marker location in the buffer */
int insert_curpos; /* The cursor position at start of insert */
- int insert; /* True in insert mode */
+ int insert; /* True in insert mode */
int number; /* If >= 0, a numeric argument is being read */
int endline; /* True to tell gl_get_input_line() to return */
/* the current contents of gl->line[] */
@@ -976,7 +977,7 @@ static int _gl_bind_arrow_keys(GetLine *gl);
/*
* Copy the binding of the specified symbolic arrow-key binding to
- * the terminal specific, and default arrow-key key-sequences.
+ * the terminal specific, and default arrow-key key-sequences.
*/
static int _gl_rebind_arrow_key(GetLine *gl, const char *name,
const char *term_seq,
@@ -3200,7 +3201,7 @@ static int gl_read_terminal(GetLine *gl, int keep, char *c)
/*.......................................................................
* Read one or more keypresses from the terminal of an input stream.
- *
+ *
* Input:
* gl GetLine * The resource object of this module.
* c char * The character that was read is assigned to *c.
@@ -3282,7 +3283,7 @@ static GlReadStatus gl_read_input(GetLine *gl, char *c)
gl_nonblocking_io(gl, fd);
/*
* Now respond to the signal that was caught.
- */
+ */
if(gl_check_caught_signal(gl))
return GL_READ_ERROR;
};
@@ -3333,7 +3334,7 @@ static int gl_read_unmasked(GetLine *gl, int fd, char *c)
}
/*.......................................................................
- * Remove a specified number of characters from the start of the
+ * Remove a specified number of characters from the start of the
* key-press lookahead buffer, gl->keybuf[], and arrange for the next
* read to start from the character at the start of the shifted buffer.
*
@@ -4069,7 +4070,7 @@ static int gl_terminal_move_cursor(GetLine *gl, int n)
* following the one being written.
* Output:
* return int 0 - OK.
- */
+ */
static int gl_print_char(GetLine *gl, char c, char pad)
{
char string[TAB_WIDTH + 4]; /* A work area for composing compound strings */
@@ -7074,7 +7075,7 @@ static KT_KEY_FN(gl_vi_insert_at_bol)
gl_save_for_undo(gl);
return gl_beginning_of_line(gl, 0, NULL) ||
gl_vi_insert(gl, 0, NULL);
-
+
}
/*.......................................................................
@@ -8855,7 +8856,7 @@ static int _gl_watch_fd(GetLine *gl, int fd, GlFdEvent event,
* returns a code which tells gl_get_line() what to do next. Note that
* each call to gl_inactivity_timeout() replaces any previously installed
* timeout callback, and that specifying a callback of 0, turns off
- * inactivity timing.
+ * inactivity timing.
*
* Beware that although the timeout argument includes a nano-second
* component, few computer clocks presently have resolutions finer
@@ -8964,7 +8965,7 @@ static int gl_event_handler(GetLine *gl, int fd)
*/
struct timeval dt = gl->timer.fn ? gl->timer.dt : zero;
/*
- * Add the specified user-input file descriptor tot he set that is to
+ * Add the specified user-input file descriptor to the set that is to
* be watched.
*/
FD_SET(fd, &rfds);
@@ -9298,7 +9299,7 @@ int gl_show_history(GetLine *gl, FILE *fp, const char *fmt, int all_groups,
/*
* Display the specified history group(s) while signals are blocked.
*/
- status = _glh_show_history(gl->glh, _io_write_stdio, fp, fmt, all_groups,
+ status = _glh_show_history(gl->glh, _io_write_stdio, fp, fmt, all_groups,
max_lines) || fflush(fp)==EOF;
if(!status)
_err_record_msg(gl->err, _glh_last_error(gl->glh), END_ERR_MSG);
@@ -9806,7 +9807,7 @@ static int gl_display_prompt(GetLine *gl)
switch(pptr[1]) {
/*
* Add or remove a text attribute from the new set of attributes.
- */
+ */
case 'B': case 'U': case 'S': case 'P': case 'F': case 'V':
case 'b': case 'u': case 's': case 'p': case 'f': case 'v':
switch(*++pptr) {
@@ -10331,7 +10332,7 @@ int gl_last_signal(GetLine *gl)
gl_mask_signals(gl, &oldset);
/*
* Access gl now that signals are blocked.
- */
+ */
signo = gl->last_signal;
/*
* Restore the process signal mask before returning.
@@ -10393,7 +10394,7 @@ static int gl_present_line(GetLine *gl, const char *prompt,
gl_truncate_buffer(gl, 0);
};
gl->preload_id = 0;
- };
+ };
/*
* Present a specified initial line?
*/
@@ -10614,7 +10615,7 @@ GlReturnStatus gl_return_status(GetLine *gl)
gl_mask_signals(gl, &oldset);
/*
* Access gl while signals are blocked.
- */
+ */
rtn_status = gl->rtn_status;
/*
* Restore the process signal mask before returning.
@@ -10646,7 +10647,7 @@ GlPendingIO gl_pending_io(GetLine *gl)
gl_mask_signals(gl, &oldset);
/*
* Access gl while signals are blocked.
- */
+ */
pending_io = gl->pending_io;
/*
* Restore the process signal mask before returning.
@@ -10669,7 +10670,7 @@ GlPendingIO gl_pending_io(GetLine *gl)
* call gl_raw_io() to redisplay the line and resume editing.
*
* This function is async signal safe.
- *
+ *
* Input:
* gl GetLine * The line editor resource object.
* Output:
@@ -10735,7 +10736,7 @@ static int _gl_raw_io(GetLine *gl, int redisplay)
/*
* Switch to non-blocking I/O mode?
*/
- if(gl->io_mode==GL_SERVER_MODE &&
+ if(gl->io_mode==GL_SERVER_MODE &&
(gl_nonblocking_io(gl, gl->input_fd) ||
gl_nonblocking_io(gl, gl->output_fd) ||
(gl->file_fp && gl_nonblocking_io(gl, fileno(gl->file_fp))))) {
@@ -11203,7 +11204,7 @@ int gl_tty_signals(void (*term_handler)(int), void (*susp_handler)(int),
} else if(sig->attr & GLSA_SIZE) {
if(gl_set_tty_signal(sig->signo, size_handler))
return 1;
- };
+ };
};
return 0;
}
@@ -11823,7 +11824,7 @@ static int gl_classify_signal(int signo)
/*.......................................................................
* When in non-blocking server mode, this function can be used to abandon
- * the current incompletely entered input line, and prepare to start
+ * the current incompletely entered input line, and prepare to start
* editing a new line on the next call to gl_get_line().
*
* Input:
@@ -12397,7 +12398,7 @@ static int gl_read_stream_char(GetLine *gl)
* return int 0 - OK
* 1 - Error.
*/
-int gl_bind_keyseq(GetLine *gl, GlKeyOrigin origin, const char *keyseq,
+int gl_bind_keyseq(GetLine *gl, GlKeyOrigin origin, const char *keyseq,
const char *action)
{
KtBinder binder; /* The private internal equivalent of 'origin' */
diff --git a/usr/src/lib/libumem/common/getpcstack.c b/usr/src/lib/libumem/common/getpcstack.c
index 8c3a47e19f..c2dd7f03f1 100644
--- a/usr/src/lib/libumem/common/getpcstack.c
+++ b/usr/src/lib/libumem/common/getpcstack.c
@@ -22,6 +22,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -89,7 +90,7 @@ getpcstack(uintptr_t *pcstack, int pcstack_limit, int check_signal)
* If size == 0, then ss_sp is the *top* of the stack.
*
* Since we only allow increasing frame pointers, and we
- * know our caller set his up correctly, we can treat ss_sp
+ * know our caller set its up correctly, we can treat ss_sp
* as an upper bound safely.
*/
base = 0;
diff --git a/usr/src/lib/libvolmgt/common/volmgt_on_private.c b/usr/src/lib/libvolmgt/common/volmgt_on_private.c
index 96ab59a0ff..9e13e8395b 100644
--- a/usr/src/lib/libvolmgt/common/volmgt_on_private.c
+++ b/usr/src/lib/libvolmgt/common/volmgt_on_private.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
@@ -87,7 +88,7 @@ _dev_mounted(char *path)
}
if ((fp = fopen(MNTTAB, "rF")) == NULL) {
- /* mtab is gone... let him go */
+ /* mtab is gone... let it go */
goto dun;
}
@@ -418,7 +419,7 @@ get_media_info(char *path, char **mtypep, int *mnump, char **spclp)
int ret_val = FALSE;
if ((fp = fopen(MNTTAB, "rF")) == NULL) {
- /* mtab is gone... let him go */
+ /* mtab is gone... let it go */
goto dun;
}
diff --git a/usr/src/lib/pam_modules/authtok_check/authtok_check.c b/usr/src/lib/pam_modules/authtok_check/authtok_check.c
index db07326a94..2334b9c9cd 100644
--- a/usr/src/lib/pam_modules/authtok_check/authtok_check.c
+++ b/usr/src/lib/pam_modules/authtok_check/authtok_check.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <sys/types.h>
@@ -482,9 +483,9 @@ check_composition(char *pw, struct pwdefaults *pwdef, pam_handle_t *pamh,
* characters) we give a modified error message. Otherwise, a
* user entering FooBar1234 with PASSLENGTH=6, MINDIGIT=4, while
* we're using the default UNIX crypt (8 chars significant),
- * would not understand what's going on when he's told that
+ * would not understand what's going on when they're told that
* "The password should contain at least 4 digits"...
- * Instead, we now well him
+ * Instead, we now tell them
* "The first 8 characters of the password should contain at least
* 4 digits."
*/
diff --git a/usr/src/lib/pam_modules/sample/sample_acct_mgmt.c b/usr/src/lib/pam_modules/sample/sample_acct_mgmt.c
index ff09e9d797..c02a01289b 100644
--- a/usr/src/lib/pam_modules/sample/sample_acct_mgmt.c
+++ b/usr/src/lib/pam_modules/sample/sample_acct_mgmt.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <syslog.h>
@@ -36,7 +37,7 @@ static int parse_allow_name(char *, char *);
/*
* pam_sm_acct_mgmt main account managment routine.
* XXX: The routine just prints out a warning message.
- * It may need to force the user to change his/her
+ * It may need to force the user to change their
* passwd.
*/
diff --git a/usr/src/lib/pam_modules/unix_account/unix_acct.c b/usr/src/lib/pam_modules/unix_account/unix_acct.c
index 110eff6d9d..1f3712e3fd 100644
--- a/usr/src/lib/pam_modules/unix_account/unix_acct.c
+++ b/usr/src/lib/pam_modules/unix_account/unix_acct.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
@@ -198,7 +199,7 @@ perform_passwd_aging_check(
/*
* if (sp_lstchg == 0), the administrator has forced the
- * user to change his/her passwd
+ * user to change their passwd
*/
if (shpwd->sp_lstchg == 0)
return (PAM_NEW_AUTHTOK_REQD);
diff --git a/usr/src/lib/passwdutil/files_attr.c b/usr/src/lib/passwdutil/files_attr.c
index 2a8ac5c94f..8a250b90df 100644
--- a/usr/src/lib/passwdutil/files_attr.c
+++ b/usr/src/lib/passwdutil/files_attr.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <sys/types.h>
@@ -810,7 +811,7 @@ files_update(attrlist *items, pwu_repository_t *rep, void *buf)
* We take care not to update lstchg if the
* user has no password, otherwise the user
* might not be required to provide a password
- * the next time [s]he logs-in.
+ * the next time they log-in.
*
* Also, if lstchg != -1 (i.e., not set in
* /etc/shadow), we keep the old value.
diff --git a/usr/src/lib/passwdutil/ldap_attr.c b/usr/src/lib/passwdutil/ldap_attr.c
index 43d6b7dd19..4c43eb7adb 100644
--- a/usr/src/lib/passwdutil/ldap_attr.c
+++ b/usr/src/lib/passwdutil/ldap_attr.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <stdio.h>
@@ -185,7 +186,7 @@ free_ldapbuf(ldapbuf_t *p)
* we can't determine whether the user is "privileged" in the LDAP
* sense. The operation should be attempted and will succeed if the
* user had privileges. For our purposes, we say that the user is
- * privileged if he/she is attempting to change another user's
+ * privileged if they are attempting to change another user's
* password attributes.
*/
int
@@ -814,7 +815,7 @@ ldap_update(attrlist *items, pwu_repository_t *rep, void *buf)
* We take care not to update lstchg if the
* user has no password, otherwise the user
* might not be required to provide a password
- * the next time [s]he logs in.
+ * the next time they log in.
*
* Also, if lstchg != -1 (i.e., not set)
* we keep the old value.
diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c b/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c
index 0b4f85d3bc..2564a2aafd 100644
--- a/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c
+++ b/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c
@@ -22,6 +22,7 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <pthread.h>
@@ -1693,7 +1694,7 @@ token_specific_init_pin(TSS_HCONTEXT hContext,
* Since the SO must log in before calling C_InitPIN, we will
* be able to return (CKR_OK) automatically here.
* This is because the USER key structure is created at the
- * time of her first login, not at C_InitPIN time.
+ * time of their first login, not at C_InitPIN time.
*/
return (CKR_OK);
}
@@ -1939,7 +1940,7 @@ token_specific_verify_so_pin(TSS_HCONTEXT hContext, CK_CHAR_PTR pPin,
if (local_uuid_is_null(&publicRootKeyUUID) &&
find_uuid(TPMTOK_PUBLIC_ROOT_KEY_ID, &publicRootKeyUUID)) {
/*
- * The SO hasn't set her PIN yet, compare the
+ * The SO hasn't set their PIN yet, compare the
* login pin with the hard-coded value.
*/
if (memcmp(default_so_pin_sha, hash_sha,
diff --git a/usr/src/lib/sasl_plugins/digestmd5/digestmd5.c b/usr/src/lib/sasl_plugins/digestmd5/digestmd5.c
index 41124cdd49..6939e33363 100644
--- a/usr/src/lib/sasl_plugins/digestmd5/digestmd5.c
+++ b/usr/src/lib/sasl_plugins/digestmd5/digestmd5.c
@@ -1,15 +1,16 @@
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/* DIGEST-MD5 SASL plugin
* Rob Siemborski
* Tim Martin
- * Alexey Melnikov
+ * Alexey Melnikov
* $Id: digestmd5.c,v 1.153 2003/03/30 22:17:06 leg Exp $
*/
-/*
+/*
* Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -17,7 +18,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -27,7 +28,7 @@
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any other legal
- * details, please contact
+ * details, please contact
* Office of Technology Transfer
* Carnegie Mellon University
* 5000 Forbes Avenue
@@ -162,10 +163,10 @@ typedef int cipher_function_t(struct context *,
unsigned *);
#ifdef _SUN_SDK_
-typedef int cipher_init_t(struct context *, char [16],
+typedef int cipher_init_t(struct context *, char [16],
char [16]);
#else
-typedef int cipher_init_t(struct context *, unsigned char [16],
+typedef int cipher_init_t(struct context *, unsigned char [16],
unsigned char [16]);
#endif /* _SUN_SDK_ */
@@ -211,7 +212,7 @@ typedef struct reauth_cache {
typedef struct context {
int state; /* state in the authentication we are in */
enum Context_type i_am; /* are we the client or server? */
-
+
reauth_cache_t *reauth;
char *authid;
@@ -221,22 +222,22 @@ typedef struct context {
unsigned char *cnonce;
char *response_value;
-
+
unsigned int seqnum;
unsigned int rec_seqnum; /* for checking integrity */
-
+
HASH Ki_send;
HASH Ki_receive;
-
+
HASH HA1; /* Kcc or Kcs */
-
+
/* copy of utils from the params structures */
const sasl_utils_t *utils;
-
+
/* For general use */
char *out_buf;
unsigned out_buf_len;
-
+
/* for encoding/decoding */
buffer_info_t *enc_in_buf;
char *encode_buf, *decode_buf, *decode_once_buf;
@@ -245,7 +246,7 @@ typedef struct context {
unsigned decode_tmp_buf_len;
char *MAC_buf;
unsigned MAC_buf_len;
-
+
char *buffer;
char sizebuf[4];
int cursize;
@@ -253,11 +254,11 @@ typedef struct context {
/* Layer info */
unsigned int size; /* Absolute size of buffer */
unsigned int needsize; /* How much of the size of the buffer is left */
-
+
/* Server MaxBuf for Client or Client MaxBuf For Server */
/* INCOMING */
unsigned int in_maxbuf;
-
+
/* if privacy mode is used use these functions for encode and decode */
cipher_function_t *cipher_enc;
cipher_function_t *cipher_dec;
@@ -272,7 +273,7 @@ struct digest_cipher {
sasl_ssf_t ssf;
int n; /* bits to make privacy key */
int flag; /* a bitmask to make things easier for us */
-
+
cipher_function_t *cipher_enc;
cipher_function_t *cipher_dec;
cipher_init_t *cipher_init;
@@ -305,7 +306,7 @@ static void CvtHex(HASH Bin, HASHHEX Hex)
{
unsigned short i;
unsigned char j;
-
+
for (i = 0; i < HASHLEN; i++) {
j = (Bin[i] >> 4) & 0xf;
if (j <= 9)
@@ -343,15 +344,15 @@ DigestCalcResponse(const sasl_utils_t * utils,
HASH RespHash;
HASHHEX HA2Hex;
char ncvalue[10];
-
+
/* calculate H(A2) */
utils->MD5Init(&Md5Ctx);
-
+
if (pszMethod != NULL) {
utils->MD5Update(&Md5Ctx, pszMethod, strlen((char *) pszMethod));
}
utils->MD5Update(&Md5Ctx, (unsigned char *) COLON, 1);
-
+
/* utils->MD5Update(&Md5Ctx, (unsigned char *) "AUTHENTICATE:", 13); */
utils->MD5Update(&Md5Ctx, pszDigestUri, strlen((char *) pszDigestUri));
if (strcasecmp((char *) pszQop, "auth") != 0) {
@@ -361,7 +362,7 @@ DigestCalcResponse(const sasl_utils_t * utils,
}
utils->MD5Final(HA2, &Md5Ctx);
CvtHex(HA2, HA2Hex);
-
+
/* calculate response */
utils->MD5Init(&Md5Ctx);
utils->MD5Update(&Md5Ctx, HA1, HASHHEXLEN);
@@ -389,7 +390,7 @@ DigestCalcResponse(const sasl_utils_t * utils,
static bool UTF8_In_8859_1(const unsigned char *base, int len)
{
const unsigned char *scan, *end;
-
+
end = base + len;
for (scan = base; scan < end; ++scan) {
if (*scan > 0xC3)
@@ -399,7 +400,7 @@ static bool UTF8_In_8859_1(const unsigned char *base, int len)
break;
}
}
-
+
/* if scan >= end, then this is a 8859-1 string. */
return (scan >= end);
}
@@ -416,9 +417,9 @@ void MD5_UTF8_8859_1(const sasl_utils_t * utils,
{
const unsigned char *scan, *end;
unsigned char cbuf;
-
+
end = base + len;
-
+
/* if we found a character outside 8859-1, don't alter string */
if (!In_ISO_8859_1) {
utils->MD5Update(ctx, base, len);
@@ -446,34 +447,34 @@ static void DigestCalcSecret(const sasl_utils_t * utils,
HASH HA1)
{
bool In_8859_1;
-
+
MD5_CTX Md5Ctx;
-
+
/* Chris Newman clarified that the following text in DIGEST-MD5 spec
is bogus: "if name and password are both in ISO 8859-1 charset"
We shoud use code example instead */
-
+
utils->MD5Init(&Md5Ctx);
-
+
/* We have to convert UTF-8 to ISO-8859-1 if possible */
In_8859_1 = UTF8_In_8859_1(pszUserName, strlen((char *) pszUserName));
MD5_UTF8_8859_1(utils, &Md5Ctx, In_8859_1,
pszUserName, strlen((char *) pszUserName));
-
+
utils->MD5Update(&Md5Ctx, COLON, 1);
-
+
if (pszRealm != NULL && pszRealm[0] != '\0') {
/* a NULL realm is equivalent to the empty string */
utils->MD5Update(&Md5Ctx, pszRealm, strlen((char *) pszRealm));
- }
-
+ }
+
utils->MD5Update(&Md5Ctx, COLON, 1);
-
+
/* We have to convert UTF-8 to ISO-8859-1 if possible */
In_8859_1 = UTF8_In_8859_1(Password, PasswordLen);
MD5_UTF8_8859_1(utils, &Md5Ctx, In_8859_1,
Password, PasswordLen);
-
+
utils->MD5Final(HA1, &Md5Ctx);
}
@@ -481,30 +482,30 @@ static unsigned char *create_nonce(const sasl_utils_t * utils)
{
unsigned char *base64buf;
int base64len;
-
+
char *ret = (char *) utils->malloc(NONCE_SIZE);
if (ret == NULL)
return NULL;
-
+
#if defined _DEV_URANDOM && defined _SUN_SDK_
{
int fd = open(_DEV_URANDOM, O_RDONLY);
int nread = 0;
- if (fd != -1) {
- nread = read(fd, ret, NONCE_SIZE);
- close(fd);
- }
+ if (fd != -1) {
+ nread = read(fd, ret, NONCE_SIZE);
+ close(fd);
+ }
if (nread != NONCE_SIZE)
utils->rand(utils->rpool, (char *) ret, NONCE_SIZE);
}
#else
utils->rand(utils->rpool, (char *) ret, NONCE_SIZE);
#endif /* _DEV_URANDOM && _SUN_SDK_ */
-
+
/* base 64 encode it so it has valid chars */
base64len = (NONCE_SIZE * 4 / 3) + (NONCE_SIZE % 3 ? 4 : 0);
-
+
base64buf = (unsigned char *) utils->malloc(base64len + 1);
if (base64buf == NULL) {
#ifdef _SUN_SDK_
@@ -515,7 +516,7 @@ static unsigned char *create_nonce(const sasl_utils_t * utils)
#endif /* _SUN_SDK_ */
return NULL;
}
-
+
/*
* Returns SASL_OK on success, SASL_BUFOVER if result won't fit
*/
@@ -525,7 +526,7 @@ static unsigned char *create_nonce(const sasl_utils_t * utils)
return NULL;
}
utils->free(ret);
-
+
return base64buf;
}
@@ -538,16 +539,16 @@ static int add_to_challenge(const sasl_utils_t *utils,
int namesize = strlen(name);
int valuesize = strlen((char *) value);
int ret;
-
+
ret = _plug_buf_alloc(utils, str, buflen,
*curlen + 1 + namesize + 2 + valuesize + 2);
if(ret != SASL_OK) return ret;
-
+
*curlen = *curlen + 1 + namesize + 2 + valuesize + 2;
-
+
strcat(*str, ",");
strcat(*str, name);
-
+
if (need_quotes) {
strcat(*str, "=\"");
strcat(*str, (char *) value); /* XXX. What about quoting??? */
@@ -556,20 +557,20 @@ static int add_to_challenge(const sasl_utils_t *utils,
strcat(*str, "=");
strcat(*str, (char *) value);
}
-
+
return SASL_OK;
}
static char *skip_lws (char *s)
{
if(!s) return NULL;
-
+
/* skipping spaces: */
while (s[0] == ' ' || s[0] == HT || s[0] == CR || s[0] == LF) {
if (s[0]=='\0') break;
s++;
- }
-
+ }
+
return s;
}
@@ -580,7 +581,7 @@ static char *skip_token (char *s, int caseinsensitive)
#endif /* _SUN_SDK_ */
{
if(!s) return NULL;
-
+
#ifdef __SUN_SDK_
while (((unsigned char *)s)[0]>SP) {
#else
@@ -603,24 +604,24 @@ static char *skip_token (char *s, int caseinsensitive)
#endif /* _SUN_SDK_ */
}
s++;
- }
+ }
return s;
}
-/* NULL - error (unbalanced quotes),
+/* NULL - error (unbalanced quotes),
otherwise pointer to the first character after value */
static char *unquote (char *qstr)
{
char *endvalue;
int escaped = 0;
char *outptr;
-
+
if(!qstr) return NULL;
-
+
if (qstr[0] == '"') {
qstr++;
outptr = qstr;
-
+
for (endvalue = qstr; endvalue[0] != '\0'; endvalue++, outptr++) {
if (escaped) {
outptr[0] = endvalue[0];
@@ -632,16 +633,16 @@ static char *unquote (char *qstr)
}
else if (endvalue[0] == '"') {
break;
- }
+ }
else {
- outptr[0] = endvalue[0];
+ outptr[0] = endvalue[0];
}
}
-
+
if (endvalue[0] != '"') {
return NULL;
}
-
+
while (outptr <= endvalue) {
outptr[0] = '\0';
outptr++;
@@ -651,9 +652,9 @@ static char *unquote (char *qstr)
else { /* not qouted value (token) */
endvalue = skip_token(qstr,0);
};
-
- return endvalue;
-}
+
+ return endvalue;
+}
static void get_pair(char **in, char **name, char **value)
{
@@ -662,58 +663,58 @@ static void get_pair(char **in, char **name, char **value)
char *curp = *in;
*name = NULL;
*value = NULL;
-
+
if (curp == NULL) return;
if (curp[0] == '\0') return;
-
+
/* skipping spaces: */
curp = skip_lws(curp);
-
+
*name = curp;
-
+
curp = skip_token(curp,1);
-
+
/* strip wierd chars */
if (curp[0] != '=' && curp[0] != '\0') {
*curp++ = '\0';
};
-
+
curp = skip_lws(curp);
-
- if (curp[0] != '=') { /* No '=' sign */
+
+ if (curp[0] != '=') { /* No '=' sign */
*name = NULL;
return;
}
-
+
curp[0] = '\0';
curp++;
-
- curp = skip_lws(curp);
-
+
+ curp = skip_lws(curp);
+
*value = (curp[0] == '"') ? curp+1 : curp;
-
+
endpair = unquote (curp);
- if (endpair == NULL) { /* Unbalanced quotes */
+ if (endpair == NULL) { /* Unbalanced quotes */
*name = NULL;
return;
}
if (endpair[0] != ',') {
if (endpair[0]!='\0') {
- *endpair++ = '\0';
+ *endpair++ = '\0';
}
}
-
+
endpair = skip_lws(endpair);
-
- /* syntax check: MUST be '\0' or ',' */
+
+ /* syntax check: MUST be '\0' or ',' */
if (endpair[0] == ',') {
endpair[0] = '\0';
endpair++; /* skipping <,> */
- } else if (endpair[0] != '\0') {
+ } else if (endpair[0] != '\0') {
*name = NULL;
return;
}
-
+
*in = endpair;
}
@@ -755,7 +756,7 @@ static int dec_3des(context_t *text,
{
des_context_t *c = (des_context_t *) text->cipher_dec_context;
int padding, p;
-
+
des_ede2_cbc_encrypt((void *) input,
(void *) output,
inputlen,
@@ -763,7 +764,7 @@ static int dec_3des(context_t *text,
c->keysched2,
&c->ivec,
DES_DECRYPT);
-
+
/* now chop off the padding */
padding = output[inputlen - 11];
if (padding < 1 || padding > 8) {
@@ -776,13 +777,13 @@ static int dec_3des(context_t *text,
return SASL_FAIL;
}
}
-
+
/* chop off the padding */
*outputlen = inputlen - padding - 10;
-
+
/* copy in the HMAC to digest */
memcpy(digest, output + inputlen - 10, 10);
-
+
return SASL_OK;
}
@@ -796,17 +797,17 @@ static int enc_3des(context_t *text,
des_context_t *c = (des_context_t *) text->cipher_enc_context;
int len;
int paddinglen;
-
+
/* determine padding length */
paddinglen = 8 - ((inputlen + 10) % 8);
-
+
/* now construct the full stuff to be ciphered */
memcpy(output, input, inputlen); /* text */
memset(output+inputlen, paddinglen, paddinglen);/* pad */
memcpy(output+inputlen+paddinglen, digest, 10); /* hmac */
-
+
len=inputlen+paddinglen+10;
-
+
des_ede2_cbc_encrypt((void *) output,
(void *) output,
len,
@@ -814,13 +815,13 @@ static int enc_3des(context_t *text,
c->keysched2,
&c->ivec,
DES_ENCRYPT);
-
+
*outputlen=len;
-
+
return SASL_OK;
}
-static int init_3des(context_t *text,
+static int init_3des(context_t *text,
unsigned char enckey[16],
unsigned char deckey[16])
{
@@ -848,15 +849,15 @@ static int init_3des(context_t *text,
slidebits(keybuf, deckey);
if (des_key_sched((des_cblock *) keybuf, c->keysched) < 0)
return SASL_FAIL;
-
+
slidebits(keybuf, deckey + 7);
if (des_key_sched((des_cblock *) keybuf, c->keysched2) < 0)
return SASL_FAIL;
-
+
memcpy(c->ivec, ((char *) deckey) + 8, 8);
text->cipher_dec_context = (cipher_context_t *) c;
-
+
return SASL_OK;
}
@@ -867,7 +868,7 @@ static int init_3des(context_t *text,
*
*****************************/
-static int dec_des(context_t *text,
+static int dec_des(context_t *text,
const char *input,
unsigned inputlen,
unsigned char digest[16],
@@ -876,7 +877,7 @@ static int dec_des(context_t *text,
{
des_context_t *c = (des_context_t *) text->cipher_dec_context;
int p, padding = 0;
-
+
des_cbc_encrypt((void *) input,
(void *) output,
inputlen,
@@ -887,7 +888,7 @@ static int dec_des(context_t *text,
/* Update the ivec (des_cbc_encrypt implementations tend to be broken in
this way) */
memcpy(c->ivec, input + (inputlen - 8), 8);
-
+
/* now chop off the padding */
padding = output[inputlen - 11];
if (padding < 1 || padding > 8) {
@@ -900,13 +901,13 @@ static int dec_des(context_t *text,
return SASL_FAIL;
}
}
-
+
/* chop off the padding */
*outputlen = inputlen - padding - 10;
-
+
/* copy in the HMAC to digest */
memcpy(digest, output + inputlen - 10, 10);
-
+
return SASL_OK;
}
@@ -920,7 +921,7 @@ static int enc_des(context_t *text,
des_context_t *c = (des_context_t *) text->cipher_enc_context;
int len;
int paddinglen;
-
+
/* determine padding length */
paddinglen = 8 - ((inputlen+10) % 8);
@@ -928,22 +929,22 @@ static int enc_des(context_t *text,
memcpy(output, input, inputlen); /* text */
memset(output+inputlen, paddinglen, paddinglen);/* pad */
memcpy(output+inputlen+paddinglen, digest, 10); /* hmac */
-
+
len = inputlen + paddinglen + 10;
-
+
des_cbc_encrypt((void *) output,
(void *) output,
len,
c->keysched,
&c->ivec,
DES_ENCRYPT);
-
+
/* Update the ivec (des_cbc_encrypt implementations tend to be broken in
this way) */
memcpy(c->ivec, output + (len - 8), 8);
-
+
*outputlen = len;
-
+
return SASL_OK;
}
@@ -957,13 +958,13 @@ static int init_des(context_t *text,
/* allocate enc context */
c = (des_context_t *) text->utils->malloc(2 * sizeof(des_context_t));
if (c == NULL) return SASL_NOMEM;
-
+
/* setup enc context */
slidebits(keybuf, enckey);
des_key_sched((des_cblock *) keybuf, c->keysched);
memcpy(c->ivec, ((char *) enckey) + 8, 8);
-
+
text->cipher_enc_context = (cipher_context_t *) c;
/* setup dec context */
@@ -972,7 +973,7 @@ static int init_des(context_t *text,
des_key_sched((des_cblock *) keybuf, c->keysched);
memcpy(c->ivec, ((char *) deckey) + 8, 8);
-
+
text->cipher_dec_context = (cipher_context_t *) c;
return SASL_OK;
@@ -1001,23 +1002,23 @@ static void rc4_init(rc4_context_t *text,
unsigned keylen)
{
int i, j;
-
+
/* fill in linearly s0=0 s1=1... */
for (i=0;i<256;i++)
text->sbox[i]=i;
-
+
j=0;
for (i = 0; i < 256; i++) {
unsigned char tmp;
/* j = (j + Si + Ki) mod 256 */
j = (j + text->sbox[i] + key[i % keylen]) % 256;
-
+
/* swap Si and Sj */
tmp = text->sbox[i];
text->sbox[i] = text->sbox[j];
text->sbox[j] = tmp;
}
-
+
/* counters initialized to 0 */
text->i = 0;
text->j = 0;
@@ -1034,25 +1035,25 @@ static void rc4_encrypt(rc4_context_t *text,
int t;
int K;
const char *input_end = input + len;
-
+
while (input < input_end) {
i = (i + 1) % 256;
-
+
j = (j + text->sbox[i]) % 256;
-
+
/* swap Si and Sj */
tmp = text->sbox[i];
text->sbox[i] = text->sbox[j];
text->sbox[j] = tmp;
-
+
t = (text->sbox[i] + text->sbox[j]) % 256;
-
+
K = text->sbox[t];
-
+
/* byte K is Xor'ed with plaintext */
*output++ = *input++ ^ K;
}
-
+
text->i = i;
text->j = j;
}
@@ -1068,25 +1069,25 @@ static void rc4_decrypt(rc4_context_t *text,
int t;
int K;
const char *input_end = input + len;
-
+
while (input < input_end) {
i = (i + 1) % 256;
-
+
j = (j + text->sbox[i]) % 256;
-
+
/* swap Si and Sj */
tmp = text->sbox[i];
text->sbox[i] = text->sbox[j];
text->sbox[j] = tmp;
-
+
t = (text->sbox[i] + text->sbox[j]) % 256;
-
+
K = text->sbox[t];
-
+
/* byte K is Xor'ed with plaintext */
*output++ = *input++ ^ K;
}
-
+
text->i = i;
text->j = j;
}
@@ -1103,7 +1104,7 @@ static void free_rc4(context_t *text)
#endif /* _SUN_SDK_ */
}
-static int init_rc4(context_t *text,
+static int init_rc4(context_t *text,
#ifdef _SUN_SDK_
char enckey[16],
char deckey[16])
@@ -1116,7 +1117,7 @@ static int init_rc4(context_t *text,
text->cipher_enc_context=
(cipher_context_t *) text->utils->malloc(sizeof(rc4_context_t));
if (text->cipher_enc_context == NULL) return SASL_NOMEM;
-
+
text->cipher_dec_context=
(cipher_context_t *) text->utils->malloc(sizeof(rc4_context_t));
#ifdef _SUN_SDK_
@@ -1128,13 +1129,13 @@ static int init_rc4(context_t *text,
#else
if (text->cipher_dec_context == NULL) return SASL_NOMEM;
#endif /* _SUN_SDK_ */
-
+
/* initialize them */
rc4_init((rc4_context_t *) text->cipher_enc_context,
(const unsigned char *) enckey, 16);
rc4_init((rc4_context_t *) text->cipher_dec_context,
(const unsigned char *) deckey, 16);
-
+
return SASL_OK;
}
@@ -1146,16 +1147,16 @@ static int dec_rc4(context_t *text,
unsigned *outputlen)
{
/* decrypt the text part */
- rc4_decrypt((rc4_context_t *) text->cipher_dec_context,
+ rc4_decrypt((rc4_context_t *) text->cipher_dec_context,
input, output, inputlen-10);
-
+
/* decrypt the HMAC part */
- rc4_decrypt((rc4_context_t *) text->cipher_dec_context,
+ rc4_decrypt((rc4_context_t *) text->cipher_dec_context,
input+(inputlen-10), (char *) digest, 10);
-
+
/* no padding so we just subtract the HMAC to get the text length */
*outputlen = inputlen - 10;
-
+
return SASL_OK;
}
@@ -1168,18 +1169,18 @@ static int enc_rc4(context_t *text,
{
/* pad is zero */
*outputlen = inputlen+10;
-
+
/* encrypt the text part */
rc4_encrypt((rc4_context_t *) text->cipher_enc_context,
input,
output,
inputlen);
-
+
/* encrypt the HMAC part */
- rc4_encrypt((rc4_context_t *) text->cipher_enc_context,
- (const char *) digest,
+ rc4_encrypt((rc4_context_t *) text->cipher_enc_context,
+ (const char *) digest,
(output)+inputlen, 10);
-
+
return SASL_OK;
}
@@ -1242,12 +1243,12 @@ static void slidebits(unsigned char *keybuf, unsigned char *inbuf)
/*
* Create encryption and decryption session handle handles for later use.
* Returns SASL_OK on success - any other return indicates failure.
- *
+ *
* free_uef is called to release associated resources by
* digestmd5_common_mech_dispose
*/
-static int init_uef(context_t *text,
+static int init_uef(context_t *text,
CK_KEY_TYPE keyType,
CK_MECHANISM_TYPE mech_type,
CK_SLOT_ID slot_id,
@@ -1291,7 +1292,7 @@ static int init_uef(context_t *text,
enc_context = text->utils->malloc(sizeof (uef_context_t));
if (enc_context == NULL)
return SASL_NOMEM;
-
+
rv = C_OpenSession(slot_id, CKF_SERIAL_SESSION, NULL_PTR, NULL_PTR,
&enc_context->hSession);
if (rv != CKR_OK) {
@@ -1380,21 +1381,21 @@ static int init_uef(context_t *text,
return SASL_OK;
}
-static int init_rc4_uef(context_t *text,
+static int init_rc4_uef(context_t *text,
char enckey[16],
char deckey[16])
{
return init_uef(text, CKK_RC4, CKM_RC4, rc4_slot_id, enckey, deckey);
}
-static int init_des_uef(context_t *text,
+static int init_des_uef(context_t *text,
char enckey[16],
char deckey[16])
{
return init_uef(text, CKK_DES, CKM_DES_CBC, des_slot_id, enckey, deckey);
}
-static int init_3des_uef(context_t *text,
+static int init_3des_uef(context_t *text,
char enckey[16],
char deckey[16])
{
@@ -1411,7 +1412,7 @@ free_uef(context_t *text)
CK_RV rv;
unsigned char buf[1];
CK_ULONG ulLen = 0;
-
+
if (enc_context != NULL) {
rv = C_EncryptFinal(enc_context->hSession, buf, &ulLen);
@@ -1665,54 +1666,54 @@ static int create_layer_keys(context_t *text,
char enckey[16], char deckey[16])
{
MD5_CTX Md5Ctx;
-
+
utils->MD5Init(&Md5Ctx);
utils->MD5Update(&Md5Ctx, key, keylen);
if (text->i_am == SERVER) {
- utils->MD5Update(&Md5Ctx, (const unsigned char *) SEALING_SERVER_CLIENT,
+ utils->MD5Update(&Md5Ctx, (const unsigned char *) SEALING_SERVER_CLIENT,
strlen(SEALING_SERVER_CLIENT));
} else {
utils->MD5Update(&Md5Ctx, (const unsigned char *) SEALING_CLIENT_SERVER,
strlen(SEALING_CLIENT_SERVER));
}
utils->MD5Final((unsigned char *) enckey, &Md5Ctx);
-
+
utils->MD5Init(&Md5Ctx);
utils->MD5Update(&Md5Ctx, key, keylen);
if (text->i_am != SERVER) {
- utils->MD5Update(&Md5Ctx, (const unsigned char *)SEALING_SERVER_CLIENT,
+ utils->MD5Update(&Md5Ctx, (const unsigned char *)SEALING_SERVER_CLIENT,
strlen(SEALING_SERVER_CLIENT));
} else {
utils->MD5Update(&Md5Ctx, (const unsigned char *)SEALING_CLIENT_SERVER,
strlen(SEALING_CLIENT_SERVER));
}
utils->MD5Final((unsigned char *) deckey, &Md5Ctx);
-
+
/* create integrity keys */
/* sending */
utils->MD5Init(&Md5Ctx);
utils->MD5Update(&Md5Ctx, text->HA1, HASHLEN);
if (text->i_am == SERVER) {
- utils->MD5Update(&Md5Ctx, (const unsigned char *)SIGNING_SERVER_CLIENT,
+ utils->MD5Update(&Md5Ctx, (const unsigned char *)SIGNING_SERVER_CLIENT,
strlen(SIGNING_SERVER_CLIENT));
} else {
utils->MD5Update(&Md5Ctx, (const unsigned char *)SIGNING_CLIENT_SERVER,
strlen(SIGNING_CLIENT_SERVER));
}
utils->MD5Final(text->Ki_send, &Md5Ctx);
-
+
/* receiving */
utils->MD5Init(&Md5Ctx);
utils->MD5Update(&Md5Ctx, text->HA1, HASHLEN);
if (text->i_am != SERVER) {
- utils->MD5Update(&Md5Ctx, (const unsigned char *)SIGNING_SERVER_CLIENT,
+ utils->MD5Update(&Md5Ctx, (const unsigned char *)SIGNING_SERVER_CLIENT,
strlen(SIGNING_SERVER_CLIENT));
} else {
utils->MD5Update(&Md5Ctx, (const unsigned char *)SIGNING_CLIENT_SERVER,
strlen(SIGNING_CLIENT_SERVER));
}
utils->MD5Final(text->Ki_receive, &Md5Ctx);
-
+
return SASL_OK;
}
@@ -1735,12 +1736,12 @@ digestmd5_privacy_encode(void *context,
char *out;
unsigned char digest[16];
struct buffer_info *inblob, bufinfo;
-
+
if(!context || !invec || !numiov || !output || !outputlen) {
PARAMERROR(text->utils);
return SASL_BADPARAM;
}
-
+
if (numiov > 1) {
ret = _plug_iovec_to_buf(text->utils, invec, numiov, &text->enc_in_buf);
if (ret != SASL_OK) return ret;
@@ -1751,7 +1752,7 @@ digestmd5_privacy_encode(void *context,
bufinfo.curlen = invec[0].iov_len;
inblob = &bufinfo;
}
-
+
/* make sure the output buffer is big enough for this blob */
ret = _plug_buf_alloc(text->utils, &(text->encode_buf),
&(text->encode_buf_len),
@@ -1762,48 +1763,48 @@ digestmd5_privacy_encode(void *context,
6 + /* for padding */
1)); /* trailing null */
if(ret != SASL_OK) return ret;
-
+
/* skip by the length for now */
out = (text->encode_buf)+4;
-
+
/* construct (seqnum, msg) */
/* We can just use the output buffer because it's big enough */
tmpnum = htonl(text->seqnum);
memcpy(text->encode_buf, &tmpnum, 4);
memcpy(text->encode_buf + 4, inblob->data, inblob->curlen);
-
+
/* HMAC(ki, (seqnum, msg) ) */
text->utils->hmac_md5((const unsigned char *) text->encode_buf,
- inblob->curlen + 4,
+ inblob->curlen + 4,
text->Ki_send, HASHLEN, digest);
-
+
/* calculate the encrypted part */
text->cipher_enc(text, inblob->data, inblob->curlen,
digest, out, outputlen);
out+=(*outputlen);
-
+
/* copy in version */
tmpshort = htons(version);
memcpy(out, &tmpshort, 2); /* 2 bytes = version */
-
+
out+=2;
(*outputlen)+=2; /* for version */
-
+
/* put in seqnum */
tmpnum = htonl(text->seqnum);
- memcpy(out, &tmpnum, 4); /* 4 bytes = seq # */
-
+ memcpy(out, &tmpnum, 4); /* 4 bytes = seq # */
+
(*outputlen)+=4; /* for seqnum */
-
+
/* put the 1st 4 bytes in */
- tmp=htonl(*outputlen);
+ tmp=htonl(*outputlen);
memcpy(text->encode_buf, &tmp, 4);
-
+
(*outputlen)+=4;
-
+
*output = text->encode_buf;
text->seqnum++;
-
+
return SASL_OK;
}
@@ -1821,39 +1822,39 @@ digestmd5_privacy_decode_once(void *context,
unsigned char digest[16];
int tmpnum;
int lup;
-
+
if (text->needsize>0) /* 4 bytes for how long message is */
{
/* if less than 4 bytes just copy those we have into text->size */
- if (*inputlen<4)
+ if (*inputlen<4)
tocopy=*inputlen;
else
tocopy=4;
-
+
if (tocopy>text->needsize)
tocopy=text->needsize;
-
+
memcpy(text->sizebuf+4-text->needsize, *input, tocopy);
text->needsize-=tocopy;
-
+
*input+=tocopy;
*inputlen-=tocopy;
-
+
if (text->needsize==0) /* got all of size */
{
memcpy(&(text->size), text->sizebuf, 4);
text->cursize=0;
text->size=ntohl(text->size);
-
+
if (text->size > text->in_maxbuf) {
return SASL_FAIL; /* too big probably error */
}
-
+
if(!text->buffer)
text->buffer=text->utils->malloc(text->size+5);
else
text->buffer=text->utils->realloc(text->buffer,
- text->size+5);
+ text->size+5);
if (text->buffer == NULL) return SASL_NOMEM;
}
@@ -1861,16 +1862,16 @@ digestmd5_privacy_decode_once(void *context,
*output=NULL;
if (*inputlen==0) /* have to wait until next time for data */
return SASL_OK;
-
+
if (text->size==0) /* should never happen */
return SASL_FAIL;
}
-
+
diff=text->size - text->cursize; /* bytes need for full message */
-
+
if (! text->buffer)
return SASL_FAIL;
-
+
if (*inputlen < diff) /* not enough for a decode */
{
memcpy(text->buffer+text->cursize, *input, *inputlen);
@@ -1881,30 +1882,30 @@ digestmd5_privacy_decode_once(void *context,
return SASL_OK;
} else {
memcpy(text->buffer+text->cursize, *input, diff);
- *input+=diff;
+ *input+=diff;
*inputlen-=diff;
}
-
+
{
unsigned short ver;
unsigned int seqnum;
unsigned char checkdigest[16];
-
+
result = _plug_buf_alloc(text->utils, &text->decode_once_buf,
&text->decode_once_buf_len,
text->size-6);
if (result != SASL_OK)
return result;
-
+
*output = text->decode_once_buf;
*outputlen = *inputlen;
-
+
result=text->cipher_dec(text,text->buffer,text->size-6,digest,
*output, outputlen);
-
+
if (result!=SASL_OK)
return result;
-
+
{
int i;
for(i=10; i; i--) {
@@ -1912,7 +1913,7 @@ digestmd5_privacy_decode_once(void *context,
ver=ntohs(ver);
}
}
-
+
/* check the version number */
memcpy(&ver, text->buffer+text->size-6, 2);
ver=ntohs(ver);
@@ -1926,23 +1927,23 @@ digestmd5_privacy_decode_once(void *context,
#endif /* _INTEGRATED_SOLARIS_ */
return SASL_FAIL;
}
-
+
/* check the CMAC */
-
+
/* construct (seqnum, msg) */
result = _plug_buf_alloc(text->utils, &text->decode_tmp_buf,
&text->decode_tmp_buf_len, *outputlen + 4);
if(result != SASL_OK) return result;
-
+
tmpnum = htonl(text->rec_seqnum);
memcpy(text->decode_tmp_buf, &tmpnum, 4);
memcpy(text->decode_tmp_buf + 4, *output, *outputlen);
-
+
/* HMAC(ki, (seqnum, msg) ) */
text->utils->hmac_md5((const unsigned char *) text->decode_tmp_buf,
- (*outputlen) + 4,
+ (*outputlen) + 4,
text->Ki_receive, HASHLEN, checkdigest);
-
+
/* now check it */
for (lup=0;lup<10;lup++)
if (checkdigest[lup]!=digest[lup])
@@ -1956,12 +1957,12 @@ digestmd5_privacy_decode_once(void *context,
"CMAC doesn't match at byte %d!", lup);
return SASL_FAIL;
#endif /* _SUN_SDK_ */
- }
-
+ }
+
/* check the sequence number */
memcpy(&seqnum, text->buffer+text->size-4,4);
seqnum=ntohl(seqnum);
-
+
if (seqnum!=text->rec_seqnum)
{
#ifdef _SUN_SDK_
@@ -1973,12 +1974,12 @@ digestmd5_privacy_decode_once(void *context,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
+
text->rec_seqnum++; /* now increment it */
}
-
+
text->needsize=4;
-
+
return SASL_OK;
}
@@ -1988,13 +1989,13 @@ static int digestmd5_privacy_decode(void *context,
{
context_t *text = (context_t *) context;
int ret;
-
+
ret = _plug_decode(text->utils, context, input, inputlen,
&text->decode_buf, &text->decode_buf_len, outputlen,
digestmd5_privacy_decode_once);
-
+
*output = text->decode_buf;
-
+
return ret;
}
@@ -2011,12 +2012,12 @@ digestmd5_integrity_encode(void *context,
unsigned short int tmpshort;
struct buffer_info *inblob, bufinfo;
int ret;
-
+
if(!context || !invec || !numiov || !output || !outputlen) {
PARAMERROR( text->utils );
return SASL_BADPARAM;
}
-
+
if (numiov > 1) {
ret = _plug_iovec_to_buf(text->utils, invec, numiov,
&text->enc_in_buf);
@@ -2028,51 +2029,51 @@ digestmd5_integrity_encode(void *context,
bufinfo.curlen = invec[0].iov_len;
inblob = &bufinfo;
}
-
+
/* construct output */
*outputlen = 4 + inblob->curlen + 16;
-
+
ret = _plug_buf_alloc(text->utils, &(text->encode_buf),
&(text->encode_buf_len), *outputlen);
if(ret != SASL_OK) return ret;
-
+
/* construct (seqnum, msg) */
/* we can just use the output buffer */
tmpnum = htonl(text->seqnum);
memcpy(text->encode_buf, &tmpnum, 4);
memcpy(text->encode_buf + 4, inblob->data, inblob->curlen);
-
+
/* HMAC(ki, (seqnum, msg) ) */
#ifdef _SUN_SDK_
text->utils->hmac_md5((unsigned char *)text->encode_buf,
- inblob->curlen + 4,
+ inblob->curlen + 4,
text->Ki_send, HASHLEN, MAC);
#else
- text->utils->hmac_md5(text->encode_buf, inblob->curlen + 4,
+ text->utils->hmac_md5(text->encode_buf, inblob->curlen + 4,
text->Ki_send, HASHLEN, MAC);
#endif /* _SUN_SDK_ */
-
+
/* create MAC */
tmpshort = htons(version);
memcpy(MAC + 10, &tmpshort, MAC_OFFS); /* 2 bytes = version */
-
+
tmpnum = htonl(text->seqnum);
memcpy(MAC + 12, &tmpnum, 4); /* 4 bytes = sequence number */
-
+
/* copy into output */
tmpnum = htonl((*outputlen) - 4);
-
+
/* length of message in network byte order */
memcpy(text->encode_buf, &tmpnum, 4);
/* the message text */
memcpy(text->encode_buf + 4, inblob->data, inblob->curlen);
/* the MAC */
memcpy(text->encode_buf + 4 + inblob->curlen, MAC, 16);
-
+
text->seqnum++; /* add one to sequence number */
-
+
*output = text->encode_buf;
-
+
return SASL_OK;
}
@@ -2084,39 +2085,39 @@ create_MAC(context_t * text,
unsigned char MAC[16])
{
unsigned int tmpnum;
- unsigned short int tmpshort;
+ unsigned short int tmpshort;
int ret;
-
+
if (inputlen < 0)
return SASL_FAIL;
-
+
ret = _plug_buf_alloc(text->utils, &(text->MAC_buf),
&(text->MAC_buf_len), inputlen + 4);
if(ret != SASL_OK) return ret;
-
+
/* construct (seqnum, msg) */
tmpnum = htonl(seqnum);
memcpy(text->MAC_buf, &tmpnum, 4);
memcpy(text->MAC_buf + 4, input, inputlen);
-
+
/* HMAC(ki, (seqnum, msg) ) */
#ifdef _SUN_SDK_
- text->utils->hmac_md5((unsigned char *)text->MAC_buf, inputlen + 4,
+ text->utils->hmac_md5((unsigned char *)text->MAC_buf, inputlen + 4,
text->Ki_receive, HASHLEN,
MAC);
#else
- text->utils->hmac_md5(text->MAC_buf, inputlen + 4,
+ text->utils->hmac_md5(text->MAC_buf, inputlen + 4,
text->Ki_receive, HASHLEN,
MAC);
#endif /* _SUN_SDK_ */
-
+
/* create MAC */
tmpshort = htons(version);
memcpy(MAC + 10, &tmpshort, 2); /* 2 bytes = version */
-
+
tmpnum = htonl(seqnum);
memcpy(MAC + 12, &tmpnum, 4); /* 4 bytes = sequence number */
-
+
return SASL_OK;
}
@@ -2127,11 +2128,11 @@ check_integrity(context_t * text,
{
unsigned char MAC[16];
int result;
-
+
result = create_MAC(text, buf, bufsize - 16, text->rec_seqnum, MAC);
if (result != SASL_OK)
return result;
-
+
/* make sure the MAC is right */
if (strncmp((char *) MAC, buf + bufsize - 16, 16) != 0)
{
@@ -2144,21 +2145,21 @@ check_integrity(context_t * text,
return SASL_FAIL;
#endif /* _SUN_SDK_ */
}
-
+
text->rec_seqnum++;
-
+
/* ok make output message */
result = _plug_buf_alloc(text->utils, &text->decode_once_buf,
&text->decode_once_buf_len,
bufsize - 15);
if (result != SASL_OK)
return result;
-
+
*output = text->decode_once_buf;
memcpy(*output, buf, bufsize - 16);
*outputlen = bufsize - 16;
(*output)[*outputlen] = 0;
-
+
return SASL_OK;
}
@@ -2173,7 +2174,7 @@ digestmd5_integrity_decode_once(void *context,
unsigned int tocopy;
unsigned diff;
int result;
-
+
if (text->needsize > 0) { /* 4 bytes for how long message is */
/*
* if less than 4 bytes just copy those we have into text->size
@@ -2182,24 +2183,24 @@ digestmd5_integrity_decode_once(void *context,
tocopy = *inputlen;
else
tocopy = 4;
-
+
if (tocopy > text->needsize)
tocopy = text->needsize;
-
+
memcpy(text->sizebuf + 4 - text->needsize, *input, tocopy);
text->needsize -= tocopy;
-
+
*input += tocopy;
*inputlen -= tocopy;
-
+
if (text->needsize == 0) { /* got all of size */
memcpy(&(text->size), text->sizebuf, 4);
text->cursize = 0;
text->size = ntohl(text->size);
-
+
if (text->size > text->in_maxbuf)
return SASL_FAIL; /* too big probably error */
-
+
if(!text->buffer)
text->buffer=text->utils->malloc(text->size+5);
else
@@ -2210,15 +2211,15 @@ digestmd5_integrity_decode_once(void *context,
*output = NULL;
if (*inputlen == 0) /* have to wait until next time for data */
return SASL_OK;
-
+
if (text->size == 0) /* should never happen */
return SASL_FAIL;
}
diff = text->size - text->cursize; /* bytes need for full message */
-
+
if(! text->buffer)
return SASL_FAIL;
-
+
if (*inputlen < diff) { /* not enough for a decode */
memcpy(text->buffer + text->cursize, *input, *inputlen);
text->cursize += *inputlen;
@@ -2231,7 +2232,7 @@ digestmd5_integrity_decode_once(void *context,
*input += diff;
*inputlen -= diff;
}
-
+
result = check_integrity(text, text->buffer, text->size,
output, outputlen);
if (result != SASL_OK)
@@ -2239,7 +2240,7 @@ digestmd5_integrity_decode_once(void *context,
/* Reset State */
text->needsize = 4;
-
+
return SASL_OK;
}
@@ -2249,13 +2250,13 @@ static int digestmd5_integrity_decode(void *context,
{
context_t *text = (context_t *) context;
int ret;
-
+
ret = _plug_decode(text->utils, context, input, inputlen,
&text->decode_buf, &text->decode_buf_len, outputlen,
digestmd5_integrity_decode_once);
-
+
*output = text->decode_buf;
-
+
return ret;
}
@@ -2263,19 +2264,19 @@ static void
digestmd5_common_mech_dispose(void *conn_context, const sasl_utils_t *utils)
{
context_t *text = (context_t *) conn_context;
-
+
if (!text || !utils) return;
-
+
if (text->authid) utils->free(text->authid);
if (text->realm) utils->free(text->realm);
if (text->nonce) utils->free(text->nonce);
if (text->cnonce) utils->free(text->cnonce);
if (text->cipher_free) text->cipher_free(text);
-
+
/* free the stuff in the context */
if (text->response_value) utils->free(text->response_value);
-
+
if (text->buffer) utils->free(text->buffer);
if (text->encode_buf) utils->free(text->encode_buf);
if (text->decode_buf) utils->free(text->decode_buf);
@@ -2283,12 +2284,12 @@ digestmd5_common_mech_dispose(void *conn_context, const sasl_utils_t *utils)
if (text->decode_tmp_buf) utils->free(text->decode_tmp_buf);
if (text->out_buf) utils->free(text->out_buf);
if (text->MAC_buf) utils->free(text->MAC_buf);
-
+
if (text->enc_in_buf) {
if (text->enc_in_buf->data) utils->free(text->enc_in_buf->data);
utils->free(text->enc_in_buf);
}
-
+
utils->free(conn_context);
}
@@ -2315,7 +2316,7 @@ digestmd5_common_mech_free(void *glob_context, const sasl_utils_t *utils)
{
reauth_cache_t *reauth_cache = (reauth_cache_t *) glob_context;
size_t n;
-
+
if (!reauth_cache) return;
for (n = 0; n < reauth_cache->size; n++)
@@ -2347,7 +2348,7 @@ DigestCalcHA1FromSecret(context_t * text,
HASHHEX SessionKey)
{
MD5_CTX Md5Ctx;
-
+
/* calculate session key */
utils->MD5Init(&Md5Ctx);
utils->MD5Update(&Md5Ctx, HA1, HASHLEN);
@@ -2360,10 +2361,10 @@ DigestCalcHA1FromSecret(context_t * text,
utils->MD5Update(&Md5Ctx, authorization_id, strlen((char *) authorization_id));
}
utils->MD5Final(HA1, &Md5Ctx);
-
+
CvtHex(HA1, SessionKey);
-
-
+
+
/* save HA1 because we need it to make the privacy and integrity keys */
memcpy(text->HA1, HA1, sizeof(HASH));
}
@@ -2383,10 +2384,10 @@ static char *create_response(context_t * text,
HASHHEX HEntity = "00000000000000000000000000000000";
HASHHEX Response;
char *result;
-
+
if (qop == NULL)
qop = "auth";
-
+
DigestCalcHA1FromSecret(text,
utils,
Secret,
@@ -2394,7 +2395,7 @@ static char *create_response(context_t * text,
nonce,
cnonce,
SessionKey);
-
+
DigestCalcResponse(utils,
SessionKey,/* H(A1) */
nonce, /* nonce from server */
@@ -2407,7 +2408,7 @@ static char *create_response(context_t * text,
HEntity, /* H(entity body) if qop="auth-int" */
Response /* request-digest or response-digest */
);
-
+
result = utils->malloc(HASHHEXLEN + 1);
#ifdef _SUN_SDK_
if (result == NULL)
@@ -2416,7 +2417,7 @@ static char *create_response(context_t * text,
/* TODO */
memcpy(result, Response, HASHHEXLEN);
result[HASHHEXLEN] = 0;
-
+
/* response_value (used for reauth i think */
if (response_value != NULL) {
DigestCalcResponse(utils,
@@ -2431,7 +2432,7 @@ static char *create_response(context_t * text,
HEntity, /* H(entity body) if qop="auth-int" */
Response /* request-digest or response-digest */
);
-
+
*response_value = utils->malloc(HASHHEXLEN + 1);
if (*response_value == NULL)
return NULL;
@@ -2472,7 +2473,7 @@ get_server_realm(sasl_server_params_t * params,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
+
return SASL_OK;
}
@@ -2483,7 +2484,7 @@ static int htoi(unsigned char *hexin, unsigned int *res)
{
int lup, inlen;
inlen = strlen((char *) hexin);
-
+
*res = 0;
for (lup = 0; lup < inlen; lup++) {
switch (hexin[lup]) {
@@ -2499,7 +2500,7 @@ static int htoi(unsigned char *hexin, unsigned int *res)
case '9':
*res = (*res << 4) + (hexin[lup] - '0');
break;
-
+
case 'a':
case 'b':
case 'c':
@@ -2508,7 +2509,7 @@ static int htoi(unsigned char *hexin, unsigned int *res)
case 'f':
*res = (*res << 4) + (hexin[lup] - 'a' + 10);
break;
-
+
case 'A':
case 'B':
case 'C':
@@ -2517,13 +2518,13 @@ static int htoi(unsigned char *hexin, unsigned int *res)
case 'F':
*res = (*res << 4) + (hexin[lup] - 'A' + 10);
break;
-
+
default:
return SASL_BADPARAM;
}
-
+
}
-
+
return SASL_OK;
}
@@ -2534,17 +2535,17 @@ static int digestmd5_server_mech_new(void *glob_context,
void **conn_context)
{
context_t *text;
-
+
/* holds state are in -- allocate server size */
text = sparams->utils->malloc(sizeof(server_context_t));
if (text == NULL)
return SASL_NOMEM;
memset(text, 0, sizeof(server_context_t));
-
+
text->state = 1;
text->i_am = SERVER;
text->reauth = glob_context;
-
+
*conn_context = text;
return SASL_OK;
}
@@ -2568,14 +2569,14 @@ digestmd5_server_mech_step1(server_context_t *stext,
unsigned resplen;
int added_conf = 0;
char maxbufstr[64];
-
+
sparams->utils->log(sparams->utils->conn, SASL_LOG_DEBUG,
"DIGEST-MD5 server step 1");
/* get realm */
result = get_server_realm(sparams, &realm);
if(result != SASL_OK) return result;
-
+
/* what options should we offer the client? */
qop[0] = '\0';
cipheropts[0] = '\0';
@@ -2587,7 +2588,7 @@ digestmd5_server_mech_step1(server_context_t *stext,
if (*qop) strcat(qop, ",");
strcat(qop, "auth-int");
}
-
+
#ifdef USE_UEF_SERVER
cipher = available_ciphers1;
#else
@@ -2615,18 +2616,18 @@ digestmd5_server_mech_step1(server_context_t *stext,
}
cipher++;
}
-
+
if (*qop == '\0') {
/* we didn't allow anything?!? we'll return SASL_TOOWEAK, since
that's close enough */
return SASL_TOOWEAK;
}
-
+
/*
* digest-challenge = 1#( realm | nonce | qop-options | stale | maxbuf |
* charset | cipher-opts | auth-param )
*/
-
+
#ifndef _SUN_SDK_
/* FIXME: get nonce XXX have to clean up after self if fail */
#endif /* !_SUN_SDK_ */
@@ -2641,7 +2642,7 @@ digestmd5_server_mech_step1(server_context_t *stext,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
+
#ifdef _SUN_SDK_
resplen = strlen((char *)nonce) + strlen("nonce") + 5;
#else
@@ -2657,9 +2658,9 @@ digestmd5_server_mech_step1(server_context_t *stext,
#else
if(result != SASL_OK) return result;
#endif /* _SUN_SDK_ */
-
+
sprintf(text->out_buf, "nonce=\"%s\"", nonce);
-
+
/* add to challenge; if we chose not to specify a realm, we won't
* send one to the client */
if (realm && add_to_challenge(sparams->utils,
@@ -2682,11 +2683,11 @@ digestmd5_server_mech_step1(server_context_t *stext,
* authentication with integrity protection; the value "auth-conf"
* indicates authentication with integrity protection and encryption.
*/
-
+
/* add qop to challenge */
if (add_to_challenge(sparams->utils,
&text->out_buf, &text->out_buf_len, &resplen,
- "qop",
+ "qop",
(unsigned char *) qop, TRUE) != SASL_OK) {
#ifdef _SUN_SDK_
sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
@@ -2697,7 +2698,7 @@ digestmd5_server_mech_step1(server_context_t *stext,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
+
/*
* Cipheropts - list of ciphers server supports
*/
@@ -2706,7 +2707,7 @@ digestmd5_server_mech_step1(server_context_t *stext,
{
if (add_to_challenge(sparams->utils,
&text->out_buf, &text->out_buf_len, &resplen,
- "cipher", (unsigned char *) cipheropts,
+ "cipher", (unsigned char *) cipheropts,
TRUE) != SASL_OK) {
#ifdef _SUN_SDK_
sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
@@ -2719,7 +2720,7 @@ digestmd5_server_mech_step1(server_context_t *stext,
return SASL_FAIL;
}
}
-
+
/* "stale" is true if a reauth failed because of a nonce timeout */
if (stext->stale &&
add_to_challenge(sparams->utils,
@@ -2735,7 +2736,7 @@ digestmd5_server_mech_step1(server_context_t *stext,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
+
/*
* maxbuf A number indicating the size of the largest buffer the server
* is able to receive when using "auth-int". If this directive is
@@ -2748,7 +2749,7 @@ digestmd5_server_mech_step1(server_context_t *stext,
sparams->props.maxbufsize);
if (add_to_challenge(sparams->utils,
&text->out_buf, &text->out_buf_len, &resplen,
- "maxbuf",
+ "maxbuf",
(unsigned char *) maxbufstr, FALSE) != SASL_OK) {
#ifdef _SUN_SDK_
sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
@@ -2760,11 +2761,11 @@ digestmd5_server_mech_step1(server_context_t *stext,
return SASL_FAIL;
}
}
-
+
if (add_to_challenge(sparams->utils,
&text->out_buf, &text->out_buf_len, &resplen,
- "charset",
+ "charset",
(unsigned char *) charset, FALSE) != SASL_OK) {
#ifdef _SUN_SDK_
sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
@@ -2775,19 +2776,19 @@ digestmd5_server_mech_step1(server_context_t *stext,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
-
+
+
/*
- * algorithm
- * This directive is required for backwards compatibility with HTTP
- * Digest., which supports other algorithms. . This directive is
- * required and MUST appear exactly once; if not present, or if multiple
- * instances are present, the client should abort the authentication
- * exchange.
+ * algorithm
+ * This directive is required for backwards compatibility with HTTP
+ * Digest., which supports other algorithms. . This directive is
+ * required and MUST appear exactly once; if not present, or if multiple
+ * instances are present, the client should abort the authentication
+ * exchange.
*
- * algorithm = "algorithm" "=" "md5-sess"
+ * algorithm = "algorithm" "=" "md5-sess"
*/
-
+
if (add_to_challenge(sparams->utils,
&text->out_buf, &text->out_buf_len, &resplen,
"algorithm",
@@ -2801,7 +2802,7 @@ digestmd5_server_mech_step1(server_context_t *stext,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
+
/*
* The size of a digest-challenge MUST be less than 2048 bytes!!!
*/
@@ -2823,12 +2824,12 @@ digestmd5_server_mech_step1(server_context_t *stext,
text->nonce_count = 1;
text->cnonce = NULL;
stext->timestamp = time(0);
-
+
*serveroutlen = strlen(text->out_buf);
*serverout = text->out_buf;
-
+
text->state = 2;
-
+
return SASL_CONTINUE;
}
@@ -2854,28 +2855,28 @@ digestmd5_server_mech_step2(server_context_t *stext,
char *qop = NULL;
char *digesturi = NULL;
char *response = NULL;
-
+
/* setting the default value (65536) */
unsigned int client_maxbuf = 65536;
int maxbuf_count = 0; /* How many maxbuf instaces was found */
-
+
char *charset = NULL;
char *cipher = NULL;
unsigned int n=0;
-
+
HASH A1;
-
+
/* password prop_request */
const char *password_request[] = { SASL_AUX_PASSWORD,
"*cmusaslsecretDIGEST-MD5",
NULL };
unsigned len;
struct propval auxprop_values[2];
-
+
/* can we mess with clientin? copy it to be safe */
char *in_start = NULL;
- char *in = NULL;
-
+ char *in = NULL;
+
sparams->utils->log(sparams->utils->conn, SASL_LOG_DEBUG,
"DIGEST-MD5 server step 2");
@@ -2883,29 +2884,29 @@ digestmd5_server_mech_step2(server_context_t *stext,
#ifdef _SUN_SDK_
if (!in) return SASL_NOMEM;
#endif /* _SUN_SDK_ */
-
+
memcpy(in, clientin, clientinlen);
in[clientinlen] = 0;
-
+
in_start = in;
-
-
+
+
/* parse what we got */
while (in[0] != '\0') {
char *name = NULL, *value = NULL;
get_pair(&in, &name, &value);
-
+
if (name == NULL)
break;
-
+
/* Extracting parameters */
-
+
/*
* digest-response = 1#( username | realm | nonce | cnonce |
* nonce-count | qop | digest-uri | response | maxbuf | charset |
* cipher | auth-param )
*/
-
+
if (strcasecmp(name, "username") == 0) {
_plug_strdup(sparams->utils, value, &username, NULL);
} else if (strcasecmp(name, "authzid") == 0) {
@@ -2947,7 +2948,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
/*
* digest-uri-value = serv-type "/" host [ "/" serv-name ]
*/
-
+
_plug_strdup(sparams->utils, value, &digesturi, NULL);
/* verify digest-uri format */
@@ -2961,14 +2962,14 @@ digestmd5_server_mech_step2(server_context_t *stext,
sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
"bad digest-uri: doesn't match service");
#else
- SETERROR(sparams->utils,
+ SETERROR(sparams->utils,
"bad digest-uri: doesn't match service");
#endif /* _SUN_SDK_ */
goto FreeAllMem;
}
/* xxx we don't verify the hostname component */
-
+
} else if (strcasecmp(name, "response") == 0) {
_plug_strdup(sparams->utils, value, &response, NULL);
} else if (strcasecmp(name, "cipher") == 0) {
@@ -3025,7 +3026,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
name, value);
}
}
-
+
/*
* username = "username" "=" <"> username-value <">
* username-value = qdstr-val cnonce = "cnonce" "=" <">
@@ -3144,7 +3145,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
result = SASL_BADAUTH;
goto FreeAllMem;
}
-
+
result = sparams->utils->prop_request(sparams->propctx, password_request);
if(result != SASL_OK) {
#ifdef _SUN_SDK_
@@ -3155,7 +3156,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
#endif /* _SUN_SDK_ */
goto FreeAllMem;
}
-
+
/* this will trigger the getting of the aux properties */
/* Note that if we don't have an authorization id, we don't use it... */
result = sparams->canon_user(sparams->utils->conn,
@@ -3169,7 +3170,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
#endif /* _SUN_SDK_ */
goto FreeAllMem;
}
-
+
if (!authorization_id || !*authorization_id) {
result = sparams->canon_user(sparams->utils->conn,
username, 0, SASL_CU_AUTHZID, oparams);
@@ -3178,7 +3179,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
authorization_id, 0, SASL_CU_AUTHZID,
oparams);
}
-
+
if (result != SASL_OK) {
#ifdef _SUN_SDK_
sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
@@ -3188,7 +3189,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
#endif /* _SUN_SDK_ */
goto FreeAllMem;
}
-
+
result = sparams->utils->prop_getnames(sparams->propctx, password_request,
auxprop_values);
if (result < 0 ||
@@ -3205,7 +3206,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
result = SASL_NOUSER;
goto FreeAllMem;
}
-
+
if (auxprop_values[0].name && auxprop_values[0].values) {
len = strlen(auxprop_values[0].values[0]);
if (len == 0) {
@@ -3219,7 +3220,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
result = SASL_FAIL;
goto FreeAllMem;
}
-
+
sec = sparams->utils->malloc(sizeof(sasl_secret_t) + len);
if (!sec) {
#ifdef _SUN_SDK_
@@ -3231,25 +3232,25 @@ digestmd5_server_mech_step2(server_context_t *stext,
result = SASL_FAIL;
goto FreeAllMem;
}
-
+
sec->len = len;
#ifdef _SUN_SDK_
- strncpy((char *)sec->data, auxprop_values[0].values[0], len + 1);
+ strncpy((char *)sec->data, auxprop_values[0].values[0], len + 1);
#else
- strncpy(sec->data, auxprop_values[0].values[0], len + 1);
+ strncpy(sec->data, auxprop_values[0].values[0], len + 1);
#endif /* _SUN_SDK_ */
-
+
/*
* Verifying response obtained from client
- *
+ *
* H_URP = H({ username-value,":",realm-value,":",passwd}) sec->data
* contains H_URP
*/
-
+
/* Calculate the secret from the plaintext password */
{
HASH HA1;
-
+
#ifdef _SUN_SDK_
DigestCalcSecret(sparams->utils, (unsigned char *)username,
(unsigned char *)text->realm, sec->data,
@@ -3258,16 +3259,16 @@ digestmd5_server_mech_step2(server_context_t *stext,
DigestCalcSecret(sparams->utils, username,
text->realm, sec->data, sec->len, HA1);
#endif /* _SUN_SDK_ */
-
+
/*
* A1 = { H( { username-value, ":", realm-value, ":", passwd } ),
* ":", nonce-value, ":", cnonce-value }
*/
-
+
memcpy(A1, HA1, HASHLEN);
A1[HASHLEN] = '\0';
}
-
+
/* We're done with sec now. Let's get rid of it */
_plug_free_secret(sparams->utils, &sec);
} else if (auxprop_values[1].name && auxprop_values[1].values) {
@@ -3287,18 +3288,18 @@ digestmd5_server_mech_step2(server_context_t *stext,
#else
return SASL_FAIL;
#endif /* _SUN_SDK_ */
- }
-
+ }
+
/* defaulting qop to "auth" if not specified */
if (qop == NULL) {
- _plug_strdup(sparams->utils, "auth", &qop, NULL);
+ _plug_strdup(sparams->utils, "auth", &qop, NULL);
}
-
+
/* check which layer/cipher to use */
if ((!strcasecmp(qop, "auth-conf")) && (cipher != NULL)) {
/* see what cipher was requested */
struct digest_cipher *cptr;
-
+
#ifdef USE_UEF_SERVER
cptr = available_ciphers1;
#else
@@ -3307,7 +3308,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
while (cptr->name) {
/* find the cipher requested & make sure it's one we're happy
with by policy */
- if (!strcasecmp(cipher, cptr->name) &&
+ if (!strcasecmp(cipher, cptr->name) &&
stext->requiressf <= cptr->ssf &&
stext->limitssf >= cptr->ssf) {
/* found it! */
@@ -3315,7 +3316,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
}
cptr++;
}
-
+
if (cptr->name) {
text->cipher_enc = cptr->cipher_enc;
text->cipher_dec = cptr->cipher_dec;
@@ -3335,7 +3336,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
result = SASL_FAIL;
goto FreeAllMem;
}
-
+
oparams->encode=&digestmd5_privacy_encode;
oparams->decode=&digestmd5_privacy_decode;
} else if (!strcasecmp(qop, "auth-int") &&
@@ -3358,7 +3359,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
result = SASL_FAIL;
goto FreeAllMem;
}
-
+
serverresponse = create_response(text,
sparams->utils,
text->nonce,
@@ -3369,7 +3370,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
A1,
authorization_id,
&text->response_value);
-
+
if (serverresponse == NULL) {
#ifndef _SUN_SDK_
SETERROR(sparams->utils, "internal error: unable to create response");
@@ -3377,7 +3378,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
result = SASL_NOMEM;
goto FreeAllMem;
}
-
+
/* if ok verified */
if (strcmp(serverresponse, response) != 0) {
#ifdef _INTEGRATED_SOLARIS_
@@ -3388,7 +3389,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
"client response doesn't match what we generated");
#endif /* _INTEGRATED_SOLARIS_ */
result = SASL_BADAUTH;
-
+
goto FreeAllMem;
}
@@ -3430,25 +3431,25 @@ digestmd5_server_mech_step2(server_context_t *stext,
/* MAC block (integrity) */
oparams->maxoutbuf -= 16;
}
-
+
oparams->param_version = 0;
-
+
text->seqnum = 0; /* for integrity/privacy */
text->rec_seqnum = 0; /* for integrity/privacy */
text->in_maxbuf =
sparams->props.maxbufsize ? sparams->props.maxbufsize : DEFAULT_BUFSIZE;
text->utils = sparams->utils;
-
+
/* used by layers */
text->needsize = 4;
text->buffer = NULL;
-
+
if (oparams->mech_ssf > 0) {
char enckey[16];
char deckey[16];
-
+
create_layer_keys(text, sparams->utils,text->HA1,n,enckey,deckey);
-
+
/* initialize cipher if need be */
#ifdef _SUN_SDK_
if (text->cipher_init) {
@@ -3468,13 +3469,13 @@ digestmd5_server_mech_step2(server_context_t *stext,
}
#endif /* _SUN_SDK_ */
}
-
+
/*
* The server receives and validates the "digest-response". The server
* checks that the nonce-count is "00000001". If it supports subsequent
* authentication, it saves the value of the nonce and the nonce-count.
*/
-
+
/*
* The "username-value", "realm-value" and "passwd" are encoded according
* to the value of the "charset" directive. If "charset=UTF-8" is
@@ -3483,30 +3484,30 @@ digestmd5_server_mech_step2(server_context_t *stext,
* UTF-8 before being hashed. A sample implementation of this conversion
* is in section 8.
*/
-
+
/* add to challenge */
{
unsigned resplen =
strlen(text->response_value) + strlen("rspauth") + 3;
-
+
result = _plug_buf_alloc(sparams->utils, &(text->out_buf),
&(text->out_buf_len), resplen);
if(result != SASL_OK) {
goto FreeAllMem;
}
-
+
sprintf(text->out_buf, "rspauth=%s", text->response_value);
-
+
/* self check */
if (strlen(text->out_buf) > 2048) {
result = SASL_FAIL;
goto FreeAllMem;
}
}
-
+
*serveroutlen = strlen(text->out_buf);
*serverout = text->out_buf;
-
+
result = SASL_OK;
FreeAllMem:
@@ -3548,7 +3549,7 @@ digestmd5_server_mech_step2(server_context_t *stext,
/* free everything */
if (in_start) sparams->utils->free (in_start);
-
+
if (username != NULL)
sparams->utils->free (username);
#ifdef _SUN_SDK_
@@ -3572,10 +3573,10 @@ digestmd5_server_mech_step2(server_context_t *stext,
if (digesturi != NULL)
sparams->utils->free (digesturi);
if (qop!=NULL)
- sparams->utils->free (qop);
+ sparams->utils->free (qop);
if (sec)
_plug_free_secret(sparams->utils, &sec);
-
+
return result;
}
@@ -3590,14 +3591,14 @@ digestmd5_server_mech_step(void *conn_context,
{
context_t *text = (context_t *) conn_context;
server_context_t *stext = (server_context_t *) conn_context;
-
+
if (clientinlen > 4096) return SASL_BADPROT;
-
+
*serverout = NULL;
*serveroutlen = 0;
-
+
switch (text->state) {
-
+
case 1:
/* setup SSF limits */
if (!sparams->props.maxbufsize) {
@@ -3644,12 +3645,12 @@ digestmd5_server_mech_step(void *conn_context,
return digestmd5_server_mech_step1(stext, sparams,
clientin, clientinlen,
serverout, serveroutlen, oparams);
-
+
case 2:
return digestmd5_server_mech_step2(stext, sparams,
clientin, clientinlen,
serverout, serveroutlen, oparams);
-
+
default:
#ifdef _SUN_SDK_
sparams->utils->log(sparams->utils->conn, SASL_LOG_ERR,
@@ -3660,7 +3661,7 @@ digestmd5_server_mech_step(void *conn_context,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
+
#ifndef _SUN_SDK_
return SASL_FAIL; /* should never get here */
#endif /* !_SUN_SDK_ */
@@ -3670,9 +3671,9 @@ static void
digestmd5_server_mech_dispose(void *conn_context, const sasl_utils_t *utils)
{
server_context_t *stext = (server_context_t *) conn_context;
-
+
if (!stext || !utils) return;
-
+
digestmd5_common_mech_dispose(conn_context, utils);
}
@@ -3684,7 +3685,7 @@ static sasl_server_plug_t digestmd5_server_plugins[] =
128, /* max_ssf */
#elif WITH_DES
112,
-#else
+#else
0,
#endif
SASL_SEC_NOPLAINTEXT
@@ -3708,7 +3709,7 @@ int digestmd5_server_plug_init(sasl_utils_t *utils,
int maxversion,
int *out_version,
sasl_server_plug_t **pluglist,
- int *plugcount)
+ int *plugcount)
{
reauth_cache_t *reauth_cache;
const char *timeout = NULL;
@@ -3778,7 +3779,7 @@ int digestmd5_server_plug_init(sasl_utils_t *utils,
*out_version = SASL_SERVER_PLUG_VERSION;
*pluglist = digestmd5_server_plugins;
*plugcount = 1;
-
+
return SASL_OK;
}
@@ -3812,14 +3813,14 @@ DigestCalcHA1(context_t * text,
{
MD5_CTX Md5Ctx;
HASH HA1;
-
+
DigestCalcSecret(utils,
pszUserName,
pszRealm,
(unsigned char *) pszPassword->data,
pszPassword->len,
HA1);
-
+
/* calculate the session key */
utils->MD5Init(&Md5Ctx);
utils->MD5Update(&Md5Ctx, HA1, HASHLEN);
@@ -3829,18 +3830,18 @@ DigestCalcHA1(context_t * text,
utils->MD5Update(&Md5Ctx, pszCNonce, strlen((char *) pszCNonce));
if (pszAuthorization_id != NULL) {
utils->MD5Update(&Md5Ctx, COLON, 1);
- utils->MD5Update(&Md5Ctx, pszAuthorization_id,
+ utils->MD5Update(&Md5Ctx, pszAuthorization_id,
strlen((char *) pszAuthorization_id));
}
utils->MD5Final(HA1, &Md5Ctx);
-
+
CvtHex(HA1, SessionKey);
-
+
/* xxx rc-* use different n */
-
+
/* save HA1 because we'll need it for the privacy and integrity keys */
memcpy(text->HA1, HA1, sizeof(HASH));
-
+
}
static char *calculate_response(context_t * text,
@@ -3860,23 +3861,23 @@ static char *calculate_response(context_t * text,
HASHHEX HEntity = "00000000000000000000000000000000";
HASHHEX Response;
char *result;
-
+
/* Verifing that all parameters was defined */
if(!username || !cnonce || !nonce || !ncvalue || !digesturi || !passwd) {
PARAMERROR( utils );
return NULL;
}
-
+
if (realm == NULL) {
/* a NULL realm is equivalent to the empty string */
realm = (unsigned char *) "";
}
-
+
if (qop == NULL) {
/* default to a qop of just authentication */
qop = "auth";
}
-
+
DigestCalcHA1(text,
utils,
username,
@@ -3886,7 +3887,7 @@ static char *calculate_response(context_t * text,
nonce,
cnonce,
SessionKey);
-
+
DigestCalcResponse(utils,
SessionKey,/* H(A1) */
nonce, /* nonce from server */
@@ -3899,7 +3900,7 @@ static char *calculate_response(context_t * text,
HEntity, /* H(entity body) if qop="auth-int" */
Response /* request-digest or response-digest */
);
-
+
result = utils->malloc(HASHHEXLEN + 1);
#ifdef _SUN_SDK_
if (result == NULL)
@@ -3907,7 +3908,7 @@ static char *calculate_response(context_t * text,
#endif /* _SUN_SDK_ */
memcpy(result, Response, HASHHEXLEN);
result[HASHHEXLEN] = 0;
-
+
if (response_value != NULL) {
DigestCalcResponse(utils,
SessionKey, /* H(A1) */
@@ -3921,7 +3922,7 @@ static char *calculate_response(context_t * text,
HEntity, /* H(entity body) if qop="auth-int" */
Response /* request-digest or response-digest */
);
-
+
#ifdef _SUN_SDK_
if (*response_value != NULL)
utils->free(*response_value);
@@ -3929,12 +3930,12 @@ static char *calculate_response(context_t * text,
*response_value = utils->malloc(HASHHEXLEN + 1);
if (*response_value == NULL)
return NULL;
-
+
memcpy(*response_value, Response, HASHHEXLEN);
(*response_value)[HASHHEXLEN] = 0;
-
+
}
-
+
return result;
}
@@ -3957,7 +3958,7 @@ make_client_response(context_t *text,
switch (ctext->protection) {
case DIGEST_PRIVACY:
qop = "auth-conf";
- oparams->encode = &digestmd5_privacy_encode;
+ oparams->encode = &digestmd5_privacy_encode;
oparams->decode = &digestmd5_privacy_decode;
oparams->mech_ssf = ctext->cipher->ssf;
@@ -3988,7 +3989,7 @@ make_client_response(context_t *text,
result = SASL_NOMEM;
goto FreeAllocatedMem;
};
-
+
/* allocated exactly this. safe */
strcpy((char *) digesturi, params->service);
strcat((char *) digesturi, "/");
@@ -4020,22 +4021,22 @@ make_client_response(context_t *text,
(char *) oparams->user : NULL,
#endif /* _SUN_SDK_ */
&text->response_value);
-
+
#ifdef _SUN_SDK_
if (response == NULL) {
result = SASL_NOMEM;
goto FreeAllocatedMem;
}
#endif /* _SUN_SDK_ */
-
+
resplen = strlen(oparams->authid) + strlen("username") + 5;
result =_plug_buf_alloc(params->utils, &(text->out_buf),
&(text->out_buf_len),
resplen);
if (result != SASL_OK) goto FreeAllocatedMem;
-
+
sprintf(text->out_buf, "username=\"%s\"", oparams->authid);
-
+
if (add_to_challenge(params->utils,
&text->out_buf, &text->out_buf_len, &resplen,
"realm", (unsigned char *) text->realm,
@@ -4084,7 +4085,7 @@ make_client_response(context_t *text,
if (ctext->cipher != NULL) {
if (add_to_challenge(params->utils,
&text->out_buf, &text->out_buf_len, &resplen,
- "cipher",
+ "cipher",
(unsigned char *) ctext->cipher->name,
TRUE) != SASL_OK) {
result = SASL_FAIL;
@@ -4096,7 +4097,7 @@ make_client_response(context_t *text,
snprintf(maxbufstr, sizeof(maxbufstr), "%d", params->props.maxbufsize);
if (add_to_challenge(params->utils,
&text->out_buf, &text->out_buf_len, &resplen,
- "maxbuf", (unsigned char *) maxbufstr,
+ "maxbuf", (unsigned char *) maxbufstr,
FALSE) != SASL_OK) {
#ifdef _SUN_SDK_
params->utils->log(params->utils->conn, SASL_LOG_ERR,
@@ -4108,7 +4109,7 @@ make_client_response(context_t *text,
goto FreeAllocatedMem;
}
}
-
+
if (IsUTF8) {
if (add_to_challenge(params->utils,
&text->out_buf, &text->out_buf_len, &resplen,
@@ -4128,11 +4129,11 @@ make_client_response(context_t *text,
&text->out_buf, &text->out_buf_len, &resplen,
"response", (unsigned char *) response,
FALSE) != SASL_OK) {
-
+
result = SASL_FAIL;
goto FreeAllocatedMem;
}
-
+
/* self check */
if (strlen(text->out_buf) > 2048) {
result = SASL_FAIL;
@@ -4160,25 +4161,25 @@ make_client_response(context_t *text,
/* MAC block (integrity) */
oparams->maxoutbuf -= 16;
}
-
+
text->seqnum = 0; /* for integrity/privacy */
text->rec_seqnum = 0; /* for integrity/privacy */
text->utils = params->utils;
-
+
text->in_maxbuf =
params->props.maxbufsize ? params->props.maxbufsize : DEFAULT_BUFSIZE;
/* used by layers */
text->needsize = 4;
text->buffer = NULL;
-
+
if (oparams->mech_ssf > 0) {
char enckey[16];
char deckey[16];
-
+
create_layer_keys(text, params->utils, text->HA1, nbits,
enckey, deckey);
-
+
/* initialize cipher if need be */
#ifdef _SUN_SDK_
if (text->cipher_init) {
@@ -4192,10 +4193,10 @@ make_client_response(context_t *text,
}
#else
if (text->cipher_init)
- text->cipher_init(text, enckey, deckey);
+ text->cipher_init(text, enckey, deckey);
#endif /* _SUN_SDK_ */
}
-
+
result = SASL_OK;
FreeAllocatedMem:
@@ -4239,10 +4240,10 @@ static int parse_server_challenge(client_context_t *ctext,
in_start = in = params->utils->malloc(serverinlen + 1);
if (in == NULL) return SASL_NOMEM;
-
+
memcpy(in, serverin, serverinlen);
in[serverinlen] = 0;
-
+
ctext->server_maxbuf = 65536; /* Default value for maxbuf */
/* create a new cnonce */
@@ -4262,9 +4263,9 @@ static int parse_server_challenge(client_context_t *ctext,
/* parse the challenge */
while (in[0] != '\0') {
char *name, *value;
-
+
get_pair(&in, &name, &value);
-
+
/* if parse error */
if (name == NULL) {
#ifdef _SUN_SDK_
@@ -4276,21 +4277,21 @@ static int parse_server_challenge(client_context_t *ctext,
result = SASL_FAIL;
goto FreeAllocatedMem;
}
-
+
if (strcasecmp(name, "realm") == 0) {
nrealm++;
-
+
if(!realms)
realms = params->utils->malloc(sizeof(char *) * (nrealm + 1));
else
- realms = params->utils->realloc(realms,
+ realms = params->utils->realloc(realms,
sizeof(char *) * (nrealm + 1));
-
+
if (realms == NULL) {
result = SASL_NOMEM;
goto FreeAllocatedMem;
}
-
+
_plug_strdup(params->utils, value, &realms[nrealm-1], NULL);
realms[nrealm] = NULL;
} else if (strcasecmp(name, "nonce") == 0) {
@@ -4303,7 +4304,7 @@ static int parse_server_challenge(client_context_t *ctext,
if (comma != NULL) {
*comma++ = '\0';
}
-
+
if (strcasecmp(value, "auth-conf") == 0) {
protection |= DIGEST_PRIVACY;
} else if (strcasecmp(value, "auth-int") == 0) {
@@ -4315,10 +4316,10 @@ static int parse_server_challenge(client_context_t *ctext,
"Server supports unknown layer: %s\n",
value);
}
-
+
value = comma;
}
-
+
if (protection == 0) {
result = SASL_BADAUTH;
#ifdef _INTEGRATED_SOLARIS_
@@ -4338,11 +4339,11 @@ static int parse_server_challenge(client_context_t *ctext,
#else
struct digest_cipher *cipher = available_ciphers;
#endif
-
+
if (comma != NULL) {
*comma++ = '\0';
}
-
+
/* do we support this cipher? */
while (cipher->name) {
if (!strcasecmp(value, cipher->name)) break;
@@ -4355,7 +4356,7 @@ static int parse_server_challenge(client_context_t *ctext,
"Server supports unknown cipher: %s\n",
value);
}
-
+
value = comma;
}
} else if (strcasecmp(name, "stale") == 0 && ctext->password) {
@@ -4369,10 +4370,10 @@ static int parse_server_challenge(client_context_t *ctext,
* "auth-int". If this directive is missing, the default
* value is 65536. This directive may appear at most once;
* if multiple instances are present, the client should
- * abort the authentication exchange.
+ * abort the authentication exchange.
*/
maxbuf_count++;
-
+
if (maxbuf_count != 1) {
result = SASL_BADAUTH;
#ifdef _SUN_SDK_
@@ -4437,7 +4438,7 @@ static int parse_server_challenge(client_context_t *ctext,
result = SASL_FAIL;
goto FreeAllocatedMem;
}
-
+
algorithm_count++;
if (algorithm_count > 1)
{
@@ -4457,7 +4458,7 @@ static int parse_server_challenge(client_context_t *ctext,
name, value);
}
}
-
+
if (algorithm_count != 1) {
#ifdef _SUN_SDK_
params->utils->log(params->utils->conn, SASL_LOG_ERR,
@@ -4485,7 +4486,7 @@ static int parse_server_challenge(client_context_t *ctext,
/* get requested ssf */
external = params->external_ssf;
-
+
/* what do we _need_? how much is too much? */
if (params->props.maxbufsize == 0) {
musthave = 0;
@@ -4502,12 +4503,12 @@ static int parse_server_challenge(client_context_t *ctext,
musthave = 0;
}
}
-
+
/* we now go searching for an option that gives us at least "musthave"
and at most "limit" bits of ssf. */
if ((limit > 1) && (protection & DIGEST_PRIVACY)) {
struct digest_cipher *cipher;
-
+
/* let's find an encryption scheme that we like */
#ifdef USE_UEF_CLIENT
cipher = available_ciphers1;
@@ -4525,7 +4526,7 @@ static int parse_server_challenge(client_context_t *ctext,
}
cipher++;
}
-
+
if (ctext->cipher) {
/* we found a cipher we like */
ctext->protection = DIGEST_PRIVACY;
@@ -4540,12 +4541,12 @@ static int parse_server_challenge(client_context_t *ctext,
#endif /* _INTEGRATED_SOLARIS_ */
}
}
-
+
if (ctext->cipher == NULL) {
/* we failed to find an encryption layer we liked;
can we use integrity or nothing? */
-
- if ((limit >= 1) && (musthave <= 1)
+
+ if ((limit >= 1) && (musthave <= 1)
&& (protection & DIGEST_INTEGRITY)) {
/* integrity */
ctext->protection = DIGEST_INTEGRITY;
@@ -4560,10 +4561,10 @@ static int parse_server_challenge(client_context_t *ctext,
/* See if server supports not having a layer */
if ((protection & DIGEST_NOLAYER) != DIGEST_NOLAYER) {
#ifdef _INTEGRATED_SOLARIS_
- params->utils->seterror(params->utils->conn, 0,
+ params->utils->seterror(params->utils->conn, 0,
gettext("Server doesn't support \"no layer\""));
#else
- params->utils->seterror(params->utils->conn, 0,
+ params->utils->seterror(params->utils->conn, 0,
"Server doesn't support \"no layer\"");
#endif /* _INTEGRATED_SOLARIS_ */
result = SASL_FAIL;
@@ -4590,11 +4591,11 @@ static int parse_server_challenge(client_context_t *ctext,
if (result != SASL_OK && realms) {
int lup;
-
+
/* need to free all the realms */
for (lup = 0;lup < nrealm; lup++)
params->utils->free(realms[lup]);
-
+
params->utils->free(realms);
}
@@ -4619,21 +4620,21 @@ static int ask_user_info(client_context_t *ctext,
/* try to get the authid */
if (oparams->authid == NULL) {
auth_result = _plug_get_authid(params->utils, &authid, prompt_need);
-
+
if ((auth_result != SASL_OK) && (auth_result != SASL_INTERACT)) {
return auth_result;
}
}
-
+
/* try to get the userid */
if (oparams->user == NULL) {
user_result = _plug_get_userid(params->utils, &userid, prompt_need);
-
+
if ((user_result != SASL_OK) && (user_result != SASL_INTERACT)) {
return user_result;
}
}
-
+
/* try to get the password */
if (ctext->password == NULL) {
pass_result = _plug_get_password(params->utils, &ctext->password,
@@ -4666,15 +4667,15 @@ static int ask_user_info(client_context_t *ctext,
} else {
return realm_result;
}
- }
+ }
}
-
+
/* free prompts we got */
if (prompt_need && *prompt_need) {
params->utils->free(*prompt_need);
*prompt_need = NULL;
}
-
+
/* if there are prompts not filled in */
if ((user_result == SASL_INTERACT) || (auth_result == SASL_INTERACT) ||
(pass_result == SASL_INTERACT) || (realm_result == SASL_INTERACT)) {
@@ -4729,12 +4730,12 @@ static int ask_user_info(client_context_t *ctext,
"Please enter your realm" : NULL,
params->serverFQDN ? params->serverFQDN : NULL);
#endif /* _INTEGRATED_SOLARIS_ */
-
+
if (result == SASL_OK) return SASL_INTERACT;
return result;
}
-
+
if (oparams->authid == NULL) {
if (!userid || !*userid) {
result = params->canon_user(params->utils->conn, authid, 0,
@@ -4766,17 +4767,17 @@ digestmd5_client_mech_new(void *glob_context,
void **conn_context)
{
context_t *text;
-
+
/* holds state are in -- allocate client size */
text = params->utils->malloc(sizeof(client_context_t));
if (text == NULL)
return SASL_NOMEM;
memset(text, 0, sizeof(client_context_t));
-
+
text->state = 1;
text->i_am = CLIENT;
text->reauth = glob_context;
-
+
*conn_context = text;
return SASL_OK;
@@ -4785,8 +4786,8 @@ digestmd5_client_mech_new(void *glob_context,
static int
digestmd5_client_mech_step1(client_context_t *ctext,
sasl_client_params_t *params,
- const char *serverin __attribute__((unused)),
- unsigned serverinlen __attribute__((unused)),
+ const char *serverin __attribute__((unused)),
+ unsigned serverinlen __attribute__((unused)),
sasl_interact_t **prompt_need,
const char **clientout,
unsigned *clientoutlen,
@@ -4851,7 +4852,7 @@ digestmd5_client_mech_step1(client_context_t *ctext,
* (username | realm | nonce | cnonce | nonce-count | qop digest-uri |
* response | maxbuf | charset | auth-param )
*/
-
+
result = make_client_response(text, params, oparams);
if (result != SASL_OK) return result;
@@ -4889,7 +4890,7 @@ digestmd5_client_mech_step2(client_context_t *ctext,
result = parse_server_challenge(ctext, params, serverin, serverinlen,
&realms, &nrealm);
if (result != SASL_OK) goto FreeAllocatedMem;
-
+
if (nrealm == 1) {
/* only one choice! */
text->realm = realms[0];
@@ -4908,7 +4909,7 @@ digestmd5_client_mech_step2(client_context_t *ctext,
* (username | realm | nonce | cnonce | nonce-count | qop digest-uri |
* response | maxbuf | charset | auth-param )
*/
-
+
result = make_client_response(text, params, oparams);
if (result != SASL_OK) goto FreeAllocatedMem;
@@ -4916,17 +4917,17 @@ digestmd5_client_mech_step2(client_context_t *ctext,
*clientout = text->out_buf;
text->state = 3;
-
+
result = SASL_CONTINUE;
-
+
FreeAllocatedMem:
if (realms) {
int lup;
-
+
/* need to free all the realms */
for (lup = 0;lup < nrealm; lup++)
params->utils->free(realms[lup]);
-
+
params->utils->free(realms);
}
@@ -4947,22 +4948,22 @@ digestmd5_client_mech_step3(client_context_t *ctext,
char *in = NULL;
char *in_start;
int result = SASL_FAIL;
-
+
params->utils->log(params->utils->conn, SASL_LOG_DEBUG,
"DIGEST-MD5 client step 3");
- /* Verify that server is really what he claims to be */
+ /* Verify that server is really what they claim to be */
in_start = in = params->utils->malloc(serverinlen + 1);
if (in == NULL) return SASL_NOMEM;
memcpy(in, serverin, serverinlen);
in[serverinlen] = 0;
-
+
/* parse the response */
while (in[0] != '\0') {
char *name, *value;
get_pair(&in, &name, &value);
-
+
if (name == NULL) {
#ifdef _SUN_SDK_
params->utils->log(params->utils->conn, SASL_LOG_ERR,
@@ -4973,9 +4974,9 @@ digestmd5_client_mech_step3(client_context_t *ctext,
#endif /* _SUN_SDK_ */
break;
}
-
+
if (strcasecmp(name, "rspauth") == 0) {
-
+
if (strcmp(text->response_value, value) != 0) {
#ifdef _INTEGRATED_SOLARIS_
params->utils->seterror(params->utils->conn, 0,
@@ -4988,7 +4989,7 @@ digestmd5_client_mech_step3(client_context_t *ctext,
} else {
oparams->doneflag = 1;
oparams->param_version = 0;
-
+
result = SASL_OK;
}
break;
@@ -4998,7 +4999,7 @@ digestmd5_client_mech_step3(client_context_t *ctext,
name, value);
}
}
-
+
params->utils->free(in_start);
if (params->utils->mutex_lock(text->reauth->mutex) == SASL_OK) { /* LOCK */
@@ -5054,9 +5055,9 @@ digestmd5_client_mech_step(void *conn_context,
context_t *text = (context_t *) conn_context;
client_context_t *ctext = (client_context_t *) conn_context;
unsigned val = hash(params->serverFQDN) % text->reauth->size;
-
+
if (serverinlen > 2048) return SASL_BADPROT;
-
+
*clientout = NULL;
*clientoutlen = 0;
@@ -5088,9 +5089,9 @@ digestmd5_client_mech_step(void *conn_context,
return SASL_CONTINUE;
}
}
-
+
/* fall through and respond to challenge */
-
+
case 3:
if (serverin && !strncasecmp(serverin, "rspauth=", 8)) {
return digestmd5_client_mech_step3(ctext, params,
@@ -5120,7 +5121,7 @@ digestmd5_client_mech_step(void *conn_context,
text->realm = text->nonce = text->cnonce = NULL;
#endif /* _SUN_SDK_ */
ctext->cipher = NULL;
-
+
case 2:
return digestmd5_client_mech_step2(ctext, params,
serverin, serverinlen,
@@ -5138,7 +5139,7 @@ digestmd5_client_mech_step(void *conn_context,
#endif /* _SUN_SDK_ */
return SASL_FAIL;
}
-
+
return SASL_FAIL; /* should never get here */
}
@@ -5146,9 +5147,9 @@ static void
digestmd5_client_mech_dispose(void *conn_context, const sasl_utils_t *utils)
{
client_context_t *ctext = (client_context_t *) conn_context;
-
+
if (!ctext || !utils) return;
-
+
#ifdef _INTEGRATED_SOLARIS_
convert_prompt(utils, &ctext->h, NULL);
#endif /* _INTEGRATED_SOLARIS_ */
@@ -5198,7 +5199,7 @@ int digestmd5_client_plug_init(sasl_utils_t *utils,
if (maxversion < SASL_CLIENT_PLUG_VERSION)
return SASL_BADVERS;
-
+
#if defined _SUN_SDK_ && defined USE_UEF
if ((ret = uef_init(utils)) != SASL_OK)
return ret;
@@ -5210,7 +5211,7 @@ int digestmd5_client_plug_init(sasl_utils_t *utils,
return SASL_NOMEM;
memset(reauth_cache, 0, sizeof(reauth_cache_t));
reauth_cache->i_am = CLIENT;
-
+
/* mutex */
reauth_cache->mutex = utils->mutex_alloc();
if (!reauth_cache->mutex)
@@ -5242,7 +5243,7 @@ int digestmd5_client_plug_init(sasl_utils_t *utils,
*out_version = SASL_CLIENT_PLUG_VERSION;
*pluglist = digestmd5_client_plugins;
*plugcount = 1;
-
+
return SASL_OK;
}
diff --git a/usr/src/lib/smbsrv/libmlsvc/common/smb_logon.c b/usr/src/lib/smbsrv/libmlsvc/common/smb_logon.c
index 24baa848e7..237968469e 100644
--- a/usr/src/lib/smbsrv/libmlsvc/common/smb_logon.c
+++ b/usr/src/lib/smbsrv/libmlsvc/common/smb_logon.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
#include <unistd.h>
@@ -263,7 +264,7 @@ smb_token_destroy(smb_token_t *token)
* Token owner should be set to local Administrators group
* in two cases:
* 1. The logged on user is a member of Domain Admins group
- * 2. he/she is a member of local Administrators group
+ * 2. They are a member of local Administrators group
*/
static void
smb_token_set_owner(smb_token_t *token)
diff --git a/usr/src/lib/smbsrv/libsmbns/common/smbns_netbios_name.c b/usr/src/lib/smbsrv/libsmbns/common/smbns_netbios_name.c
index 9bbaf0a2b6..063a505504 100644
--- a/usr/src/lib/smbsrv/libsmbns/common/smbns_netbios_name.c
+++ b/usr/src/lib/smbsrv/libsmbns/common/smbns_netbios_name.c
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
@@ -190,7 +191,7 @@ smb_end_node_challenge(nbt_name_reply_t *reply_info)
/*
* The response packet has in it the address of the presumed owner
* of the name. Challenge that owner. If owner either does not
- * respond or indicates that he no longer owns the name, claim the
+ * respond or indicates that they no longer own the name, claim the
* name. Otherwise, the name cannot be claimed.
*/
@@ -437,7 +438,7 @@ smb_netbios_process_response(uint16_t tid, addr_entry_t *addr,
* address of the presumed owner of the
* name. Challenge that owner. If
* owner either does not respond or
- * indicates that he no longer owns the
+ * indicates that they no longer own the
* name, claim the name. Otherwise,
* the name cannot be claimed.
*/
diff --git a/usr/src/lib/storage/liba5k/common/mon.c b/usr/src/lib/storage/liba5k/common/mon.c
index bc389a89d9..535a65cf99 100644
--- a/usr/src/lib/storage/liba5k/common/mon.c
+++ b/usr/src/lib/storage/liba5k/common/mon.c
@@ -21,6 +21,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
@@ -1303,7 +1304,7 @@ struct device_element *front_elem, *rear_elem;
* The string can also be NULL. This is the way the user
* chooses to not have a password.
*
- * I then tell the photon by giving him 4 NULL bytes.
+ * I then tell the photon by giving it 4 NULL bytes.
*
* RETURNS:
* 0 O.K.