From: Michael C Thompson <thompsmc@us.ibm.com>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: SE Linux <selinux@tycho.nsa.gov>, Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [PATCH 2/8] make newrole suid (take 3)
Date: Tue, 07 Nov 2006 13:41:02 -0600 [thread overview]
Message-ID: <4550E14E.2030703@us.ibm.com> (raw)
In-Reply-To: <20061107045404.GA11273@sergelap.austin.ibm.com>
Serge E. Hallyn wrote:
> Quoting Michael C Thompson (thompsmc@us.ibm.com):
>> + setpwent();
>> + pw = getpwuid(uid);
>> + endpwent();
>
> Why the set/endpwent() calls? The original code didn't have them,
> and you aren't useing getpwent() so they don't seem to do anything.
Good point, I'm sure I had some (flawed) reason for doing it, but it
doesn't seem to have made sense. I'll remove these extra calls.
>> + if (!(pw && pw->pw_name && pw->pw_name[0] && pw->pw_shell
>> + && pw->pw_shell[0] && pw->pw_dir && pw->pw_dir[0])) {
>> + fprintf(stderr,
>> + _("cannot find valid entry in the passwd file.\n"));
>> + return -1;
>> + }
>> +
>> + *pw_copy = *pw;
>> + pw = pw_copy;
>> + pw->pw_name = strdup(pw->pw_name);
>
> You switched from xstrdup to strdup - don't know whether that means
> anything...
Yes, I did this because of a misunderstanding I had with the naming
scheme of xstrdup, which is supposed to suceeded or exit. However, since
I've changed the code to do better cleanup on errors, I've changed the
calls to strdup and then do checks to ensure it succeeded.
>> + pw->pw_dir = strdup(pw->pw_dir);
>> + pw->pw_shell = strdup(pw->pw_shell);
>
> -serge
--
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.
next prev parent reply other threads:[~2006-11-07 19:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-03 0:37 [PATCH 0/8] make newrole suid (take 3) Michael C Thompson
2006-11-03 1:02 ` [PATCH 1/8] " Michael C Thompson
2006-11-03 1:03 ` [PATCH 2/8] " Michael C Thompson
2006-11-07 4:54 ` Serge E. Hallyn
2006-11-07 19:41 ` Michael C Thompson [this message]
2006-11-03 1:04 ` [PATCH 3/8] " Michael C Thompson
2006-11-03 1:05 ` [PATCH 4/8] " Michael C Thompson
2006-11-07 5:23 ` Serge E. Hallyn
2006-11-07 20:09 ` Michael C Thompson
2006-11-08 17:32 ` Serge E. Hallyn
2006-11-08 19:35 ` Michael C Thompson
2006-11-09 5:15 ` Serge E. Hallyn
2006-11-09 13:57 ` Stephen Smalley
2006-11-09 16:37 ` Serge E. Hallyn
2006-11-09 20:06 ` Stephen Smalley
2006-11-09 21:21 ` Serge E. Hallyn
2006-11-09 20:22 ` Michael C Thompson
2006-11-09 20:27 ` Stephen Smalley
2006-11-03 1:05 ` [PATCH 5/8] " Michael C Thompson
2006-11-03 1:06 ` [PATCH 6/8] " Michael C Thompson
2006-11-03 1:06 ` [PATCH 7/8] " Michael C Thompson
2006-11-03 1:07 ` [PATCH 8/8] " Michael C Thompson
2006-11-14 0:08 ` [PATCH 0/8] " Stephen Smalley
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=4550E14E.2030703@us.ibm.com \
--to=thompsmc@us.ibm.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=serue@us.ibm.com \
/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.