Magellan Linux

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

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

alx-src/trunk/alxconfig-ng/functions/config_auth.sh revision 329 by niro, Wed Sep 7 18:41:29 2005 UTC alx-src/branches/alxconf-060/functions/config_auth.sh revision 1800 by niro, Thu Apr 14 19:29:35 2011 UTC
# Line 1  Line 1 
1  # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_auth.sh,v 1.4 2005-09-07 18:41:29 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_auth.sh,v 1.7 2005-10-09 21:28:28 niro Exp $
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()
5  {  {
6   local x i all count   local x i all count
7    
  # all arrays:  
  # ->  session1 session2 ... sessionN  
   
8   # get settings from database   # get settings from database
9   ALX_AUTH_SHELL_PW=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \   ALX_AUTH_SHELL_PW=$(mysqldo "select shell from client_auth where serial='${ALX_SERIAL}'")
10   "select shell from client_auth where serial='${ALX_SERIAL}'")   ALX_AUTH_VNC_PW=$(mysqldo "select vnc from client_auth where serial='${ALX_SERIAL}'")
11   ALX_AUTH_VNC_PW=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \   ALX_AUTH_SAMBA_PW=$(mysqldo "select samba from client_auth where serial='${ALX_SERIAL}'")
12   "select vnc from client_auth where serial='${ALX_SERIAL}'")   ALX_AUTH_STATION_PW=$(mysqldo "select station from client_auth where serial='${ALX_SERIAL}'")
  ALX_AUTH_SAMBA_PW=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \  
  "select samba from client_auth where serial='${ALX_SERIAL}'")  
  ALX_AUTH_STATION_PW=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \  
  "select station from client_auth where serial='${ALX_SERIAL}'")  
13    
14   export ALX_AUTH_SHELL_PW   export ALX_AUTH_SHELL_PW
15   export ALX_AUTH_VNC_PW   export ALX_AUTH_VNC_PW
# Line 30  config_auth() Line 23  config_auth()
23   get_auth_settings   get_auth_settings
24    
25   [ -n "${ALX_AUTH_SHELL_PW}" ] && \   [ -n "${ALX_AUTH_SHELL_PW}" ] && \
26   usermod -p $(perl -e "printf(crypt('${ALX_AUTH_SHELL_PW}','AD'))") root   usermod -p $(openssl passwd -1 ${ALX_AUTH_SHELL_PW}) root
27    
28   [ -n "${ALX_AUTH_STATION_PW}" ] && \   [ -n "${ALX_AUTH_STATION_PW}" ] && \
29   usermod -p $(perl -e "printf(crypt('${ALX_AUTH_SHELL_PW}','AD'))") ${ALX_UNPRIV_USER}   usermod -p $(openssl passwd -1 ${ALX_AUTH_SHELL_PW}) ${ALX_UNPRIV_USER}
30    
31   if [ -n "${ALX_AUTH_SAMBA_PW}" ]   if [ -n "${ALX_AUTH_SAMBA_PW}" ]
32   then   then
# Line 53  EOF Line 46  EOF
46   if [ -n "${ALX_AUTH_VNC_PW}" ]   if [ -n "${ALX_AUTH_VNC_PW}" ]
47   then   then
48   # pipe it 2x; 1st for new pw, 2nd to validate   # pipe it 2x; 1st for new pw, 2nd to validate
49   vncpasswd &> /dev/null << EOF   HOME=/root vncpasswd &> /dev/null << EOF
50  ${ALX_AUTH_VNC_PW}  ${ALX_AUTH_VNC_PW}
51  ${ALX_AUTH_VNC_PW}  ${ALX_AUTH_VNC_PW}
52  EOF  EOF
53   fi   fi
54    
55   # unset vars   # unset vars
56   unset ALX_AUTH_SHELL_PW   unset ALX_AUTH_SHELL_PW
57   unset ALX_AUTH_VNC_PW   unset ALX_AUTH_VNC_PW
58   unset ALX_AUTH_SAMBA_PW   unset ALX_AUTH_SAMBA_PW
59   unset ALX_AUTH_STATION_PW   unset ALX_AUTH_STATION_PW
60  }  }
   

Legend:
Removed from v.329  
changed lines
  Added in v.1800