ldap sssd libsss-sudo, bash changes, ahenk post install sssd_ad_authentication

This commit is contained in:
agahhulusi 2021-09-07 16:25:05 +03:00
parent 24d425d27f
commit 1f96586b8c
8 changed files with 32 additions and 26 deletions

View file

@ -5,10 +5,15 @@ set -e
#mkdir -p /usr/share/ahenk/plugins
# update ahenk from 1.0.0-6 to 1.0.0-7
if [ ! -d /etc/ahenk ]; then
if [[ ! -d /etc/ahenk ]]; then
mkdir -p /etc/ahenk
cp -rf /tmp/ahenk/* /etc/ahenk
# update pardus21 sssd conf changes when update pardus from 24 to 25
if [[ -f /etc/ahenk/ad_info ]]; then
if [[ -f /etc/sssd/sssd.conf ]]; then
sed -i 's/ad_domain/ad_server/g' /etc/sssd/sssd.conf
fi
fi
fi
systemctl enable ahenk

View file

@ -6,8 +6,8 @@ fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/ahenk" ]; then
if [[ "$1" = "configure" ]] || [[ "$1" = "abort-upgrade" ]]; then
if [[ -x "/etc/init.d/ahenk" ]]; then
update-rc.d ahenk defaults >/dev/null
invoke-rc.d ahenk start || exit $?
fi

2
debian/ahenk.postrm vendored
View file

@ -2,6 +2,6 @@
set -e
if [ -d /etc/ahenk ] && [ "$1" = "purge" ];then
if [[ -d /etc/ahenk ]] && [[ "$1" = "purge" ]];then
rm -rf /etc/ahenk
fi

View file

@ -1,12 +1,12 @@
# Automatically added by dh_installinit
if [ "$1" = "purge" ] ; then
if [[ "$1" = "purge" ]] ; then
update-rc.d ahenk remove >/dev/null
fi
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
if [[ -d /run/systemd/system ]] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section

View file

@ -4,7 +4,7 @@ set -e
# Create necessary directories
#update ahenk from 1.0.0-6 to 1.0.0-7
if [ -d /etc/ahenk ]; then
if [[ -d /etc/ahenk ]]; then
cp -rf /etc/ahenk /tmp

View file

@ -73,7 +73,7 @@ class CommandRunner(object):
if str(json_data['event']) == 'login' and self.check_last_login():
username = json_data['username']
if username != "Debian-gdm" or username != "gdm":
if username != "Debian-gdm" and username != "gdm":
display = json_data['display']
desktop = json_data['desktop']
@ -163,6 +163,7 @@ class CommandRunner(object):
elif str(json_data['event']) == 'logout':
username = json_data['username']
if username != "Debian-gdm" and username != "gdm":
self.execute_manager.remove_user_executed_policy_dict(username)
self.plugin_manager.process_mode('logout', username)
self.plugin_manager.process_mode('safe', username)

View file

@ -16,7 +16,7 @@ class ExecuteCancelLDAPLogin:
def cancel(self):
self.logger.info('Purge ldap packages')
self.util.execute("apt-get install sudo -y")
self.util.execute("apt purge libpam-ldap libnss-ldap ldap-utils sudo-ldap nss-updatedb libnss-db libpam-ccreds -y")
self.util.execute("apt purge libpam-ldap libnss-ldap ldap-utils sudo-ldap nss-updatedb libnss-db libpam-ccreds libsss-sudo -y")
self.util.execute("apt autoremove -y")
self.logger.info('purging successfull')

View file

@ -178,7 +178,7 @@ class ExecuteLDAPLogin:
self.util.write_file(libnss_ldap_file_path, content, 'a+')
self.logger.info("Configuration has been made to {0}.".format(libnss_ldap_file_path))
result_code, p_out, p_err = self.util.execute("apt-get install libnss-db libpam-ccreds -y")
result_code, p_out, p_err = self.util.execute("apt-get install libnss-db libpam-ccreds libsss-sudo -y")
if result_code != 0:
self.logger.error("Error occured while downloading libnss-db libpam-ccreds.")
else: