diff options
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 3712cfbb14..18652d8c92 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -640,7 +640,7 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, connection_struct *conn; pstring inbuf; pstring outbuf; - struct smb_passwd *smb_pass; + struct passwd *pass; int ecode; int outsize = 0; int i; @@ -662,9 +662,9 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, get_short_archi(architecture, driver->environment); become_root(); - smb_pass = getsmbpwuid(user->uid); - if(smb_pass == NULL) { - DEBUG(0,("move_driver_to_download_area: Unable to get smbpasswd entry for uid %u\n", + pass = getpwuid(user->uid); + if(pass == NULL) { + DEBUG(0,("move_driver_to_download_area: Unable to get passwd entry for uid %u\n", (unsigned int)user->uid )); unbecome_root(); return False; @@ -672,7 +672,7 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, unbecome_root(); /* connect to the print$ share under the same account as the user connected to the rpc pipe */ - fstrcpy(user_name, smb_pass->smb_name ); + fstrcpy(user_name, pass->pw_name ); DEBUG(10,("move_driver_to_download_area: uid %d -> user %s\n", (int)user->uid, user_name)); /* Null password is ok - we are already an authenticated user... */ @@ -1714,6 +1714,7 @@ static uint32 get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen NT_PRINTER_INFO_LEVEL_2 info; int len = 0; TDB_DATA kbuf, dbuf; + fstring printername; ZERO_STRUCT(info); @@ -1753,6 +1754,12 @@ static uint32 get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen /* Samba has to have shared raw drivers. */ info.attributes |= (PRINTER_ATTRIBUTE_SHARED|PRINTER_ATTRIBUTE_RAW_ONLY); + /* Restore the stripped strings. */ + slprintf(info.servername, sizeof(info.servername), "\\\\%s", global_myname); + slprintf(printername, sizeof(printername), "\\\\%s\\%s", global_myname, + info.printername); + fstrcpy(info.printername, printername); + len += unpack_devicemode(&info.devmode,dbuf.dptr+len, dbuf.dsize-len); len += unpack_specifics(&info.specific,dbuf.dptr+len, dbuf.dsize-len); @@ -1761,8 +1768,8 @@ static uint32 get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen safe_free(dbuf.dptr); *info_ptr=memdup(&info, sizeof(info)); - DEBUG(9,("Unpacked printer [%s] running driver [%s]\n", - sharename, info.drivername)); + DEBUG(9,("Unpacked printer [%s] name [%s] running driver [%s]\n", + sharename, info.printername, info.drivername)); return 0; |