1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

249 Commits

Author SHA1 Message Date
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
00ab9021b0 Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.
We were reading the endainness in the RPC header and then never propagating
it to the internal parse_structs used to parse the data.
Also removed the "align" argument to prs_init as it was *always* set to
4, and if needed can be set differently on a case by case basis.
Now ready for AS/U testing when Herb gets it set up :-).
Jeremy.
(This used to be commit 0cd37c831d)
2001-03-09 23:48:58 +00:00
Jeremy Allison
93169a1f34 Roll back to using malloc/realloc on some of spoolss in head.
I'm having problems with talloc_realloc in the 2.2 branch and I
want a stable reference.

The only problem is this breaks the clean auto-generated code
in *one* call in srv_spoolss.c (the rfnpcnex call).

Jeremy.
(This used to be commit 57a9340cba)
2001-03-03 05:27:26 +00:00
Jeremy Allison
74294f5a96 Move to talloc controlled NT forms.
Jeremy.
(This used to be commit 3e190e6933)
2001-03-02 00:20:43 +00:00
Jeremy Allison
5161c61bc7 Fixed a couple of getpwXX calls that were not going through the sys_getpwXX
cache.
Jeremy.
(This used to be commit a648935ae9)
2001-03-01 05:21:19 +00:00
Jeremy Allison
0f2799aaf1 Move to talloc control of SPOOL_XXX structs. Move to talloc control of
security descriptors and pointers. Syncup with 2.2 tree.
Jeremy.
(This used to be commit 14d5997dc8)
2001-02-28 00:51:02 +00:00
Jeremy Allison
ed77fca199 include/rpc_spoolss.h: Added JOB_STATUS_XXX defines.
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 71029da7dd)
2001-02-23 03:59:37 +00:00
Jeremy Allison
ffa09ecfc1 lib/select.c: Fix for Linux 2.0.x kernel that causes select to return true on a pipe
and then a blocking read to fail. Make the pipe read/write non blocking.
printing/printing.c: Added a mutex around the code that enumerates all the jobs in a
                    print queue. Allows only one smbd to be doing this at any one time.
                    This fixes a capacity problem discovered at HP with <10,000 jobs in
                    a print queue.
Jeremy.
(This used to be commit 0d3ae603a2)
2001-02-22 17:39:36 +00:00
Jeremy Allison
201753ddc6 Fixed file descriptor leak in error processing of print jobs.
NT sends "delete on close" to cancel a print job copied from the command line.
Deal with this. Merged JohnR's fixes for print job errors.
Jeremy.
(This used to be commit 2060d74e48)
2001-02-22 01:31:55 +00:00
Jeremy Allison
fd46817f0b Excise snprintf -> slprintf.
srv_samr.c: duplicate gid fix.
srv_spoolss_nt.c: Merge of JF's work.
uid.c: Fix for returning names when a PDC.
Jeremy.
(This used to be commit d938ad6963)
2001-02-16 19:21:18 +00:00
Herb Lewis
c237db1c11 DEBUG merge from 2.2 about tdb init failure.
Patch from David Collier-Brown to print permission error on spool file
creation.
(This used to be commit 8907a51743)
2001-02-15 19:33:57 +00:00
Jeremy Allison
94fc44a93c Merge of JohnR's changes to appliance-head, JF's changes to 2.2,
updated the POSIX_ACL code to be in sync.
Jeremy.
(This used to be commit c0517d6f4e)
2001-02-12 16:18:02 +00:00
David O'Neill
2506c61ab3 Changes from APPLIANCE_HEAD:
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 025f7a092a)
2001-01-29 21:34:08 +00:00
David O'Neill
221926402a Changes from APPLIANCE_HEAD:
source/printing/nt_printing.c
        - fix for Win2k sending NULL devicemode in setprinter calls which
          was making NT4 grumpy.  The solution is to never set a NULL
          devicemode if we previously had a valid one in the printer's TDB
          entry.
(This used to be commit b9036a0778)
2001-01-26 18:13:17 +00:00
David O'Neill
e31bf05363 Changes from APPLIANCE_HEAD:
source/printing/printing.c
        - When deleting a job, remove the entry from the back-end database
          if the delete succeeded.  This stops a spurious permission denied
          message appearing if the forced database update is within the lpq
          cache timeout and doesn't actually delete the job from the
          database.
