diff --git a/univention-ldb-modules/modules/univention_samaccountname_ldap_check.c b/univention-ldb-modules/modules/univention_samaccountname_ldap_check.c index b63a51d..9983a39 100644 --- a/univention-ldb-modules/modules/univention_samaccountname_ldap_check.c +++ b/univention-ldb-modules/modules/univention_samaccountname_ldap_check.c @@ -185,6 +185,8 @@ static int univention_samaccountname_ldap_check_add(struct ldb_module *module, s char *ldap_master = univention_config_get_string("ldap/master"); char *machine_pass = read_pwd_from_file("/etc/machine.secret"); + char *opt_school = NULL; + sprintf(opt_school, "school=%s", univention_config_get_string("ucsschool/windows-join/schoolou")); char *my_hostname = univention_config_get_string("hostname"); char *opt_my_samaccoutname = malloc(strlen(my_hostname) + 2); @@ -208,9 +210,9 @@ static int univention_samaccountname_ldap_check_add(struct ldb_module *module, s } else if ( pid == 0 ) { if (opt_unicodePwd != NULL) { - execlp("/usr/sbin/ucs-school-create_windows_computer", "/usr/sbin/ucs-school-create_windows_computer", "-s", ldap_master, "-P", machine_pass, "-U", opt_my_samaccoutname, "selectiveudm/create_windows_computer", "-o", opt_name, "-o", opt_unicodePwd, "-o", "decode_password=yes", "-o", opt_usersid, NULL); + execlp("/usr/sbin/ucs-school-create_windows_computer", "/usr/sbin/ucs-school-create_windows_computer", "-s", ldap_master, "-P", machine_pass, "-U", opt_my_samaccoutname, "selectiveudm/create_windows_computer", "-o", opt_name, "-o", opt_unicodePwd, "-o", "decode_password=yes", "-o", opt_usersid, "-o", opt_school, NULL); } else { - execlp("/usr/sbin/ucs-school-create_windows_computer", "/usr/sbin/ucs-school-create_windows_computer", "-s", ldap_master, "-P", machine_pass, "-U", opt_my_samaccoutname, "selectiveudm/create_windows_computer", "-o", opt_name, "-o", opt_usersid, NULL); + execlp("/usr/sbin/ucs-school-create_windows_computer", "/usr/sbin/ucs-school-create_windows_computer", "-s", ldap_master, "-P", machine_pass, "-U", opt_my_samaccoutname, "selectiveudm/create_windows_computer", "-o", opt_name, "-o", opt_usersid, "-o", opt_school, NULL); } ldb_debug(ldb, LDB_DEBUG_ERROR, ("%s: exec of /usr/sbin/ucs-school-create_windows_computer failed\n"), ldb_module_get_name(module)); @@ -228,6 +230,7 @@ static int univention_samaccountname_ldap_check_add(struct ldb_module *module, s free(opt_name); free(usersid); free(opt_usersid); + free(opt_school); if (opt_unicodePwd != NULL) { free(opt_unicodePwd); }