From: Karel Zak <kzak@redhat.com>
To: Cody Maloney <cmaloney@theoreticalchaos.com>
Cc: util-linux@vger.kernel.org, mitr@redhat.com
Subject: Re: [PATCH v3 4/4] chfn: Add libuser support
Date: Wed, 13 Feb 2013 14:15:39 +0100 [thread overview]
Message-ID: <20130213131539.GE7799@x2.net.home> (raw)
In-Reply-To: <1360218141-4463-5-git-send-email-cmaloney@theoreticalchaos.com>
On Wed, Feb 06, 2013 at 11:22:21PM -0700, Cody Maloney wrote:
> @@ -149,17 +156,24 @@ int main(int argc, char **argv)
> }
> #endif
>
> - /* Reality check */
> - if (uid != 0 && uid != oldf.pw->pw_uid) {
^^^^^^^^^^^^^^^
> +#ifdef HAVE_LIBUSER
> + /* If we're setuid and not really root, disallow the password change. */
> + if (geteuid() != getuid() && uid != pw->pw_uid) {
> +#else
> + if (uid != 0 && uid != pw->pw_uid) {
> +#endif
Copy & past from chsh, right?
login-utils/chfn.c: In function ‘main’:
login-utils/chfn.c:161:38: error: ‘pw’ undeclared (first use in this function)
login-utils/chfn.c:161:38: note: each undeclared identifier is
reported only once for each function it appears in
> errno = EACCES;
> - err(EXIT_FAILURE, NULL);
> + err(EXIT_FAILURE, _("running UID doesn't match UID of user we're "
> + "altering, change denied")););
^^^
> }
login-utils/chfn.c:167:37: error: expected statement before ‘)’ token
Man, that's suid binary...
Fixed and applied.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2013-02-13 13:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 6:22 [PATCH v3 0/4] Add support for using libuser to chsh and chfn Cody Maloney
2013-02-07 6:22 ` [PATCH v3 1/4] chsh-chfn: Add flag for enabling/disabling libuser support Cody Maloney
2013-02-13 12:51 ` Karel Zak
2013-02-07 6:22 ` [PATCH v3 2/4] chsh-chfn: Move pam auth to its own function, factoring out common code Cody Maloney
2013-02-13 12:53 ` Karel Zak
2013-02-13 20:33 ` Cody Maloney
2013-02-07 6:22 ` [PATCH v3 3/4] chsh: Add libuser support Cody Maloney
2013-02-13 12:55 ` Karel Zak
2013-02-07 6:22 ` [PATCH v3 4/4] chfn: " Cody Maloney
2013-02-13 13:15 ` Karel Zak [this message]
2013-02-13 20:38 ` Cody Maloney
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=20130213131539.GE7799@x2.net.home \
--to=kzak@redhat.com \
--cc=cmaloney@theoreticalchaos.com \
--cc=mitr@redhat.com \
--cc=util-linux@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox