View | Details | Raw Unified | Return to bug 41765 | Differences between
and this patch

Collapse All | Expand All

(-)a/univention-ldb-modules/modules/univention_samaccountname_ldap_check.c (-2 / +5 lines)
 Lines 185-190   static int univention_samaccountname_ldap_check_add(struct ldb_module *module, s Link Here 
185
185
186
		char *ldap_master = univention_config_get_string("ldap/master");
186
		char *ldap_master = univention_config_get_string("ldap/master");
187
		char *machine_pass = read_pwd_from_file("/etc/machine.secret");
187
		char *machine_pass = read_pwd_from_file("/etc/machine.secret");
188
		char *opt_school = NULL;
189
		sprintf(opt_school, "school=%s", univention_config_get_string("ucsschool/windows-join/schoolou"));
188
190
189
		char *my_hostname = univention_config_get_string("hostname");
191
		char *my_hostname = univention_config_get_string("hostname");
190
		char *opt_my_samaccoutname = malloc(strlen(my_hostname) + 2);
192
		char *opt_my_samaccoutname = malloc(strlen(my_hostname) + 2);
 Lines 208-216   static int univention_samaccountname_ldap_check_add(struct ldb_module *module, s Link Here 
208
		} else if ( pid == 0 ) {
210
		} else if ( pid == 0 ) {
209
211
210
			if (opt_unicodePwd != NULL) {
212
			if (opt_unicodePwd != NULL) {
211
				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);
213
				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);
212
			} else {
214
			} else {
213
				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);
215
				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);
214
			}
216
			}
215
217
216
			ldb_debug(ldb, LDB_DEBUG_ERROR, ("%s: exec of /usr/sbin/ucs-school-create_windows_computer failed\n"), ldb_module_get_name(module));
218
			ldb_debug(ldb, LDB_DEBUG_ERROR, ("%s: exec of /usr/sbin/ucs-school-create_windows_computer failed\n"), ldb_module_get_name(module));
 Lines 228-233   static int univention_samaccountname_ldap_check_add(struct ldb_module *module, s Link Here 
228
		free(opt_name);
230
		free(opt_name);
229
		free(usersid);
231
		free(usersid);
230
		free(opt_usersid);
232
		free(opt_usersid);
233
		free(opt_school);
231
		if (opt_unicodePwd != NULL) {
234
		if (opt_unicodePwd != NULL) {
232
			free(opt_unicodePwd);
235
			free(opt_unicodePwd);
233
		}
236
		}

Return to bug 41765