(This used to be commit be61c98832)
2001-01-24 16:46:08 +00:00
David O'Neill
eee29958f5 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - add an access check to _spoolss_deleteprinter() to stop random
          users and passers by from deleting printers.

    source/lib/messages.c
        - converted global msg_all struct to a local in message_send_all()
          function.

    source/include/smb.h
        - added a success error code to the spoolss return codes.

    source/include/proto.h
    source/param/loadparm.c
    source/printing/printing.c
        - Added new parameter "total print jobs" to limit the total number
          of print jobs across all queues. Currently individual queues are
          limited by "max print jobs".
(This used to be commit 02f154e729)
2001-01-23 20:25:25 +00:00
David O'Neill
b9c5be4d79 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - remove redundant srv_spoolss_sendnotify() calls from
          _spoolss_startdocprinter() and _spoolss_enddocprinter(), as its
          functionality is already covered in print_job_start() and
          print_job_end()

    source/printing/printing.c
        - force a print_queue_update() prior to print queue purge so that
          all jobs are purged.
(This used to be commit 0ccc552203)
2001-01-23 17:39:03 +00:00
David O'Neill
3ea544fecb Changes from APPLIANCE_HEAD:
source/printing/printing.c
		- remove unused variable
(This used to be commit 2d09b53b3a)
2001-01-22 19:46:22 +00:00
David O'Neill
7599c82cce Changes from APPLIANCE_HEAD:
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 0235fbef37)
2001-01-22 16:59:24 +00:00
David O'Neill
a5b27e9cea Changes from APPLIANCE_HEAD:
source/printing/nt_printing.c
        - use se_create_child_secdesc() to create appropriate security
          descriptor when performing print job admin security checks.

    source/printing/printing.c
        - Use JOB_ACCESS_ADMINISTER instead of PRINTER_ACCESS_ADMINISTER in
          print_job_{delete,pause,resume}()
        - If stat'ing the job file fails, delete the job from printing.tdb
        - In print_job_end() check lpq cache time and do a
          print_queue_update() This prevents printing.tdb from growing when
          using NT/2K clients, and there isn't someone pressing F5 in a
          port monitor window.
        - In print_queue_resume() check lpq cache time and do a
          print_queue_update() Probably should do it for print_job_resume()
          too.
(This used to be commit 0068b7741f)
2001-01-19 16:57:39 +00:00
David O'Neill
792ca5d989 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - Unrolled construct_notify_jobs_info() loop to only fetch
          printer info_2 structure once rather than num_print_jobs times.
        - convert command to unix codepage.
        - remove lp_remove_service() call as it prevents lp_killservice()
          from working.
        - Modified some DEBUG and DEBUGADD statements.

    source/param/loadparm.c
    source/param/params.c
        - change printer, preload, auto services to FLAG_DOS_STRING,
          reverted earlier changes to szPrintername et al, add comments.

    source/printing/load.c
        - fix bug with lp_auto_services() and strtok()

    source/printing/nt_printing.c
    source/printing/printing.c
        - remove redundant test that used SERVICE(snum)

    source/printing/pcap.c
        - add unix_to_dos() calls, add notes wrt FIXMEs for
          xxx_printer_fn() functions.

    source/web/swat.c
        - added FIXME comment.

    source/smbd/service.c
        - added comment re: dos codepage
(This used to be commit 7b774b72c2)
2001-01-17 18:47:46 +00:00
David O'Neill
3380ffae9c Changes from APPLIANCE_HEAD:
testsuite/printing/psec.c
        - Use lock directory from smb.conf parameter when peeking at the
          ntdrivers.tdb file.
    source/rpc_parse/parse_sec.c
        - fix typo in debug message
    source/script/installbin.sh
        - create private directory as part of 'make install'.
    source/nsswitch/winbindd_cache.c
    source/nsswitch/winbindd_idmap.c
    source/passdb/secrets.c
    source/smbd/connection.c
        - always convert tdb key to unix code-page when generating.
    source/printing/nt_printing.c
        - always convert tdb key to unix code-page when generating.
        - don't prepend path to a filename that is NULL in
          add_a_printer_driver_3().
    source/rpc_server/srv_spoolss_nt.c
        - always convert tdb key to unix code-page when generating.
        - don't prepend server name to a path/filename that is NULL in the
          fill_printer_driver_info functions.
    source/printing/printing.c
        - always convert tdb key to unix code-page when generating.
        - move access check for print_queue_purge() outside of job delete
          loop.
    source/smbd/unix_acls.c
        - fix for setting ACLs (this got missed earlier)
    source/lib/messages.c
        - trivial sync with appliance_head
