summaryrefslogtreecommitdiff
path: root/source3/smbd/lanman.c
AgeCommit message (Collapse)AuthorFilesLines
2001-10-20Use asprintf, do bounds check, better rc logicJim McDonough1-33/+43
(This used to be commit 6a734158d92663873b7a9df517bec45a27ee9790)
2001-10-19Add RAP net share add supportJim McDonough1-31/+113
(This used to be commit a70bc077a1ecc4b42254f83327c8d80c618e95f6)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter1-2/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-29Fix up a number of intertwined issues:Andrew Bartlett1-4/+4
The big one is a global change to allow us to NULLify the free'ed pointer to a former passdb object. This was done to allow idra's SAFE_FREE() macro to do its magic, and to satisfy the input test in pdb_init_sam() for a NULL pointer to start with. This NULL pointer test was what was breaking the adding of accounts up until now, and this code has been reworked to avoid duplicating work - I hope this will avoid a similar mess-up in future. Finally, I fixed a few nasty bugs where the pdb_ fuctions's return codes were being ignored. Some of these functions malloc() and are permitted to fail. Also, this caught a nasty bug where pdb_set_lanman_password(sam, NULL) acheived precisely didilly-squat, just returning False. Now that we check the returns this bug was spotted. This could allow different LM and NT passwords. - the pdbedit code needs to start checking these too, but I havn't had a chance to fix it. I have also fixed up where some of the password changing code was using the pdb_set functions to store *internal* data. I assume this is from a previous lot of mass conversion work... Most likally (and going on past experience) I have missed somthing, probably in the LanMan password change code which I havn't yet been able to test, but this lot is in much better shape than it was before. If all this is too much to swallow (particularly for 2.2.2) then just adding a sam_pass = NULL to the particular line of passdb.c should do the trick for the ovbious bug. Andrew Bartlett (This used to be commit 762c8758a7869809d89b4da9c2a5249678942930)
2001-09-26Fix this to use the plaintext password code directly, like SWAT does.Andrew Bartlett1-7/+11
This whole area needs to be cleaned up. Should this kind of passowrd change/check be permitted with encrypt passwords = yes? In any case I've also had trouble testing this, as I can't find the right software/configuration to exersise this behaviour. But its better than the previous situation. Any assistance greatly appriciated. Andrew Bartlett (This used to be commit 37655b42897031f754d436435e64a2548de756b5)
2001-09-17move to SAFE_FREE()Simo Sorce1-18/+14
(This used to be commit a95943fde0ad89ae3f2deca2f7ba9cb5ab612b74)
2001-09-04the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but ↵Andrew Tridgell1-6/+13
the client code still needs some work (This used to be commit dcd6e735f709a9231860ceb9682db40ff26c9a66)
2001-09-03tidied up some unused vars in JFs new fnsAndrew Tridgell1-12/+0
(This used to be commit e26502b1f840cd0fafd700c9756b610b38709ce2)
2001-08-28Ouch ! I didn't think I would have to do that: add 2 new rap calls !Jean-François Micouleau1-0/+127
It's a quick and ugly hack as a proof of concept: the dell powervault 705 works with a samba PDC. I'll do a correct user enumeration later. J.F. (This used to be commit 9ec6a8735682c7dfe9f8573f063da7625d425d8a)
2001-08-12this is a big global fix for the ptr = Realloc(ptr, size) bug.Simo Sorce1-2/+8
many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also. (This used to be commit fa8e55b8b465114ce209344965c1ca0333b84db9)
2001-08-10More constant conversions.Tim Potter1-2/+2
(This used to be commit 00703d306f14a5977df75cb04ee34ae8628ed40e)
2001-08-10merge from 2.2Gerald Carter1-1/+1
(This used to be commit 6ab0e949d18b97ea7177175a4e6abb5ba076db98)
2001-08-06Added Gerald's lanman printing only change to HEAD.Jeremy Allison1-99/+91
Jeremy. (This used to be commit b7bd512d9a9b543b9caf93c264776db6852c03ea)
2001-07-08This removes unused paramaters from various authtication functions, and shouldAndrew Bartlett1-1/+1
not change behaviour. This should make my later diffs smaller, where I actualy start cleaning up this mess... Andrew Bartlett (This used to be commit 04f090c224bb7ac3b53c430a591fce1fc939a81c)
2001-07-04strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell1-1/+1
can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
2001-07-04The big character set handling changeover!Andrew Tridgell1-20/+18
This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a)
2001-05-07Patch from Simo:Gerald Carter1-2/+2
o sed 's/pdb_clear_sam/pdb_free_sam/g' o add pdb_reset_sam() o password changing should be ok now as well. (This used to be commit 96d0e7c3301ad990f6c83b9c216720cb32661fb5)
2001-05-04Big cleanup of passdb and backends.Jean-François Micouleau1-2/+6
I did some basic tests but I have probably broken something. Notably the password changing. So don't cry ;-) J.F. (This used to be commit a4a4c02b12f030a3b9e6225b999c90689dfc4719)
2001-04-28- added test for vasprintfAndrew Tridgell1-12/+0
- cleaned up GNUC printf attribute macros - added enum handling in mkproto - removed non-vararg code - made slprintf and vslprintf just macros for snprintf and vsnprintf - don't need slprintf code any more (This used to be commit c7aeb2254dfc3cd0aa0b6c0bdd426f9323be0ddf)
2001-03-31started converting some of the only-ascii code to use srvstr_*Andrew Tridgell1-11/+10
added srvstr_push_ascii() and srvstr_pull_ascii() as convenience routines to replace the current usage of strncpy() like fns for packet pull/push. We need to do this in *lots* of places in Samba in order to get our codepage handling right (This used to be commit 8b0e3679a6dc479c0e3177707dff386559779b69)
2001-03-23Two OS/2 printer fixes from Jim McDonough @ IBM.Jeremy Allison1-12/+59
First one adds a new info level into the lanman printing and an ioctl to the trans2 code. Andrew - this uses ASCII only. It looks ok to me but please check ! Second one adds a parameter "os2 driver map" that allows OS/2 driver names to be mapped. Jeremy. (This used to be commit da79b519e0b6b4317d7fb5260d74e0e74a7e0b46)
2001-03-17ADMIN$ is an IPC share, not a disk shareAndrew Tridgell1-1/+1
(This used to be commit 0ea62800edd618091fde81e8de4347f612f98a18)
2001-03-11Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison1-4/+0
RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy. (This used to be commit 0be41d5158ea4e645e93e8cd30617c038416e549)
2001-02-23include/rpc_spoolss.h: Added JOB_STATUS_XXX defines.Jeremy Allison1-13/+13
include/smb.h: Added LPQ_xx enums to correspond with the NT JOB_STATUS_XXX. We need these to be different as we're storing LPQ_xx enums in the tdb already. rpc_server/srv_spoolss_nt.c: Don't need to return status strings as we're now returning status codes. smbd/lanman.c: Change the RAP status codes to have "RAP" in the name. printing/printing.c: Keep track of the status of a job. Allow a job to be deleted from one smbd when being submitted by another. Made logic in mutex clearer. Jeremy. (This used to be commit 71029da7dd74eb91dd6953752bdf238f319d985d)
2001-01-29Changes from APPLIANCE_HEAD:David O'Neill1-1/+1
source/include/proto.h - make proto source/printing/nt_printing.c source/rpc_server/srv_spoolss_nt.c - Fix for the overwriting of printerdata entries when WinNT and Win2k are modifying printer parameters on PCL printers. Turns out that Win2k creates a printer with a NULL devmode entry and then expects to set it on *OPEN* (yes this is insane). So we cannot return a "default" devmode for a printer - and we must allow an open to set it. source/tdb/tdb.c - Show freelist in an easier format. Show total free. - When storing a new record, allocate memory for the key + data before the tdb_allocate() as if the malloc fails a (sparse) hole is left in the tdb. source/tdb/tdbtool.c - Show freelist in an easier format. Show total free. source/tdb/Makefile - cleaned up Makefile dependancies source/smbd/lanman.c - Fix for Win9x corrupting it's own parameter string. source/printing/printfsp.c source/printing/printing.c source/rpc_server/srv_spoolss_nt.c source/smbd/close.c - Added normal close parameter into print_fsp_end() which treats an abnormal close as error condition and deletes the spool file. (This used to be commit 025f7a092ad258ff774e3f5e53737f8210cc8af6)
2001-01-24smbd/lanman.c: Fix for calling qsort with 0 number.Jeremy Allison1-1/+2
smbd/nttrans.c: Realloc mem fixes based on those that went into trans2.c smbd/process.c: Move to a table based dispatch, based on a comment from Andrew about Antons work. Jeremy. (This used to be commit a958f7822e095367efb8749b6f1f2e110ffb8866)
2001-01-23include/vfs.h:Jeremy Allison1-2/+2
smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod_acl and chmod_acl. lib/substitute.c: smbd/lanman.c: smbd/open.c: smbd/process.c: smbd/reply.c: smbd/service.c: Removed sessetup_user variable. Added current_user_info struct which conatins domain info etc. Added '%D' for client domain parameter. Jeremy. (This used to be commit 2844ec3d511680609d6794b8718001a1bda9e89f)
2001-01-22Changes from APPLIANCE_HEAD:David O'Neill1-3/+4
source/smbd/lanman.c - cleanup and bug fix for win9x print queue purge. source/printing/printing.c - cleanup and bug fix for win9x print queue purge. - print_job_end() changed to cleanup spool file in the event of a failure returned from the print_run_command() (This used to be commit 0235fbef37b400a2bf875163878e497282cd1739)
2001-01-17Changes from APPLIANCE_HEAD:David O'Neill1-3/+4
source/smbd/lanman.c - Change fill_printq_info() to fix corrupted 9X/ME printer comment (This used to be commit acbed88a195b32d251fd15fc8fdd069726659d64)
2000-12-07Fixed bug with Win9x/ME where drivername was being returned incorrectly inJeremy Allison1-36/+46
one printq case. Now goes though common function. Jeremy. (This used to be commit e9f48c9cec960b6190fb7a2485c9476640863071)
2000-12-07file_lines_load/file_lines_pload can now optionally convert unix_to_dos()Jeremy Allison1-3/+3
on read. Jeremy. (This used to be commit 76b8dd376d13eb4469417be217c966d54d333367)
2000-11-21Fix for off-by-one StrnCpy.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 63cafb34b39443d03d17ae01b47adc0926b05fe2)
2000-11-16Fix from Jim McDonough @ IBM for OS/2 clients.Jeremy Allison1-0/+10
Jeremy. (This used to be commit f571e1efd01c7b1b500a833df3bd074a8c4c65ec)
2000-11-13Large commit which restructures the local password storage API.Gerald Carter1-6/+6
Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+) are broken, but they were somewhat broken before. :) The following functions implement the storage manipulation interface /*The following definitions come from passdb/pdb_smbpasswd.c */ BOOL pdb_setsampwent (BOOL update); void pdb_endsampwent (void); SAM_ACCOUNT* pdb_getsampwent (void); SAM_ACCOUNT* pdb_getsampwnam (char *username); SAM_ACCOUNT* pdb_getsampwuid (uid_t uid); SAM_ACCOUNT* pdb_getsampwrid (uint32 rid); BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass); BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override); BOOL pdb_delete_sam_account (char* username); There is also a host of pdb_set..() and pdb_get..() functions for manipulating SAM_ACCOUNT struct members. Note that the struct passdb_ops {} has gone away. Also notice that struct smb_passwd (formally in smb.h) has been moved to passdb/pdb_smbpasswd.c and is not accessed outisde of static internal functions in this file. All local password searches should make use of the the SAM_ACCOUNT struct and the previously mentioned functions. I'll write some documentation for this later. The next step is to fix the TDB passdb backend, then work on spliting the backends out into share libraries, and finally get the LDAP backend going. What works and may not: o domain logons from Win9x works o domain logons from WinNT 4 works o user and group enumeration as implemented by Tim works o file and print access works o changing password from Win9x & NT ummm...i'll fix this tonight :) If I broke anything else, just yell and I'll fix it. I think it should be fairly quite. -- jerry (This used to be commit 0b92d0838ebdbe24f34f17e313ecbf61a0301389)
2000-11-08More merging of printing stuff from appliance.Tim Potter1-3/+3
(This used to be commit 18fa724a7969666dd5aa176af187054abc94bfd3)
2000-10-30Call standard_sub_advanced() after lp_logon_XX() calls.Jeremy Allison1-0/+2
Jeremy. (This used to be commit d5be2334d4fb007e39565b771cbe68e338a7fe68)
2000-10-18Renamed WPrintQueuePurge to WPrintQueueCtrl as this function can purge, pauseTim Potter1-4/+4
or resume a print queue. (This used to be commit 9998518a69c67c1540266549c69fca977a89acde)
2000-10-06global_myname is actually a pstring.Tim Potter1-1/+1
(This used to be commit e451fd346105d5d34354ff9141d445b5f1a82e0a)
2000-09-01Changes from APPLIANCE_HEAD (per Tim Potter):David O'Neill1-12/+16
- make proto - addition of function to convert from errno values to NT status codes (source/lib/error.c) - purge queue done without full access permission will purge only the jobs owned by that user, rather than failing. - unlock job database tdb before sending job to printer - in print_job_start(), ensure that we don't pick a jobid with an existing temporary file that may be owned by another user, as it causes silent failures. - fixes for printer permission checking for NT5 clients (source/include/rpc_spoolss.h, source/printing/nt_printing.c, source/printing/printing.c, source/rpc_server/srv_spoolss_nt.c) - change from uint8 to 'enum SID_NAME_USE' (source/rpc_server/srv_lsa.c) - fixed memory leaks for win95 driver download process (source/smbd/lanman.c) - properly free prs_structs and dacl in testsuite/printing/psec.c (This used to be commit 74af3e2caec7197e5d1ca389e2f78054a4197502)
2000-08-31make sure a couple of variables are initialisedAndrew Tridgell1-2/+2
(This used to be commit 155c7c37398f5f9457ea249ded74f425b90ac9a0)
2000-08-30Implemented AbortPrinter() from Gerald's Win32 test code. Just purge allJeremy Allison1-3/+3
possible printjobs from that printer (I think this is correct). Added error code returns for print_queue_XXX() functions. Jeremy. (This used to be commit 6d081a9017f87f59b7189ba507e211db01c40af5)
2000-08-29fixed previous bug spotted by Elrond in get_printerdrivernumber().Gerald Carter1-16/+17
Thought I had already committed this. jerry (This used to be commit 2ceb704c3d06a92b97ba67ac82c007a7ba084b75)
2000-08-17Fix for Win9x driver downloads when information isGerald Carter1-83/+153
stored in the TDB. See the message I posted about this on samba-technical * If the admin does not desire the new NT print driver support, nothing needs to be done. All existing parameters work the same. * If the admin wants to take advantage of NT printer driver support but does not want to migrate the 9x drivers to the new setup, the leave the existing printers.def file. When smbd attempts to locate a 9x driver for the printer in the TDB and fails it will drop down to using the printers.def (and all associated parameters). The make_printerdef tool will also remain for backwards compatibility but will be moved to the "this tool is the old way of doing it" pile. * If the admin installs a 9x driver for a printer on a Samba host (in the printing TDB), this information will take precedence and the three old printing parameters will be ignored (including print driver location). * If an admin wants to migrate the printers.def file into the new setup, I can write a script to do this using rpcclient. The main problem is the driver namespace (we need the NT driver name first in order to be consistent). jerry (This used to be commit ac049f8bf348810dc068382fdbc6635a2015d36a)
2000-08-01Added print job substitutions for %{printername}, %{sharename} and %{portname}Jeremy Allison1-16/+14
from the NT printer tdb. Also added checks for time restrictions before allowing a job to print. Jeremy. (This used to be commit 8cfb55e81abebf0354e6d470ed68bbac1d6560ad)
2000-07-31Added John Reilly's enumports/addprinter/delprinter scripting code plus theJeremy Allison1-49/+43
fix for the Win9x printer drivers. Changed command names to add "command" string on the end for some consistancy with the other scripting commands. Added '%P' option to tdbpack/unpack to store long comment string. Made port name be "Samba Printer Port" if no enum port script given. Fixed prs_uint32_pre code to cope with null args. Jeremy. (This used to be commit 902ada63799cf27924c72e24e7593a8c9fb5eba9)
2000-07-25Fixed up error checking and move printer file code. Fixed a memory leak.Jeremy Allison1-2/+2
Jeremy. (This used to be commit 5130dd0f8b80aed5fb3c0df290b627057cc9b825)
2000-07-19Modified the patch to look in the tdb *first* - thus allowing legacy textJeremy Allison1-75/+91
filed to be ignored when an upload is done. Modified to code to goto err on problems, simplifies it. Jeremy. (This used to be commit 9157a6ab2646c035a731d53aa3be010488ccf51a)
2000-07-19Code from John Reilly <jreilly@hp.com> to add tdb lookups into the Win95Jeremy Allison1-7/+44
printer driver download if looking for the default driver files fail. Jeremy. (This used to be commit 1192d867c4e863471f9bc12afceb68a23ba2142e)
2000-07-10Re-instated lanman printing security checks (oops).Tim Potter1-3/+7
A user can now pause, resume or delete their own job even if they don't have the Manage Documents privilege. Added call to se_access_check() for changing printer properties. The Full Access privilege is required for the user to perform this. Several uninitialised variables and memory leaks plugged. Modified default ACL created on new printers to be Everyone / Print instead of Everyone / Full Access. This required some random stuffing around with the value of the revision field to correspond with the ACL that NT produces when setting the same permission on the printer. Fixed dodgy function call in printing/printfsp.c (This used to be commit 2abce4dcfa351051df6e5f789b34fa99c9b81c22)
2000-07-06Don't check NT permissions when printing from lanman.Tim Potter1-6/+6
(This used to be commit e84607eedf3be454f8f709c70cafc5ded4ea951d)