diff --git a/beeline/src/test/org/apache/hive/beeline/ProxyAuthTest.java b/beeline/src/test/org/apache/hive/beeline/ProxyAuthTest.java index f6bb674..0a08389 100644 --- a/beeline/src/test/org/apache/hive/beeline/ProxyAuthTest.java +++ b/beeline/src/test/org/apache/hive/beeline/ProxyAuthTest.java @@ -202,7 +202,7 @@ public static void main(String[] args) throws Exception { } private static void storeTokenInJobConf(String tokenStr) throws Exception { - Utils.setTokenStr(Utils.getUGIForConf(new Configuration()), + Utils.setTokenStr(Utils.getUGI(), tokenStr, HiveAuthFactory.HS2_CLIENT_TOKEN); System.out.println("Stored token " + tokenStr); } diff --git a/common/src/java/org/apache/hadoop/hive/common/FileUtils.java b/common/src/java/org/apache/hadoop/hive/common/FileUtils.java index 2431e1a..3c34d7a 100644 --- a/common/src/java/org/apache/hadoop/hive/common/FileUtils.java +++ b/common/src/java/org/apache/hadoop/hive/common/FileUtils.java @@ -375,7 +375,7 @@ public static Path getPathOrParentThatExists(FileSystem fs, Path path) throws IO public static void checkFileAccessWithImpersonation(final FileSystem fs, final FileStatus stat, final FsAction action, final String user) throws IOException, AccessControlException, InterruptedException, Exception { - UserGroupInformation ugi = Utils.getUGIForConf(fs.getConf()); + UserGroupInformation ugi = Utils.getUGI(); String currentUser = ugi.getShortUserName(); if (user == null || currentUser.equals(user)) { diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 6f6edb3..2e2bf5a 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2761,7 +2761,7 @@ public static URL getHiveServer2SiteLocation() { */ public String getUser() throws IOException { try { - UserGroupInformation ugi = Utils.getUGIForConf(this); + UserGroupInformation ugi = Utils.getUGI(); return ugi.getUserName(); } catch (LoginException le) { throw new IOException(le); diff --git a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HiveClientCache.java b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HiveClientCache.java index df25fea..a001252 100644 --- a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HiveClientCache.java +++ b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HiveClientCache.java @@ -255,7 +255,7 @@ public CacheableHiveMetaStoreClient call() throws MetaException { private HiveClientCacheKey(HiveConf hiveConf, final int threadId) throws IOException, LoginException { this.metaStoreURIs = hiveConf.getVar(HiveConf.ConfVars.METASTOREURIS); - ugi = Utils.getUGIForConf(hiveConf); + ugi = Utils.getUGI(); this.hiveConf = hiveConf; this.threadId = threadId; } diff --git a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/MiniHiveKdc.java b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/MiniHiveKdc.java index 2c47912..dedbf35 100644 --- a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/MiniHiveKdc.java +++ b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/MiniHiveKdc.java @@ -131,7 +131,7 @@ public UserGroupInformation loginUser(String principal) throws Exception { UserGroupInformation.loginUserFromKeytab(principal, getKeyTabFile(principal)); - return Utils.getUGIForConf(conf); + return Utils.getUGI(); } public Properties getKdcConf() { diff --git a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestMiniHiveKdc.java b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestMiniHiveKdc.java index 4998031..abfd662 100644 --- a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestMiniHiveKdc.java +++ b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestMiniHiveKdc.java @@ -62,7 +62,7 @@ public void testLogin() throws Exception { assertNotNull(servicePrinc); miniHiveKdc.loginUser(servicePrinc); assertTrue(UserGroupInformation.isLoginKeytabBased()); - UserGroupInformation ugi = Utils.getUGIForConf(hiveConf); + UserGroupInformation ugi = Utils.getUGI(); assertEquals(MiniHiveKdc.HIVE_SERVICE_PRINCIPAL, ugi.getShortUserName()); } diff --git a/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationProviderWithACL.java b/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationProviderWithACL.java index 7f063d0..8baa539 100644 --- a/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationProviderWithACL.java +++ b/itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationProviderWithACL.java @@ -57,7 +57,7 @@ protected HiveConf createHiveConf() throws Exception { // Hadoop FS ACLs do not work with LocalFileSystem, so set up MiniDFS. HiveConf conf = super.createHiveConf(); - String currentUserName = Utils.getUGIForConf(conf).getShortUserName(); + String currentUserName = Utils.getUGI().getShortUserName(); conf.set("dfs.namenode.acls.enabled", "true"); conf.set("hadoop.proxyuser." + currentUserName + ".groups", "*"); conf.set("hadoop.proxyuser." + currentUserName + ".hosts", "*"); diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/StorageBasedMetastoreTestBase.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/StorageBasedMetastoreTestBase.java index 2d03e95..157ce62 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/StorageBasedMetastoreTestBase.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/StorageBasedMetastoreTestBase.java @@ -91,7 +91,7 @@ public void setUp() throws Exception { clientHiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, ""); clientHiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, ""); - ugi = Utils.getUGIForConf(clientHiveConf); + ugi = Utils.getUGI(); SessionState.start(new CliSessionState(clientHiveConf)); msc = new HiveMetaStoreClient(clientHiveConf, null); diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestClientSideAuthorizationProvider.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestClientSideAuthorizationProvider.java index e5318ca..eedfbca 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestClientSideAuthorizationProvider.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestClientSideAuthorizationProvider.java @@ -83,7 +83,7 @@ protected void setUp() throws Exception { clientHiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, ""); clientHiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, ""); - ugi = Utils.getUGIForConf(clientHiveConf); + ugi = Utils.getUGI(); SessionState.start(new CliSessionState(clientHiveConf)); msc = new HiveMetaStoreClient(clientHiveConf, null); diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestMetastoreAuthorizationProvider.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestMetastoreAuthorizationProvider.java index d63b41a..4529ce3 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestMetastoreAuthorizationProvider.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestMetastoreAuthorizationProvider.java @@ -110,7 +110,7 @@ protected void setUp() throws Exception { clientHiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, ""); clientHiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, ""); - ugi = Utils.getUGIForConf(clientHiveConf); + ugi = Utils.getUGI(); SessionState.start(new CliSessionState(clientHiveConf)); msc = new HiveMetaStoreClient(clientHiveConf, null); diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationDrops.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationDrops.java index 0a50b79..bb65ee7 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationDrops.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationDrops.java @@ -43,7 +43,7 @@ protected HiveConf createHiveConf() throws Exception { // Hadoop FS ACLs do not work with LocalFileSystem, so set up MiniDFS. HiveConf conf = super.createHiveConf(); - String currentUserName = Utils.getUGIForConf(conf).getShortUserName(); + String currentUserName = Utils.getUGI().getShortUserName(); conf.set("hadoop.proxyuser." + currentUserName + ".groups", "*"); conf.set("hadoop.proxyuser." + currentUserName + ".hosts", "*"); dfs = ShimLoader.getHadoopShims().getMiniDfs(conf, 4, true, null); diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 77a40fa..2547da7 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -331,7 +331,7 @@ private final void logAuditEvent(String cmd) { UserGroupInformation ugi; try { - ugi = Utils.getUGIForConf(getConf()); + ugi = Utils.getUGI(); } catch (Exception ex) { throw new RuntimeException(ex); } diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index a9e1cbf..4ebf987 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -404,7 +404,7 @@ private void open() throws MetaException { if (isConnected && !useSasl && conf.getBoolVar(ConfVars.METASTORE_EXECUTE_SET_UGI)){ // Call set_ugi, only in unsecure mode. try { - UserGroupInformation ugi = Utils.getUGIForConf(conf); + UserGroupInformation ugi = Utils.getUGI(); client.set_ugi(ugi.getUserName(), Arrays.asList(ugi.getGroupNames())); } catch (LoginException e) { LOG.warn("Failed to do login. set_ugi() is not successful, " + diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java b/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java index f824da3..9f63168 100755 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java @@ -262,7 +262,7 @@ public boolean isWritable(Path path) throws IOException { } final UserGroupInformation ugi; try { - ugi = Utils.getUGIForConf(conf); + ugi = Utils.getUGI(); } catch (LoginException le) { throw new IOException(le); } diff --git a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java index dcb5634..395a5f5 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java @@ -1349,7 +1349,7 @@ public int execute() throws CommandNeedRetryException { perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.PRE_HOOK + peh.getClass().getName()); ((PreExecute) peh).run(SessionState.get(), plan.getInputs(), plan.getOutputs(), - Utils.getUGIForConf(conf)); + Utils.getUGI()); perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.PRE_HOOK + peh.getClass().getName()); } @@ -1518,7 +1518,7 @@ public int execute() throws CommandNeedRetryException { ((PostExecute) peh).run(SessionState.get(), plan.getInputs(), plan.getOutputs(), (SessionState.get() != null ? SessionState.get().getLineageState().getLineageInfo() - : null), Utils.getUGIForConf(conf)); + : null), Utils.getUGI()); perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.POST_HOOK + peh.getClass().getName()); } diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java index e4f910d..9f3df99 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java @@ -239,7 +239,7 @@ public int executeInChildVM(DriverContext driverContext) { //Set HADOOP_USER_NAME env variable for child process, so that // it also runs with hadoop permissions for the user the job is running as // This will be used by hadoop only in unsecure(/non kerberos) mode - String endUserName = Utils.getUGIForConf(job).getShortUserName(); + String endUserName = Utils.getUGI().getShortUserName(); LOG.debug("setting HADOOP_USER_NAME\t" + endUserName); variables.put("HADOOP_USER_NAME", endUserName); diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java index ed68141..033f463 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java @@ -760,7 +760,7 @@ public PreWarmVertex createPreWarmVertex(TezConfiguration conf, */ @SuppressWarnings("deprecation") public Path getDefaultDestDir(Configuration conf) throws LoginException, IOException { - UserGroupInformation ugi = Utils.getUGIForConf(conf); + UserGroupInformation ugi = Utils.getUGI(); String userName = ugi.getShortUserName(); String userPathStr = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_USER_INSTALL_DIR); Path userPath = new Path(userPathStr); @@ -1124,7 +1124,7 @@ public Path createTezDir(Path scratchDir, Configuration conf) UserGroupInformation ugi; String userName = System.getProperty("user.name"); try { - ugi = Utils.getUGIForConf(conf); + ugi = Utils.getUGI(); userName = ugi.getShortUserName(); } catch (LoginException e) { throw new IOException(e); diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java index 9f6c31c..1798201 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java @@ -213,7 +213,7 @@ private boolean canWorkWithSameSession(TezSessionState session, HiveConf conf) } try { - UserGroupInformation ugi = Utils.getUGIForConf(conf); + UserGroupInformation ugi = Utils.getUGI(); String userName = ugi.getShortUserName(); LOG.info("The current user: " + userName + ", session user: " + session.getUser()); if (userName.equals(session.getUser()) == false) { diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java index 3d01142..89286e5 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java @@ -137,7 +137,7 @@ public void open(HiveConf conf, String[] additionalFiles) this.queueName = conf.get("tez.queue.name"); this.doAsEnabled = conf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS); - UserGroupInformation ugi = Utils.getUGIForConf(conf); + UserGroupInformation ugi = Utils.getUGI(); user = ugi.getShortUserName(); LOG.info("User of session id " + sessionId + " is " + user); diff --git a/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java b/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java index 123bb5c..5a33655 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java @@ -62,7 +62,7 @@ public HookContext(QueryPlan queryPlan, HiveConf conf, completeTaskList = new ArrayList(); inputs = queryPlan.getInputs(); outputs = queryPlan.getOutputs(); - ugi = Utils.getUGIForConf(conf); + ugi = Utils.getUGI(); linfo= null; if(SessionState.get() != null){ linfo = SessionState.get().getLineageState().getLineageInfo(); diff --git a/ql/src/java/org/apache/hadoop/hive/ql/security/HadoopDefaultAuthenticator.java b/ql/src/java/org/apache/hadoop/hive/ql/security/HadoopDefaultAuthenticator.java index 98ca79b..18e4e00 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/security/HadoopDefaultAuthenticator.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/security/HadoopDefaultAuthenticator.java @@ -50,7 +50,7 @@ public void setConf(Configuration conf) { this.conf = conf; UserGroupInformation ugi = null; try { - ugi = Utils.getUGIForConf(conf); + ugi = Utils.getUGI(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java b/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java index 1949ea5..1b5864e 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java @@ -424,7 +424,7 @@ public static SessionState start(SessionState startSs) { // shared with SessionState, other parts of the code might update the config, but // Hive.get(HiveConf) would not recognize the case when it needs refreshing Hive.get(new HiveConf(startSs.conf)).getMSC(); - UserGroupInformation sessionUGI = Utils.getUGIForConf(startSs.conf); + UserGroupInformation sessionUGI = Utils.getUGI(); FileSystem.get(startSs.conf); // Create scratch dirs for this session diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/tez/SampleTezSessionState.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/tez/SampleTezSessionState.java index ac861c6..d55c9fe 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/exec/tez/SampleTezSessionState.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/tez/SampleTezSessionState.java @@ -60,7 +60,7 @@ public void setOpen(boolean open) { public void open(HiveConf conf) throws IOException, LoginException, URISyntaxException, TezException { this.hiveConf = conf; - UserGroupInformation ugi = Utils.getUGIForConf(conf); + UserGroupInformation ugi = Utils.getUGI(); user = ugi.getShortUserName(); this.doAsEnabled = conf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS); } diff --git a/service/src/java/org/apache/hive/service/cli/CLIService.java b/service/src/java/org/apache/hive/service/cli/CLIService.java index 3f8aa0b..98cf6f8 100644 --- a/service/src/java/org/apache/hive/service/cli/CLIService.java +++ b/service/src/java/org/apache/hive/service/cli/CLIService.java @@ -87,7 +87,7 @@ public synchronized void init(HiveConf hiveConf) { if (UserGroupInformation.isSecurityEnabled()) { try { HiveAuthFactory.loginFromKeytab(hiveConf); - this.serviceUGI = Utils.getUGIForConf(hiveConf); + this.serviceUGI = Utils.getUGI(); } catch (IOException e) { throw new ServiceException("Unable to login to kerberos with given principal/keytab", e); } catch (LoginException e) { diff --git a/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java b/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java index c9485b6..74d7d53 100644 --- a/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java +++ b/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java @@ -246,7 +246,7 @@ public Object run() throws HiveSQLException { */ private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException { try { - return Utils.getUGIForConf(opConfig); + return Utils.getUGI(); } catch (Exception e) { throw new HiveSQLException("Unable to get current user", e); } diff --git a/shims/common/src/main/java/org/apache/hadoop/fs/DefaultFileAccess.java b/shims/common/src/main/java/org/apache/hadoop/fs/DefaultFileAccess.java index 61af229..45ca210 100644 --- a/shims/common/src/main/java/org/apache/hadoop/fs/DefaultFileAccess.java +++ b/shims/common/src/main/java/org/apache/hadoop/fs/DefaultFileAccess.java @@ -52,7 +52,7 @@ public static void checkFileAccess(FileSystem fs, FileStatus stat, FsAction action) throws IOException, AccessControlException, LoginException { // Get the user/groups for checking permissions based on the current UGI. - UserGroupInformation currentUgi = Utils.getUGIForConf(fs.getConf()); + UserGroupInformation currentUgi = Utils.getUGI(); DefaultFileAccess.checkFileAccess(fs, stat, action, currentUgi.getShortUserName(), Arrays.asList(currentUgi.getGroupNames())); diff --git a/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java b/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java index 2648d1d..c851dc2 100644 --- a/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java +++ b/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java @@ -40,7 +40,7 @@ public class Utils { - public static UserGroupInformation getUGIForConf(Configuration conf) throws LoginException, IOException { + public static UserGroupInformation getUGI() throws LoginException, IOException { String doAs = System.getenv("HADOOP_USER_NAME"); if(doAs != null && doAs.length() > 0) { /*