Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Apr 2001 14:03:36 -0400
From:      "Matthew Emmerton" <matt@gsicomp.on.ca>
To:        "Kherry Zamore" <dknj@dknj.org>, <freebsd-stable@FreeBSD.ORG>
Cc:        <freebsd-security@FreeBSD.ORG>
Subject:   Re: su change?
Message-ID:  <001f01c0bc68$681a2b20$1200a8c0@gsicomp.on.ca>
References:  <005401c0bc63$7cb36650$0202a8c0@majorzoot>

next in thread | previous in thread | raw e-mail | index | archive | help
> According to su.c, if the user you are changing to does not have a valid
> shell, su complains and exits.  A valid thing to do in today's security
> conscience society.  Now, lets say you want to become root to fix this
> invalid shell problem.. su's nature is to complain and exit.  The fix is
> rather simple, somewhere around line 310 in su.c is:
>
> if (!chshell(pwd->pw_shell) && ruid)
>     errx(1, "permission denied (shell).");
>
> The only thing we need to prepend to this is a check to see if we are
trying
> to su to root, which we should allow regardless of the shell specified:

I disagree.  The root account is an account that needs to have the highest
number of security checks present.  If you're swift enough to change root's
shell to something non-standard and forget to update /etc/shells, then
having to drop to single user mode is suitable punishment.  After all,
playing with the root user is like playing with fire -- sooner or later
you're going to get burned.

Just consider your friend lucky - doing similar things to the root account
on any enterprise UNIX (UnixWare, Solaris, AIX) could require a complete
reinstall - especially if it's running C2-level security.

--
Matt Emmerton


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001f01c0bc68$681a2b20$1200a8c0>