소스 검색

Added function to check if user is a posixAccount

Théo Ertzscheid 2 년 전
부모
커밋
e46e00b522
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      funcs

+ 5 - 0
funcs

@@ -11,3 +11,8 @@ group_exists() {
 	res=$(ldapsearch -x -LLL -b $GROUPSDN -D $BINDDN -w $BINDPW "(&(cn=$1)(objectClass=groupOfNames))" | grep cn: | cut -f2 -d' ')
 	[ -n "$res" ]
 }
+
+is_posix() {
+	res=$(ldapsearch -x -LLL -b $PEOPLEDN -D $BINDDN -w $BINDPW "(&(uid=$1)(objectClass=posixAccount))" | grep uid: | cut -f2 -d' ')
+	[ -n "$res" ]
+}