if ((iPrinterService = lp_servicenumber(PRINTERS_NAME)) < 0) {
iPrinterService = load_registry_service(PRINTERS_NAME);
}
- if (iPrinterService) {
+ if (iPrinterService >= 0) {
DEBUG(3,("checking whether %s is a valid printer name...\n", service));
if (pcap_printername_ok(service)) {
DEBUG(3,("%s is a valid printer name\n", service));
return NULL;
}
+ /* We don't want to replace the original sanitized_username
+ as it is the original user given in the connect attempt.
+ This is used in '%U' substitutions. */
+ TALLOC_FREE(forced_serverinfo->sanitized_username);
+ forced_serverinfo->sanitized_username =
+ talloc_move(forced_serverinfo,
+ &conn->server_info->sanitized_username);
+
TALLOC_FREE(conn->server_info);
conn->server_info = forced_serverinfo;
*pstatus = NT_STATUS_BAD_NETWORK_NAME;
goto err_root_exit;
}
+ conn->base_share_dev = smb_fname_cpath->st.st_ex_dev;
string_set(&conn->origpath,conn->connectpath);