All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Todd.Miller@sparta.com
Cc: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: PATCH: libsemanage-1.10.0
Date: Tue, 20 Feb 2007 10:28:54 -0500	[thread overview]
Message-ID: <1171985334.14363.62.camel@moss-spartans.epoch.ncsc.mil> (raw)
In-Reply-To: <200702071709.l17H9rqk000601@tex.courtesan.com>

On Wed, 2007-02-07 at 12:09 -0500, Todd.Miller@sparta.com wrote:
> There is no advantage to using strnlen() over strlen() since buf is
> guaranteed to be a NUL-terminated string.
> 
>  - todd
> 
> --- libsemanage-1.10.0/src/semanage_store.c	2007-01-08 16:20:17.000000000 -0500
> +++ libsemanage-1.10.0/src/semanage_store.c	2007-02-06 17:04:41.000000000 -0500
> @@ -968,14 +968,14 @@
>  		if (!strncmp(buf, "HOME_DIR", 8) ||
>  		    !strncmp(buf, "HOME_ROOT", 9) || strstr(buf, "ROLE")) {
>  			/* This contains one of the template variables, write it to homedir.template */
> -			if (write(hd, buf, strnlen(buf, PATH_MAX)) == 0) {
> +			if (write(hd, buf, strlen(buf)) == 0) {
>  				ERR(sh, "Write to %s failed.",
>  				    semanage_path(SEMANAGE_TMP,
>  						  SEMANAGE_HOMEDIR_TMPL));
>  				goto cleanup;
>  			}
>  		} else {
> -			if (write(fc, buf, strnlen(buf, PATH_MAX)) == 0) {
> +			if (write(fc, buf, strlen(buf)) == 0) {
>  				ERR(sh, "Write to %s failed.",
>  				    semanage_path(SEMANAGE_TMP, SEMANAGE_FC));
>  				goto cleanup;
> 

Merged to -stable and to -trunk.

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

      reply	other threads:[~2007-02-20 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 17:09 PATCH: libsemanage-1.10.0 Todd.Miller
2007-02-20 15:28 ` Stephen Smalley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1171985334.14363.62.camel@moss-spartans.epoch.ncsc.mil \
    --to=sds@tycho.nsa.gov \
    --cc=Todd.Miller@sparta.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.