svn commit: r309872 - stable/11/usr.sbin/ypldap
Marcelo Araujo
araujo at FreeBSD.org
Mon Dec 12 02:24:55 UTC 2016
Author: araujo
Date: Mon Dec 12 02:24:54 2016
New Revision: 309872
URL: https://svnweb.freebsd.org/changeset/base/309872
Log:
MFC r309392, r309393
r309392:
String terminators are called NUL, not NULL, also the variable
mentioned in the comment is p and not u.
Obtained from: OpenBSD (r1.34)
r309393:
Use memset(3) instead of bzero(3).
Obtained from: OpenBSD (r1.12, r1.20, r1.18 and r1.37)
Modified:
stable/11/usr.sbin/ypldap/aldap.c
stable/11/usr.sbin/ypldap/ldapclient.c
stable/11/usr.sbin/ypldap/yp.c
stable/11/usr.sbin/ypldap/ypldap.c
stable/11/usr.sbin/ypldap/ypldap_dns.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/usr.sbin/ypldap/aldap.c
==============================================================================
--- stable/11/usr.sbin/ypldap/aldap.c Mon Dec 12 02:24:46 2016 (r309871)
+++ stable/11/usr.sbin/ypldap/aldap.c Mon Dec 12 02:24:54 2016 (r309872)
@@ -1206,7 +1206,7 @@ isu8cont(unsigned char c)
/*
* Parse a LDAP value
* notes:
- * the argument u should be a NULL terminated sequence of ASCII bytes.
+ * the argument p should be a NUL-terminated sequence of ASCII bytes.
*/
char *
parseval(char *p, size_t len)
Modified: stable/11/usr.sbin/ypldap/ldapclient.c
==============================================================================
--- stable/11/usr.sbin/ypldap/ldapclient.c Mon Dec 12 02:24:46 2016 (r309871)
+++ stable/11/usr.sbin/ypldap/ldapclient.c Mon Dec 12 02:24:54 2016 (r309872)
@@ -363,7 +363,7 @@ ldapclient(int pipe_main2client[2])
return (pid);
}
- bzero(&env, sizeof(env));
+ memset(&env, 0, sizeof(env));
TAILQ_INIT(&env.sc_idms);
if ((pw = getpwnam(YPLDAP_USER)) == NULL)
@@ -437,7 +437,7 @@ client_build_req(struct idm *idm, struct
char **ldap_attrs;
int i, k;
- bzero(ir, sizeof(*ir));
+ memset(ir, 0, sizeof(*ir));
for (i = min_attr; i < max_attr; i++) {
if (idm->idm_flags & F_FIXED_ATTR(i)) {
if (strlcat(ir->ir_line, idm->idm_attrs[i],
@@ -594,7 +594,7 @@ client_try_idm(struct env *env, struct i
aldap_freemsg(m);
}
- bzero(attrs, sizeof(attrs));
+ memset(attrs, 0, sizeof(attrs));
for (i = 0, j = 0; i < ATTR_MAX; i++) {
if (idm->idm_flags & F_FIXED_ATTR(i))
continue;
@@ -611,7 +611,7 @@ client_try_idm(struct env *env, struct i
idm->idm_filters[FILTER_USER], 0, ATTR_MAX, IMSG_PW_ENTRY) == -1)
goto bad;
- bzero(attrs, sizeof(attrs));
+ memset(attrs, 0, sizeof(attrs));
for (i = ATTR_GR_MIN, j = 0; i < ATTR_GR_MAX; i++) {
if (idm->idm_flags & F_FIXED_ATTR(i))
continue;
Modified: stable/11/usr.sbin/ypldap/yp.c
==============================================================================
--- stable/11/usr.sbin/ypldap/yp.c Mon Dec 12 02:24:46 2016 (r309871)
+++ stable/11/usr.sbin/ypldap/yp.c Mon Dec 12 02:24:54 2016 (r309872)
@@ -342,7 +342,7 @@ ypproc_match_2_svc(ypreq_key *arg, struc
log_debug("argument too long");
return (NULL);
}
- bzero(key, sizeof(key));
+ memset(key, 0, sizeof(key));
(void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len);
if (strcmp(arg->map, "passwd.byname") == 0 ||
@@ -486,7 +486,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct
if (strcmp(arg->map, "passwd.byname") == 0 ||
strcmp(arg->map, "master.passwd.byname") == 0) {
- bzero(key, sizeof(key));
+ memset(key, 0, sizeof(key));
(void)strncpy(key, arg->key.keydat_val,
arg->key.keydat_len);
ukey.ue_line = key;
@@ -517,7 +517,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct
} else if (strcmp(arg->map, "group.byname") == 0) {
- bzero(key, sizeof(key));
+ memset(key, 0, sizeof(key));
(void)strncpy(key, arg->key.keydat_val,
arg->key.keydat_len);
@@ -567,7 +567,7 @@ ypproc_master_2_svc(ypreq_nokey *arg, st
static struct ypresp_master res;
static char master[YPMAXPEER + 1];
- bzero(&res, sizeof(res));
+ memset(&res, 0, sizeof(res));
if (yp_valid_domain(arg->domain, (struct ypresp_val *)&res) == -1)
return (&res);
@@ -620,7 +620,7 @@ yp_make_val(struct ypresp_val *res, char
{
static char buf[LINE_WIDTH];
- bzero(buf, sizeof(buf));
+ memset(buf, 0, sizeof(buf));
if (replacecolon)
line[strlen(line)] = ':';
@@ -640,8 +640,8 @@ yp_make_keyval(struct ypresp_key_val *re
static char keybuf[YPMAXRECORD+1];
static char buf[LINE_WIDTH];
- bzero(keybuf, sizeof(keybuf));
- bzero(buf, sizeof(buf));
+ memset(keybuf, 0, sizeof(keybuf));
+ memset(buf, 0, sizeof(buf));
(void)strlcpy(keybuf, key, sizeof(keybuf));
res->key.keydat_len = strlen(keybuf);
Modified: stable/11/usr.sbin/ypldap/ypldap.c
==============================================================================
--- stable/11/usr.sbin/ypldap/ypldap.c Mon Dec 12 02:24:46 2016 (r309871)
+++ stable/11/usr.sbin/ypldap/ypldap.c Mon Dec 12 02:24:54 2016 (r309872)
@@ -609,7 +609,7 @@ main(int argc, char *argv[])
#warning disabling privilege revocation in debug mode
#endif
- bzero(&tv, sizeof(tv));
+ memset(&tv, 0, sizeof(tv));
evtimer_set(&ev_timer, main_init_timer, &env);
evtimer_add(&ev_timer, &tv);
Modified: stable/11/usr.sbin/ypldap/ypldap_dns.c
==============================================================================
--- stable/11/usr.sbin/ypldap/ypldap_dns.c Mon Dec 12 02:24:46 2016 (r309871)
+++ stable/11/usr.sbin/ypldap/ypldap_dns.c Mon Dec 12 02:24:54 2016 (r309872)
@@ -212,7 +212,7 @@ host_dns(const char *s, struct ypldap_ad
struct sockaddr_in6 *sa_in6;
struct ypldap_addr *h;
- bzero(&hints, sizeof(hints));
+ memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
error = getaddrinfo(s, NULL, &hints, &res0);
More information about the svn-src-stable-11
mailing list