From owner-svn-src-head@freebsd.org Fri Oct 2 08:58:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88EBFA0E97C; Fri, 2 Oct 2015 08:58:51 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 774E01168; Fri, 2 Oct 2015 08:58:51 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t928wpBB091772; Fri, 2 Oct 2015 08:58:51 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t928wpt6091771; Fri, 2 Oct 2015 08:58:51 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201510020858.t928wpt6091771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Oct 2015 08:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288482 - head/usr.sbin/rpc.yppasswdd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2015 08:58:51 -0000 Author: araujo Date: Fri Oct 2 08:58:50 2015 New Revision: 288482 URL: https://svnweb.freebsd.org/changeset/base/288482 Log: The rpc.yppasswdd has an option to not allow shell changes (-s), but is always passed a shell by the remote yppasswd. If an NIS client overrides the shell provided by the ypserv, then yppasswd (pam_unix, actually, afaict) will pass this new shell to the yppasswdd. If this shell has been set on the client to a shell which is invalid on the server, a user will never be able to change their password on the client. PR: 67142 Submitted by: russell@rucus.ru.ac.za Approved by: bapt (mentor) Sponsored by: EuroBSDCon Sweden. Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Fri Oct 2 08:33:06 2015 (r288481) +++ head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Fri Oct 2 08:58:50 2015 (r288482) @@ -212,12 +212,12 @@ validate(struct passwd *opw, struct x_pa * Don't allow the user to shoot himself in the foot, * even on purpose. */ - if (!ok_shell(npw->pw_shell)) { + if (!no_chsh && !ok_shell(npw->pw_shell)) { yp_error("%s is not a valid shell", npw->pw_shell); return(1); } - if (validchars(npw->pw_shell)) { + if (!no_chsh && validchars(npw->pw_shell)) { yp_error("specified shell contains invalid characters"); return(1); }