Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7616 Installer should avoid creating auto_home layout #19

Merged
merged 1 commit into from Jan 23, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -282,7 +282,6 @@ else:
# Password is pre-expired in GUI case since user didn't explicitly set it
SA.append(ICTO.set_root_password(ROOT_PW, not textinstall_exists()))
SA.append(ICTO.create_new_user(NU_GOS, NU_LOGIN, NU_PW, NU_GID, NU_UID))
SA.append(ICTO.set_homedir_map(NU_LOGIN))
SA.append(ICTO.setup_rbac(NU_LOGIN))
SA.append(ICTO.setup_sudo(NU_LOGIN))
if not IS_SPARC:
@@ -371,7 +371,6 @@ class ICT(object):
basedir - root directory (only required parameter)
debuglvl - debugging message level for liblogsvc
bootenvrc - normal location of bootenv.rc
autohome - normal location of autohome map
loc_grubmenu - normal location of GRUB menu
ai_sc_profile - SC profile generated by Automated Installer
target_sc_profile = target SC profile
@@ -387,7 +386,6 @@ class initializer will exit with error status if:
def __init__(self, basedir,
debuglvl=-1,
bootenvrc='/boot/solaris/bootenv.rc',
autohome='/etc/auto_home',
loc_grubmenu='/boot/grub/menu.lst',
ai_sc_profile='/tmp/sc_manifest.xml',
target_sc_profile='sc_profile.xml',
@@ -493,7 +491,6 @@ def __init__(self, basedir,
#/boot/menu.lst
self.bootmenu_sparc = self.bootmenu_path_sparc + '/menu.lst'

self.autohome = basedir + autohome
self.sudoers = basedir + sudoers

# System Configuration template used to assemble System Configuration
@@ -2336,7 +2333,7 @@ def create_new_user(self, gcos, login, pw, gid, uid):
nu['gid'] = gid
nu['uid'] = uid
nu['gcos-field'] = gcos
nu['home-dir'] = '/home/' + login
nu['home-dir'] = '/export/home/' + login
nu['login-shell'] = '/bin/bash'
nu['password'] = pw
pf.setvalue(nu)
@@ -2350,43 +2347,6 @@ def create_new_user(self, gcos, login, pw, gid, uid):

return return_status

def set_homedir_map(self, login):
'''ICT - set the auto_home map entry on the specified install
target.
return 0 on success, error code otherwise
'''
_register_task(inspect.currentframe())

return_status = 0

temp_file = '/var/run/new_auto_home'

if not login:
_dbg_msg('No login specified')
return return_status

_dbg_msg('setting home dir in auto_home map: ' + self.basedir)

try:
with open(self.autohome, 'r') as fp:
autohome_lines = fp.readlines()
with open(temp_file, 'w') as fp_tmp:
for l in autohome_lines:
if l.startswith("+auto_home"):
fp_tmp.write(login + '\tlocalhost:/export/home/&\n')
fp_tmp.write(l)
os.remove(self.autohome)
shutil.move(temp_file, self.autohome)
os.chmod(self.autohome, S_IREAD | S_IWRITE | S_IRGRP | S_IROTH)
os.chown(self.autohome, 0, 2) # chown root:bin
except IOError, (errno, strerror):
prerror('Failure to add line in auto_home file')
prerror(traceback.format_exc())
prerror('Failure. Returning: ICT_SET_AUTOHOME_FAILED')
return_status = ICT_SET_AUTOHOME_FAILED

return return_status

def set_root_password(self, newpw, expire=False):
'''ICT - set the root password on the specified install target.
using IPS class PasswordFile from pkg.cfgfiles. Pre-expire password
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.