mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	add ability to write the creds to a directory, not user's home. We need this when the /u is mounted on the MN and root does not have write access to any user directories
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3269 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -1,5 +1,14 @@ | ||||
|  | ||||
| # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html | ||||
| # set up credentials for user to be able to run xCAT commands | ||||
| # Must be run by root | ||||
| #   Interface | ||||
| #     setup-local-client.sh  - setup root credentials | ||||
| #     setup-local-client.sh user1  - set up user1 credentials and store in  | ||||
| #                      $HOME/.xcat | ||||
| #     setup-local-client.sh user2  /tmp/user2  - setup user2 credentials and | ||||
| #                      store in /tmp/user2/.xcat.  Must later be copied to  | ||||
| #                      $HOME/xcat for user2.  Used when root cannot write to | ||||
| #                      the home directory of user2 (e.g when mounted). | ||||
| umask 0077 #nothing make by this script should be readable by group or others | ||||
|  | ||||
|  | ||||
| @@ -9,15 +18,19 @@ fi | ||||
| if [ -z "$1" ]; then | ||||
|   set `whoami` | ||||
| fi | ||||
| CNA="$*" | ||||
|  | ||||
| # if diretory is not supplied then just use home | ||||
| if [ -z "$2" ]; then | ||||
|    CNA="$*" | ||||
| #  getent doesn't exist on AIX | ||||
| if [ -x /usr/bin/getent ];then | ||||
|  USERHOME=`getent passwd $1|awk -F: '{print $6}'` | ||||
|   if [ -x /usr/bin/getent ];then | ||||
|    USERHOME=`getent passwd $1|awk -F: '{print $6}'` | ||||
|   else | ||||
|    USERHOME=`grep ^$1: /etc/passwd | cut -d: -f6` | ||||
|   fi | ||||
| else | ||||
|  USERHOME=`grep ^$1: /etc/passwd | cut -d: -f6` | ||||
|   CNA="$1" | ||||
|   USERHOME=$2  | ||||
| fi | ||||
|  | ||||
| XCATCADIR=$XCATDIR/ca | ||||
|  | ||||
| if [ -e $USERHOME/.xcat ]; then | ||||
|   | ||||
		Reference in New Issue
	
	Block a user