(This used to be commit 376601d17d)
2001-01-11 20:41:19 +00:00
David O'Neill
ab60974082 Changes merged from APPLIANCE_HEAD:
source/printing/printing.c
    source/rpc_server/srv_spoolss_nt.c
        - convert args for print command to unix codepage.
(This used to be commit 1c0ae957f8)
2001-01-08 19:58:30 +00:00
David O'Neill
23807f2b30 Changes from APPLIANCE_HEAD:
source/Makefile.in
        - changes to ctags and etags rules that somehow got lost along the way.

    source/include/proto.h
        - make proto

    source/smbd/sec_ctx.c
    source/smbd/password.c
        - merge debugs for debugging user groups and NT token stuff.

    source/lib/util_str.c
        - capitalise domain name returned from parse_domain_user()

    source/nsswitch/wb_client.c
        - fix broken conditional in debug statement.

    source/include/rpc_secdes.h
    source/include/rpc_spoolss.h
    source/printing/nt_printing.c
    source/lib/util_seaccess.c
        - fix printer permission bugs related to ACE masks for printers.
          This adds mapping of generic access rights to object specific
          rights for NT printers.  Still need to work out whether or not to
          ignore ACEs with certain flags set, though. See comments in
          util_seaccess.c:check_ace() for details.

    source/printing/nt_printing.c
    source/printing/printing.c
        - use PRINTER_ACCESS_ADMINISTER instead of JOB_ACCESS_ADMINISTER
          until we sort out printer/printjob permission stuff.
(This used to be commit 1dba9c5cd1)
2001-01-04 19:27:08 +00:00
Gerald Carter
b0a219686b merge from appliance head
(This used to be commit 393c5f14e0)
2000-12-21 23:38:47 +00:00
Jeremy Allison
452102deb4 Merged Tim's fixes from appliance-head.
Jeremy.
(This used to be commit 26f873540c)
2000-12-18 06:02:31 +00:00
Jeremy Allison
369f5fd1d7 Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. Merged
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open
problem.
Jeremy.
(This used to be commit 0a40bc83e1)
2000-12-15 01:02:11 +00:00
David O'Neill
2e87e6e8c8 Changes from APPLIANCE_HEAD:
- trivial typo in definition of enum_printing[]
	  (source/param/loadparm.c)
	- fixed printer status display bug.  When no jobs existed in queue, the
	  clients were not properly notified of printer status.  This caused
	  native tools for pausing/unpausing a print queue to not work.
	  (source/printing/printing.c)
