Return-Path: X-Original-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9A4A4B973 for ; Tue, 10 Jan 2012 17:23:37 +0000 (UTC) Received: (qmail 92465 invoked by uid 500); 10 Jan 2012 17:23:37 -0000 Delivered-To: apmail-incubator-accumulo-commits-archive@incubator.apache.org Received: (qmail 92423 invoked by uid 500); 10 Jan 2012 17:23:37 -0000 Mailing-List: contact accumulo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: accumulo-dev@incubator.apache.org Delivered-To: mailing list accumulo-commits@incubator.apache.org Received: (qmail 92412 invoked by uid 99); 10 Jan 2012 17:23:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jan 2012 17:23:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jan 2012 17:23:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6A36923888E4; Tue, 10 Jan 2012 17:23:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1229646 - /incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java Date: Tue, 10 Jan 2012 17:23:13 -0000 To: accumulo-commits@incubator.apache.org From: vines@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120110172313.6A36923888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vines Date: Tue Jan 10 17:23:13 2012 New Revision: 1229646 URL: http://svn.apache.org/viewvc?rev=1229646&view=rev Log: ACCUMULO-264 - merging to trunk Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java?rev=1229646&r1=1229645&r2=1229646&view=diff ============================================================================== --- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java (original) +++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java Tue Jan 10 17:23:13 2012 @@ -208,6 +208,15 @@ public final class ZKAuthenticator imple if (!hasSystemPermission(credentials, credentials.user, SystemPermission.CREATE_USER)) throw new AccumuloSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED); + if (!hasSystemPermission(credentials, credentials.user, SystemPermission.ALTER_USER)) { + Authorizations creatorAuths = getUserAuthorizations(credentials, credentials.user); + for (byte[] auth : authorizations.getAuthorizations()) + if (!creatorAuths.contains(auth)) { + log.info("User " + credentials.user + " attempted to create a user " + user + " with authorization " + new String(auth) + " they did not have"); + throw new AccumuloSecurityException(credentials.user, SecurityErrorCode.BAD_AUTHORIZATIONS); + } + } + // don't allow creating a user with the same name as system user if (user.equals(SecurityConstants.SYSTEM_USERNAME)) throw new AccumuloSecurityException(user, SecurityErrorCode.PERMISSION_DENIED);