Magellan Linux

Diff of /alx-src/branches/alxconf-060/functions/config_auth.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1968 by niro, Thu Apr 14 19:29:35 2011 UTC revision 1969 by niro, Sat May 7 11:00:49 2011 UTC
# Line 1  Line 1 
1  # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_auth.sh,v 1.7 2005-10-09 21:28:28 niro Exp $  # $Id$
2  # configures the system authentification via mysql db settings  # configures the system authentification via mysql db settings
3    
4  get_auth_settings()  get_auth_settings()
# Line 8  get_auth_settings() Line 8  get_auth_settings()
8   # get settings from database   # get settings from database
9   ALX_AUTH_SHELL_PW=$(mysqldo "select shell from client_auth where serial='${ALX_SERIAL}'")   ALX_AUTH_SHELL_PW=$(mysqldo "select shell from client_auth where serial='${ALX_SERIAL}'")
10   ALX_AUTH_VNC_PW=$(mysqldo "select vnc from client_auth where serial='${ALX_SERIAL}'")   ALX_AUTH_VNC_PW=$(mysqldo "select vnc from client_auth where serial='${ALX_SERIAL}'")
  ALX_AUTH_SAMBA_PW=$(mysqldo "select samba from client_auth where serial='${ALX_SERIAL}'")  
11   ALX_AUTH_STATION_PW=$(mysqldo "select station from client_auth where serial='${ALX_SERIAL}'")   ALX_AUTH_STATION_PW=$(mysqldo "select station from client_auth where serial='${ALX_SERIAL}'")
12    
13   export ALX_AUTH_SHELL_PW   export ALX_AUTH_SHELL_PW
14   export ALX_AUTH_VNC_PW   export ALX_AUTH_VNC_PW
  export ALX_AUTH_SAMBA_PW  
15   export ALX_AUTH_STATION_PW   export ALX_AUTH_STATION_PW
16  }  }
17    
# Line 28  config_auth() Line 26  config_auth()
26   [ -n "${ALX_AUTH_STATION_PW}" ] && \   [ -n "${ALX_AUTH_STATION_PW}" ] && \
27   usermod -p $(openssl passwd -1 ${ALX_AUTH_SHELL_PW}) ${ALX_UNPRIV_USER}   usermod -p $(openssl passwd -1 ${ALX_AUTH_SHELL_PW}) ${ALX_UNPRIV_USER}
28    
  if [ -n "${ALX_AUTH_SAMBA_PW}" ]  
  then  
  # >smb3 smbpasswd -a user password does not work anymore  
  if [[ $(smbd --version | cut -d' ' -f2) > 2.999 ]]  
  then  
  smbpasswd -a root -s << EOF  
 ${ALX_AUTH_SAMBA_PW}  
 ${ALX_AUTH_SAMBA_PW}  
 EOF  
  else  
  smbpasswd -a root ${ALX_AUTH_SAMBA_PW}  
  fi  
  fi  
   
29   # vnc passwd (min 6 chars)   # vnc passwd (min 6 chars)
30   if [ -n "${ALX_AUTH_VNC_PW}" ]   if [ -n "${ALX_AUTH_VNC_PW}" ]
31   then   then
# Line 55  EOF Line 39  EOF
39   # unset vars   # unset vars
40   unset ALX_AUTH_SHELL_PW   unset ALX_AUTH_SHELL_PW
41   unset ALX_AUTH_VNC_PW   unset ALX_AUTH_VNC_PW
  unset ALX_AUTH_SAMBA_PW  
42   unset ALX_AUTH_STATION_PW   unset ALX_AUTH_STATION_PW
43  }  }

Legend:
Removed from v.1968  
changed lines
  Added in v.1969