(This used to be commit c533e77f19)
2000-12-13 21:24:06 +00:00
Jeremy Allison
5c67f8de46 Added proto definition for new RPC calls.
Added printing fix from appliance-head.
Jeremy.
(This used to be commit f4c7f9ddb9)
2000-12-13 19:55:48 +00:00
Jeremy Allison
a95ccc2779 Adding in debug for SD's.
Jeremy.
(This used to be commit a19f936b64)
2000-12-11 19:24:59 +00:00
Jeremy Allison
cf5b71994d file_lines_load/file_lines_pload can now optionally convert unix_to_dos()
on read.
Jeremy.
(This used to be commit 76b8dd376d)
2000-12-07 19:26:04 +00:00
Jeremy Allison
b2d1c4fdee Sync-up with appliance-head printing code.
Jeremy.
(This used to be commit fe730614d7)
2000-12-06 00:37:25 +00:00
Andrew Tridgell
9b8a930f2c c++ style comments are NOT allowed
(This used to be commit 8b3c1f4455)
2000-12-04 03:01:31 +00:00
Andrew Tridgell
0e494d7ec6 no longer pass the type to make_sec_desc(), instead the type is
derived from the other arguments
(This used to be commit 9ec4b1fa48)
2000-12-04 01:58:22 +00:00
Jeremy Allison
0f1c800f85 passdb/secrets.c passdb/smbpassfile.c smbd/server.c : Actually *use* the code
written to transition from an old DOMAIN.MACHINE.MAC file to secrets.tdb.
printing/nt_printing.c: Fix case insensitive name lookups for driver files.
John - this should fix the Win9x/WinME problem correctly.
Jeremy.
(This used to be commit 8f3332a9ac)
2000-11-27 23:59:42 +00:00
Jeremy Allison
2bd3a436fd Fix for updating of print queues changed from a local box. Essentially,
this makes sure that the change messages sent to ourselves are handled
synchronously w.r.t. other smb packets incoming.
Jeremy.
(This used to be commit 78a1307445)
2000-11-21 00:30:15 +00:00
Jeremy Allison
475fb713a9 Fix for memory leak when adding driver.
Jeremy.
(This used to be commit eeab4e0290)
2000-11-17 02:22:35 +00:00
Jeremy Allison
826c2f9269 Fix for incorrect break using wrong offset when updating a form.
Jeremy.
(This used to be commit 365c76e39d)
2000-11-17 00:31:29 +00:00
Jeremy Allison
cdac09614e Fix for a problem with the new messaging system. If a sender is using the
messaging system as a notification mechanism, and the speed of notification
greatly exceeds the speed of message recovery, then you get a massively (>75Mb)
growing tdb. If the message is a simple notification, then the message is
static, and you only need one of them in transit to a target process at
any one time.
This patch adds a BOOL "allow_duplicates" to the message_send_XX primitives.
If set to False, then before sending a message the sender checks the existing
message queue for a target pid for a duplicate of this message, and doesn't
add to it if one already exists.
Also added code into msgtest.c to test this.
Jeremy.
(This used to be commit 3aa7995660)
2000-11-16 21:38:24 +00:00
Jeremy Allison
14355a6434 Uninitialized memory read fixes.
open_file_shared takes a DOS pathname, not a UNIX one.
Jeremy.
(This used to be commit b2b59b93ff)
2000-11-15 02:39:11 +00:00
Jeremy Allison
e8d43bbfe4 Tuyrn debug timestamps on by default.
Add Tim's lpq race fix.
Jeremy.
(This used to be commit d43405bc47)
2000-11-15 01:11:38 +00:00
Jeremy Allison
4bce271e4f Merge from appliance head of JR's changes for driver versioning.
Jeremy.
(This used to be commit cdbd2e9977)
2000-11-14 21:56:32 +00:00
David O'Neill
f9680a444b Changes from APPLIANCE_HEAD:
- merged Tim's vlp (virtual lp) test program.  Enable it with
      -DDEVELOPER or by using ./configure.developer
	  (source/include/smb.h source/configure.developer
	   source/printing/lpq_parse.c source/param/loadparm.c
	   testsuite/printing/.cvsignore testsuite/printing/Makefile.vlp
	   testsuite/printing/vlp.c)
(This used to be commit fbcf83140d)
2000-11-14 15:26:53 +00:00
Jeremy Allison
e0bcc7ff54 printing/nt_printing.c: After long soul searching and making both Andrew and my
life a misery, here is the only possible null driver fix we have found.
		This *SUCKS*.
rpc_server/srv_spoolss_nt.c: Correct printername search. Correct portname reply
						Correct attributes reply. Removal of unused temp variable.
Jeremy.
(This used to be commit 06e71c9f8b)
2000-11-14 02:14:58 +00:00
Gerald Carter
9fede0dc0d Large commit which restructures the local password storage API.
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 0b92d0838e)
2000-11-13 23:03:34 +00:00
Jeremy Allison
108f86dccc Added Tim's changes to lock DB during update.
Jeremy.
(This used to be commit f25b5798b8)
2000-11-10 22:05:08 +00:00
Jeremy Allison
c1900772ce printing/nt_printing.c: use getpwuid not smbgetpwuid. Canonicalize printernames.
printing/printing.c: Insure fix for malloc of zero.
rpc_parse/parse_misc.c: Enusre UNISTR's are zero filled.
rpc_parse/parse_spoolss.c: Correct INFO_6 - differs between pre-releases of W2K and shipping build.
rpc_server/srv_spoolss_nt.c: Canonicalize printernames.
Jeremy.
(This used to be commit b17e23a8ff)
2000-11-10 19:36:34 +00:00
Andrew Tridgell
3adc0e7a4e an attempt to get the handling of fields in printer info structures
consistent. Still working with Jeremy on this, there is probably more
to be done
(This used to be commit c4bb9c598c)
2000-11-08 03:12:16 +00:00
Tim Potter
dd2f6f448d Merge of latest round of printing fixes from appliance branch.
(This used to be commit 8fe17fd594)
2000-11-07 23:05:53 +00:00
Tim Potter
8a190a9e46 Merge of printer security descriptor, info level and printerdata
comparison changes from appliance branch.
(This used to be commit ae087bdf31)
2000-11-07 02:54:50 +00:00