mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-25 06:21:58 +00:00
修改添加sudo时的小bug
This commit is contained in:
parent
6273eddeda
commit
e81c710f30
@ -1,4 +1,4 @@
|
|||||||
dn: cn=guanghongwei,ou=Sudoers,dc=yolu,dc=com
|
dn: cn=guanghongwei,ou=Sudoers,dc=dianping,dc=com
|
||||||
objectClass: top
|
objectClass: top
|
||||||
objectClass: sudoRole
|
objectClass: sudoRole
|
||||||
cn: guanghongwei
|
cn: guanghongwei
|
||||||
|
@ -12,7 +12,7 @@ dir=$(cwd)
|
|||||||
|
|
||||||
|
|
||||||
sudo_file=${dir}/sudo.ldif
|
sudo_file=${dir}/sudo.ldif
|
||||||
user_sudo_file=${dir}/sudouser.ldif
|
user_sudo_file=${dir}/${username}.ldif
|
||||||
|
|
||||||
if [ -z $1 ];then
|
if [ -z $1 ];then
|
||||||
echo
|
echo
|
||||||
@ -27,6 +27,10 @@ if [ $? != '0' ];then
|
|||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sed -i "/guanghongwei/ s@dianping@$domain@g" ${sudo_file}
|
||||||
|
sed -i "/guanghongwei/ s@com@$suffix@g" ${sudo_file}
|
||||||
sed -e "s@guanghongwei@$username@g" ${sudo_file} > $user_sudo_file
|
sed -e "s@guanghongwei@$username@g" ${sudo_file} > $user_sudo_file
|
||||||
|
|
||||||
ldapadd -x -h ${host} -w ${ldapassword} -D "cn=admin,dc=$domain,dc=$suffix" -f $user_sudo_file
|
|
||||||
|
ldapadd -x -h ${host} -w ${ldapassword} -D "cn=admin,dc=$domain,dc=$suffix" -f $user_sudo_file
|
||||||
|
rm -f $user_sudo_file
|
Loading…
Reference in New Issue
Block a user