]>
sourceware.org Git - newlib-cygwin.git/blob - winsup/lsaauth/cyglsa-config
0e911c27820f2c6c348dd80adc6a9d400dad8268
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # A copy of the GNU General Public License can be found at
11 # This file is part of the Cygwin LSA authentication package.
15 if [ "${auto_answer}" = "yes" ]
17 echo "$1 (yes/no) yes"
19 elif [ "${auto_answer}" = "no" ]
26 while [ "X${answer}" != "Xyes" -a "X${answer}" != "Xno" ]
28 echo -n "$1 (yes/no) "
31 if [ "X${answer}" = "Xyes" ]
39 # Check if running under at least Windows 2000
40 _nt_too_old
=`uname | awk -F- '{print ( $2 < 5.0 ) ? 1 : 0;}'`
41 if [ ${_nt_too_old} -eq 1 ]
43 echo "Cygwin LSA authentication not supported on Windows NT4 or older. Exiting."
47 # Directory in which cyglsa DLL is installed as DOS path.
48 bindir
=`cygpath -w /`\\bin
50 # Check if we're running on 64 bit Windows. If so, we need the 64 bit
53 test -d `cygpath -p ${SYSTEMROOT}`/SysWOW64
&& dll
=cyglsa64.dll
55 # Check if the DLL is actually installed. If not, bail out.
56 if [ ! -f /bin
/${dll} ]
58 echo "Required Cygwin authentication DLL /bin/${dll} doesn't exist. Exiting."
63 echo "Warning: Registering the Cygwin LSA authentication package requires"
64 echo "administrator privileges! You also have to reboot the machine to"
65 echo "activate the change."
67 request
"Are you sure you want to continue?" ||
exit 0
69 # The registry value which keeps the authentication packages.
70 value
='/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa/Authentication Packages'
72 [ -f /bin
/cyglsa
-a ! -d /bin
/cyglsa
] && rm -rf /bin
/cyglsa
73 if [ ! -d /bin
/cyglsa
]
75 if ! mkdir
-m 755 /bin
/cyglsa
77 echo "Creating the /bin/cyglsa directory failed. Exiting."
81 if ! cp -b "/bin/${dll}" "/bin/cyglsa/${dll}"
83 echo "Copying the new LSA authentication package /bin/${dll} to"
84 echo "/bin/cyglsa/${dll} failed. Exiting."
88 # Get old content, remove every trace of "cyglsa" from it and write the
89 # content back to the registry with the new, correct path to the cyglsa DLL.
90 old
=`regtool get "${value}"`
93 echo $i | GREP_OPTIONS="" grep -v cyglsa
95 if ! regtool
set "${value}" ${new} "${bindir}\\cyglsa\\${dll}"
97 echo "Setting the new registry value failed. Exiting."
102 echo "Cygwin LSA authentication package registered."
104 echo "Activating Cygwin's LSA authentication package requires to reboot."
105 if [ -x /bin
/shutdown
]
107 if request
"Do you want to do this immediately?"
110 echo "Other users might still be working on this machine."
112 if request
"Are you sure?"
115 echo "Ok, will reboot in 30 seconds."
117 echo "If you change your mind, call 'shutdown -a' within 30 seconds"
This page took 0.043686 seconds and 4 git commands to generate.