/** * Calls shell to get users for a netgroup by calling getent * netgroup, this is a low level function that just returns string * that * * @param netgroup get users for this netgroup * @return string of users for a given netgroup in getent netgroups format */ protected String execShellGetUserForNetgroup(final String netgroup) throws IOException { String result = ""; try { // shell command does not expect '@' at the beginning of the group name result = Shell.execCommand( Shell.getUsersForNetgroupCommand(netgroup.substring(1))); } catch (ExitCodeException e) { // if we didn't get the group - just return empty list; LOG.warn("error getting users for netgroup " + netgroup, e); } return result; } }
/** * Calls shell to get users for a netgroup by calling getent * netgroup, this is a low level function that just returns string * that * * @param netgroup get users for this netgroup * @return string of users for a given netgroup in getent netgroups format */ protected String execShellGetUserForNetgroup(final String netgroup) throws IOException { String result = ""; try { // shell command does not expect '@' at the begining of the group name result = Shell.execCommand( Shell.getUsersForNetgroupCommand(netgroup.substring(1))); } catch (ExitCodeException e) { // if we didn't get the group - just return empty list; LOG.warn("error getting users for netgroup " + netgroup, e); } return result; } }
/** * Calls shell to get users for a netgroup by calling getent * netgroup, this is a low level function that just returns string * that * * @param netgroup get users for this netgroup * @return string of users for a given netgroup in getent netgroups format */ protected String execShellGetUserForNetgroup(final String netgroup) throws IOException { String result = ""; try { // shell command does not expect '@' at the begining of the group name result = Shell.execCommand( Shell.getUsersForNetgroupCommand(netgroup.substring(1))); } catch (ExitCodeException e) { // if we didn't get the group - just return empty list; LOG.warn("error getting users for netgroup " + netgroup, e); } return result; } }
/** * Calls shell to get users for a netgroup by calling getent * netgroup, this is a low level function that just returns string * that * * @param netgroup get users for this netgroup * @return string of users for a given netgroup in getent netgroups format */ protected String execShellGetUserForNetgroup(final String netgroup) throws IOException { String result = ""; try { // shell command does not expect '@' at the begining of the group name result = Shell.execCommand( Shell.getUsersForNetgroupCommand(netgroup.substring(1))); } catch (ExitCodeException e) { // if we didn't get the group - just return empty list; LOG.warn("error getting users for netgroup " + netgroup, e); } return result; } }
/** * Calls shell to get users for a netgroup by calling getent * netgroup, this is a low level function that just returns string * that * * @param netgroup get users for this netgroup * @return string of users for a given netgroup in getent netgroups format */ protected String execShellGetUserForNetgroup(final String netgroup) throws IOException { String result = ""; try { // shell command does not expect '@' at the begining of the group name result = Shell.execCommand( Shell.getUsersForNetgroupCommand(netgroup.substring(1))); } catch (ExitCodeException e) { // if we didn't get the group - just return empty list; LOG.warn("error getting users for netgroup " + netgroup, e); } return result; } }