ira/wip.git
23 years agocleanup in init_unistr2_from_unistr()
Gerald Carter [Tue, 8 Aug 2000 06:59:35 +0000 (06:59 +0000)]
cleanup in init_unistr2_from_unistr()

--jerry
(This used to be commit 1e00ac19cd001024fa8007eff5137aac877796fa)

23 years agoAll changes related to rpcclient...
Gerald Carter [Tue, 8 Aug 2000 06:57:48 +0000 (06:57 +0000)]
All changes related to rpcclient...

- cleaned up some code
- Fixed a few memory leaks of my own making
- Add AddPrinterDriver(); I'm missing some of the semantics
  here as the call is done correctly, but I'm not getting all
  the information right in the DRIVER_INFO_3 struct I think.
  Will work on it tomorrow some more...

--jerry
(This used to be commit 3bf9a29f34ee4ade5180c5a0b0b9ff4aca7f0f08)

23 years agoit is not my day it seems. :-(
Gerald Carter [Sat, 5 Aug 2000 19:18:25 +0000 (19:18 +0000)]
it is not my day it seems.  :-(
Fixed missing )

j-
(This used to be commit 7b69cbbde36e51f8f7b74691428a04e8871d8b4a)

23 years agoremoved the for() loop to copy the buffer in init_unistr2_from_unistr()
Gerald Carter [Sat, 5 Aug 2000 19:03:00 +0000 (19:03 +0000)]
removed the for() loop to copy the buffer in init_unistr2_from_unistr()
Replaced with a memcpy()

Forgot to commit this a few moments ago

j-
(This used to be commit 34d4fb54c3121d31cb8b29193f71d5e7b5471cdc)

23 years agoFixed bug in init_unistr2_from_unistr() found by Elrond.
Gerald Carter [Sat, 5 Aug 2000 18:58:45 +0000 (18:58 +0000)]
Fixed bug in init_unistr2_from_unistr() found by Elrond.
Thanks :-)

j-
(This used to be commit 4ecd15cd5851e94808756e3da0ce6a066f0a0cd7)

23 years agoAdding build file.
John Terpstra [Fri, 4 Aug 2000 21:03:10 +0000 (21:03 +0000)]
Adding build file.
(This used to be commit b87c47cc8638a1930e55a45a126a778b188ce688)

23 years agoAdding build system files for Caldera OpenLinux.
John Terpstra [Fri, 4 Aug 2000 20:53:28 +0000 (20:53 +0000)]
Adding build system files for Caldera OpenLinux.
(This used to be commit 8de3786f5ad473aab90bb3fbf7e6ca2714f91751)

23 years agomake proto
Gerald Carter [Fri, 4 Aug 2000 20:47:06 +0000 (20:47 +0000)]
make proto
(This used to be commit dfd6b51bc7fb61d25af3074c386ce51cf3bc86f4)

23 years agospoolss_addprinterex() was adding the printer and returning the
Gerald Carter [Fri, 4 Aug 2000 20:32:34 +0000 (20:32 +0000)]
spoolss_addprinterex() was adding the printer and returning the
correct handle, but was deleting the connection to the server.
Doh!!

--jerry
(This used to be commit 8e5e929561a1ae954bd60f7bd745d697438f835c)

23 years agoFixed up se_access_check() to use the token list from the user struct
Jeremy Allison [Fri, 4 Aug 2000 19:56:58 +0000 (19:56 +0000)]
Fixed up se_access_check() to use the token list from the user struct
as the SID list. Now to go through and tidy up the algorithm.
Jeremy.
(This used to be commit 1f7300df6713a6728feb1600ca7e62fc213232fc)

23 years agoAdded my course notes. Had asked Jeremy some weeks ago.
Volker Lendecke [Fri, 4 Aug 2000 16:08:04 +0000 (16:08 +0000)]
Added my course notes. Had asked Jeremy some weeks ago.
It's german language, feel free to remove it again.

Volker
(This used to be commit a40f22427a05903dfb98e9cb849698b33b8bca90)

23 years agomake proto
Gerald Carter [Fri, 4 Aug 2000 13:30:52 +0000 (13:30 +0000)]
make proto
(This used to be commit 6bdb7d5c9787bd16e851f5c751d952c4df8ccc5b)

23 years agoclunky support for calling AddPrinterEx(). The code currently reports
Gerald Carter [Fri, 4 Aug 2000 12:46:36 +0000 (12:46 +0000)]
clunky support for calling AddPrinterEx().  The code currently reports
that the call failed, but the printer shows up on the remote NT client.
(note this is the client side call).  I've botched the return value
somewhere and will fix that today.

jerry
(This used to be commit e15d9befd24cf5f3410c4be819b2a1fcf68048fb)

23 years agoAfter talking with Jeremy and JF (and staring at packet traces between
Gerald Carter [Fri, 4 Aug 2000 12:42:19 +0000 (12:42 +0000)]
After talking with Jeremy and JF (and staring at packet traces between
NT <-> NT), I've come to realize that UNISTR2 strings should be NULL
terminated.

jerry
(This used to be commit c8f9e54beafcb0c0668f1510e7693dbf22485aa8)

23 years agoIn cli_error() return ENOENT when an ERROR_INVALID_NAME is received instead
Tim Potter [Fri, 4 Aug 2000 06:13:05 +0000 (06:13 +0000)]
In cli_error() return ENOENT when an ERROR_INVALID_NAME is received instead
of the generic EINVAL.
(This used to be commit a290107aee01a85ca1ef5565f23c8f00e18e98c2)

23 years agoFixed up the user/group contexts when using authenticated pipes.
Jeremy Allison [Fri, 4 Aug 2000 00:59:09 +0000 (00:59 +0000)]
Fixed up the user/group contexts when using authenticated pipes.
Added a become_root()/unbecome_root() (push/pop security context)
around the initgroups() call to ensure it would succeed. Hmmm - I
wonder if this call being done as non-root might explain any "group access"
bugs we've had in the past....
Jeremy.
(This used to be commit 06a65972e872f37d88b84f22ea714feebd38f6c0)

23 years agoAdded an NT_USER_TOKEN structure that is copied/passed around associated
Jeremy Allison [Thu, 3 Aug 2000 22:38:43 +0000 (22:38 +0000)]
Added an NT_USER_TOKEN structure that is copied/passed around associated
with the current user. This will allow se_access_check() to quickly do
a SD check without having to translate uid/gid's to SIDs.
Still needs work on pipe calls.
Jeremy.
(This used to be commit e28d01b744b3dbd33e0e54af4e7f426fa8c082b8)

23 years agoMuch though I hate to admit it - JF was completely correct. I cannot
Jeremy Allison [Wed, 2 Aug 2000 18:49:36 +0000 (18:49 +0000)]
Much though I hate to admit it - JF was completely correct. I cannot
now reproduce the bug I had with adding a printer driver, and PrintMig.exe
crashes if I use my SD code but works with his.
I stand completely corrected :-). - So I'm reverting to his code as it works :-).
Jeremy.
(This used to be commit d6db29be98f717a9038b5ac1ff492c70ce2e92a7)

23 years agoStarted to canonicalize our handling of uid -> sid code in order to
Jeremy Allison [Wed, 2 Aug 2000 02:11:55 +0000 (02:11 +0000)]
Started to canonicalize our handling of uid -> sid code in order to
get ready and fix se_access_check().
Added cannonical lookup_name(), lookup_sid(), uid_to_sid(), gid_to_sid()
functions that look via winbind first the fall back on local lookup.

All Samba should use these rather than trying to call winbindd code
directly.

Added NT_USER_TOKEN struct in user_struct, contains list of NT sids
associated with this user.

se_access_check() should use this (cached) value rather than attempting
to do the same thing itself when given a uid/gid pair.

More work needs to be done to preserve these things accross security
context changes (especially with the tricky pipe problem) but I'm
beginning to see how this will be done..... probably by registering
a new vuid for an authenticated RPC pipe and not treating the
pipe calls specially.

More thoughts needed - but we're almost there...

Jeremy.
(This used to be commit 5e5cc6efe2e4687be59085f562caea1e2e05d0a8)

23 years agoTidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Jeremy Allison [Tue, 1 Aug 2000 18:32:34 +0000 (18:32 +0000)]
Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more
obscure way.
Jeremy.
(This used to be commit c55bcec817f47d6162466b193d533c877194124a)

23 years agoAdded print job substitutions for %{printername}, %{sharename} and %{portname}
Jeremy Allison [Tue, 1 Aug 2000 00:41:19 +0000 (00:41 +0000)]
Added print job substitutions for %{printername}, %{sharename} and %{portname}
from the NT printer tdb.
Also added checks for time restrictions before allowing a job to print.
Jeremy.
(This used to be commit 8cfb55e81abebf0354e6d470ed68bbac1d6560ad)

23 years agoSave & restore the port name correctly.
Jeremy Allison [Mon, 31 Jul 2000 21:41:03 +0000 (21:41 +0000)]
Save & restore the port name correctly.
Jeremy.
(This used to be commit c0648c981edef2a29b3a22a7d08aa226ca724e95)

23 years agoAdded John Reilly's enumports/addprinter/delprinter scripting code plus the
Jeremy Allison [Mon, 31 Jul 2000 20:41:51 +0000 (20:41 +0000)]
Added John Reilly's enumports/addprinter/delprinter scripting code plus the
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)

23 years agomake proto
Gerald Carter [Mon, 31 Jul 2000 15:17:29 +0000 (15:17 +0000)]
make proto
(This used to be commit 38b07395566a2c114ccda173fb0fe88cf7683588)

23 years agoMore work on rpcclient...
Gerald Carter [Mon, 31 Jul 2000 14:56:01 +0000 (14:56 +0000)]
More work on rpcclient...

  * Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx

--jerry
(This used to be commit d321d0dddd052b49c94bef8f214be7343337d907)

23 years agoMore work on rpcclient...
Gerald Carter [Mon, 31 Jul 2000 14:50:53 +0000 (14:50 +0000)]
More work on rpcclient...

  * Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx

--jerry
(This used to be commit 45fbf31b698d6e754630590034cff712c0a716b1)

23 years agoAdding pages oopsed.
John Terpstra [Sun, 30 Jul 2000 07:40:18 +0000 (07:40 +0000)]
Adding pages oopsed.
(This used to be commit 7df53b821132f334d0752b757778818cae634d46)

23 years agoAdding Using_Samba book back to Samba-pre3.
John Terpstra [Sun, 30 Jul 2000 07:38:43 +0000 (07:38 +0000)]
Adding Using_Samba book back to Samba-pre3.
(This used to be commit 9f5f8ad21d9c7f5efb69abbe08ee2e34b787e68b)

23 years agoAdding missing man pages.
John Terpstra [Sun, 30 Jul 2000 06:52:16 +0000 (06:52 +0000)]
Adding missing man pages.
(This used to be commit 25091dcf7c194b450e95e2a673423d2d0ad7f272)

23 years agoAdding missing smbsh.1 man page source.
John Terpstra [Sun, 30 Jul 2000 06:50:39 +0000 (06:50 +0000)]
Adding missing smbsh.1 man page source.
(This used to be commit 856a3773dcad4a8665e097a07e7bb992ffea4c74)

23 years agoUpdating for Samba-3.
John Terpstra [Sun, 30 Jul 2000 06:37:46 +0000 (06:37 +0000)]
Updating for Samba-3.
(This used to be commit 183d55b2ae38305f68ca677f6d413a54bd122394)

23 years agoAdding files provided by Klaus Singvogel of Caldera
John Terpstra [Sun, 30 Jul 2000 06:33:30 +0000 (06:33 +0000)]
Adding files provided by Klaus Singvogel of Caldera
(This used to be commit ab6d01bdccf3106c00563173bfb3e3b3d7c3a64c)

23 years agoFixed read overrun in init_string2()
Tim Potter [Fri, 28 Jul 2000 06:27:32 +0000 (06:27 +0000)]
Fixed read overrun in init_string2()
(This used to be commit 4ab75143c4466ad0ea8443512dd5ade449d72462)

23 years agoremove warnings
Jean-François Micouleau [Thu, 27 Jul 2000 08:00:25 +0000 (08:00 +0000)]
remove warnings

J.F.
(This used to be commit 9178d2a1aac26f8d6533f7dc86ff9b19eb72db8b)

23 years agofix the devmode.orientation being set to 0.
Jean-François Micouleau [Thu, 27 Jul 2000 07:59:39 +0000 (07:59 +0000)]
fix the devmode.orientation being set to 0.

that bug was *subtle* :-(

J.F.
(This used to be commit 0e9e048b6d65b57bdcc7440ddaa9d2cc1eac71dc)

23 years agoOk - this is a *BIG* change - but it fixes the problems with static strings
Jeremy Allison [Thu, 27 Jul 2000 00:47:19 +0000 (00:47 +0000)]
Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
(This used to be commit 0ff2ce543ee54f7364e6d839db6d06e7ef1edcf4)

23 years agoif no comment in TDB, use comment from print share.
Jean-François Micouleau [Wed, 26 Jul 2000 10:31:05 +0000 (10:31 +0000)]
if no comment in TDB, use comment from print share.

J.F.
(This used to be commit c267b23620677a11f702bfea4885a28e66a05b05)

23 years agoFound out that we are crashing spoolss in enumprinterdata.
Jean-François Micouleau [Wed, 26 Jul 2000 09:40:49 +0000 (09:40 +0000)]
Found out that we are crashing spoolss in enumprinterdata.

So fixed enumprinterdatas in rpcclient to debug the server code,
and found that the parsing code was missing 2 prs_align().

We are not crashing NT anymore. :-)

        J.F.
(This used to be commit 883f7402d495182aeff85152216cc8b3cfc18bef)

23 years agoFixed memory leaks in root and non-root password changing.
Tim Potter [Wed, 26 Jul 2000 03:55:17 +0000 (03:55 +0000)]
Fixed memory leaks in root and non-root password changing.
(This used to be commit f3a4f81a5e51e411f1c7c6245597cca01e9ad5b2)

23 years agoFixed memory leaks in _spoolss_addprinterdriver()
Tim Potter [Wed, 26 Jul 2000 03:38:30 +0000 (03:38 +0000)]
Fixed memory leaks in _spoolss_addprinterdriver()
(This used to be commit 1f49788442b0d1264c70166e727b8588b936e6ec)

23 years agoFixed memory leak in modify_trust_password()
Tim Potter [Wed, 26 Jul 2000 03:04:01 +0000 (03:04 +0000)]
Fixed memory leak in modify_trust_password()
(This used to be commit 7145689bf55b9f3100632badac486fde30ee4972)

23 years agoFixed up error checking and move printer file code. Fixed a memory leak.
Jeremy Allison [Tue, 25 Jul 2000 22:35:57 +0000 (22:35 +0000)]
Fixed up error checking and move printer file code. Fixed a memory leak.
Jeremy.
(This used to be commit 5130dd0f8b80aed5fb3c0df290b627057cc9b825)

23 years agomake proto
Gerald Carter [Tue, 25 Jul 2000 21:14:49 +0000 (21:14 +0000)]
make proto

--jerry
(This used to be commit 1f65b13dd56fbe41320f6c4e8f391ce739509e45)

23 years agosome initial code for AddPrinterEx() project. Most is ifdef'd out
Gerald Carter [Tue, 25 Jul 2000 21:07:46 +0000 (21:07 +0000)]
some initial code for AddPrinterEx() project.  Most is ifdef'd out
'cause it's not all written.

-jerry
(This used to be commit 2c0f6bcc8f926ee9c17de12671075e8a9239bb94)

23 years agoif the sids are not the same pointer and either of the sids are NULL
Andrew Tridgell [Tue, 25 Jul 2000 20:26:50 +0000 (20:26 +0000)]
if the sids are not the same pointer and either of the sids are NULL
then the two sids are not equal
(This used to be commit 9ccf3b1dc5baf0e00d032d8b932ab0fb5b1e11b1)

23 years agoAdded some error checking and returns to the new 'move' code.
Jeremy Allison [Tue, 25 Jul 2000 17:09:29 +0000 (17:09 +0000)]
Added some error checking and returns to the new 'move' code.
Jeremy.
(This used to be commit 0bd88d304cd773e0bbf3e6f7fedcb3b544d41cbe)

23 years agoA rather big change set ! (listed in no particular order)
Jean-François Micouleau [Tue, 25 Jul 2000 13:15:16 +0000 (13:15 +0000)]
A rather big change set ! (listed in no particular order)

- changed the default forms flag to 2
- all short architecture name are uppercased
- get_short_archi() is now case unsensitive
- the drivers TDB is indexed by archi/version/name
- implemented code to move drivers from the upload area to the download
area. Someone else need to look at that code.
- don't return anymore a default driver if it doesn't exist in the TDB.
Instead return an error.
- cleaned prs_unistr.
- #ifdef out jeremy's new SD parsing in printer_info_2
- removed the unused MANGLE_CODE

- #ifdef out the security checking in update_printer() as it doesn't work
for me.

Zap your ntdrivers.tdb, it won't work anymore.

J.F.
(This used to be commit ac0a145acc0953a6f362497abbf4dfe70aa522a6)

23 years agoFix for mounting a printer as a share. Not that there's anything
Tim Potter [Tue, 25 Jul 2000 06:10:59 +0000 (06:10 +0000)]
Fix for mounting a printer as a share.  Not that there's anything
specifically wrong with this, but Samba is fooled by the client into
thinking the printer is a file share.  Files copied to the share gather
dust in the spool directory and aren't printed.

This patch has the effect of not allowing printers to be mounted as file
shares.  Not sure whether this is the correct solution or not.
{Jeremy,JF,Tridge} please check!
(This used to be commit dcf3249bb9fef2a05b376e9c8c1a0a7d602d8a2e)

23 years agoTidy up code to add printer. Always index in tdb by sharename. This
Jeremy Allison [Tue, 25 Jul 2000 01:50:53 +0000 (01:50 +0000)]
Tidy up code to add printer. Always index in tdb by sharename. This
is beginning to come together...
Jeremy.
(This used to be commit 614bf56186b5836020a7813855a5108da0ee8433)

23 years agoRun main server loop with sys_select() instead of sys_select_intr(). The
Tim Potter [Mon, 24 Jul 2000 06:20:13 +0000 (06:20 +0000)]
Run main server loop with sys_select() instead of sys_select_intr().  The
main daemon was not catching sighup and reloading the service file.
(This used to be commit f026a897e9296a71fb5c4d5f6e1b4d3287689bde)

23 years agoTest for reloading smb.conf after SIGHUP. Needs to be run as root.
Tim Potter [Mon, 24 Jul 2000 06:18:21 +0000 (06:18 +0000)]
Test for reloading smb.conf after SIGHUP.  Needs to be run as root.
(This used to be commit db54e72d2f67b07d42bff16c64fbadf0d031e365)

23 years agoFixed open handle code in printers - 3 functions were always being done
Jeremy Allison [Sat, 22 Jul 2000 00:48:29 +0000 (00:48 +0000)]
Fixed open handle code in printers - 3 functions were always being done
in order - moved them into open_printer_hnd().
Added saving of comment field.
Jeremy.
(This used to be commit a0ee774fe92e5d0bc84d1d6729e8c538c67e8aba)

23 years agomake proto
Gerald Carter [Fri, 21 Jul 2000 20:10:52 +0000 (20:10 +0000)]
make proto
(This used to be commit e4af400ed6580c04bcaf3a28fe8aeaa0cdbd4dcf)

23 years ago* Added EnumPorts()
Gerald Carter [Fri, 21 Jul 2000 20:03:18 +0000 (20:03 +0000)]
* Added EnumPorts()
* Fixed an off-by-one bug noticed by JF in GetPrinterDriverDirectory()

jerry
(This used to be commit a9522f560da64045d928dabedeacdef0a6c3db51)

23 years agoAdded EnumPorts() and fixed up some problems
Gerald Carter [Fri, 21 Jul 2000 20:01:20 +0000 (20:01 +0000)]
Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.

jerry
(This used to be commit a0e8a55c279af50c1f770c7b913262094b9b593a)

23 years agoAdded EnumPorts() and fixed up some problems
Gerald Carter [Fri, 21 Jul 2000 19:59:51 +0000 (19:59 +0000)]
Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.

jerry
(This used to be commit 56ce247977c05ef37888c2572e679c44346e5568)

23 years agoAdded functions for enumerating ports on remote print server.
Gerald Carter [Fri, 21 Jul 2000 19:58:24 +0000 (19:58 +0000)]
Added functions for enumerating ports on remote print server.

Tim,  You should also look at new_smb_io_printer_info_2()
and see if the change from NULL to &i regarding the secdesc is ok.

jerry
(This used to be commit a2205c6646aa677090908a4e1532ed8590adc0e0)

23 years agomake proto
Gerald Carter [Thu, 20 Jul 2000 13:52:02 +0000 (13:52 +0000)]
make proto
(This used to be commit 1246728eb9013948d17ad44263501d1e1bb49e8f)

23 years agoreadded util_list.c (just to the RPCCLIENT_OBJ). I need to split
Gerald Carter [Thu, 20 Jul 2000 13:39:51 +0000 (13:39 +0000)]
readded util_list.c (just to the RPCCLIENT_OBJ).  I need to split
the file up i think.  Later.

--jerry
(This used to be commit ed54a9f4d154ac56330b23255108447036cbd192)

23 years agoFixed unitilized secdesc pointer which was causing spoolgetprinter
Gerald Carter [Thu, 20 Jul 2000 13:38:48 +0000 (13:38 +0000)]
Fixed unitilized secdesc pointer which was causing spoolgetprinter
rpcclient command to fail on shared printers.

jerry
(This used to be commit c8abc31187dbfe6076277896b029fa11443e43bd)

23 years agoModified the patch to look in the tdb *first* - thus allowing legacy text
Jeremy Allison [Wed, 19 Jul 2000 23:47:10 +0000 (23:47 +0000)]
Modified the patch to look in the tdb *first* - thus allowing legacy text
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)

23 years agoCode from John Reilly <jreilly@hp.com> to add tdb lookups into the Win95
Jeremy Allison [Wed, 19 Jul 2000 20:11:11 +0000 (20:11 +0000)]
Code from John Reilly <jreilly@hp.com> to add tdb lookups into the Win95
printer driver download if looking for the default driver files fail.
Jeremy.
(This used to be commit 1192d867c4e863471f9bc12afceb68a23ba2142e)

23 years agoInstead of handing back a string (which might be a DNS name or an IP
Christopher R. Hertel [Wed, 19 Jul 2000 05:32:43 +0000 (05:32 +0000)]
Instead of handing back a string (which might be a DNS name or an IP
string), the wins_srv module now hands back a struct in_addr when it's
called.  It caches the IP address once it has been looked up.  The IP
is cleared (and must be looked up again) if the 'wins server' parameter
is reread, or if the node is marked 'dead'.  A dead node will not be
re-tried for 10 minutes (per a #define in wins_srv.c).

As it was, the code was reading the WINS server name or IP directly from
lp_wins_server.  That's okay, except that if the value was expressed as
a name, then a DNS lookup would be done every time the client wanted to
talk to the server.

I still need to work out the implications of failover regarding the
'unicast subnet' list.

Chris -)-----
(This used to be commit 73aa188320fd3bf10b5dfc057323f40aff2c13bd)

23 years agoFirst cut toward adding WINS server failover.
Christopher R. Hertel [Wed, 19 Jul 2000 01:21:30 +0000 (01:21 +0000)]
First cut toward adding WINS server failover.

*Note: failover doesn't actually work yet!*  It's just that the code I'm
adding provides all of the pieces necessary.

I do have one big question.  Something that I'll have to ask Jeremy, I'm
thinkin'.  In nmbd/nmbd_subnetdb.c the IP of the WINS server is used to
set up the Unicast subnet.

...so what happens if the WINS server changes?

My guess is either:
  a) nothing.
  b) I'd have to change the unicast subnet entry whenever the WINS server
     changes.

Urq.

BTW, the lp_wins_server() function no longer returns the WINS server name
or IP.  It returns the list of WINS servers entered in smb.conf.  To get
the currently 'live' WINS server, use the wins_srv() function.

Fun, eh?

Chris -)-----
(This used to be commit cc08bdc74f4cd111fdc582ee7babef47ed8a950d)

23 years agoRemoved the sanity check on the WINS SERVER parameter because it simply
Christopher R. Hertel [Tue, 18 Jul 2000 20:15:15 +0000 (20:15 +0000)]
Removed the sanity check on the WINS SERVER parameter because it simply
checked to see that only one server was listed.  As I am working on an
enhancement that allows multiple servers to be listed...this was a bit
contrary.  ;)
(This used to be commit 1b718f67675e52520f193a8c71c110246e70723f)

23 years agorpc_parse/parse_prs.c: Removed extraneous ()'s.
Jeremy Allison [Tue, 18 Jul 2000 19:25:32 +0000 (19:25 +0000)]
rpc_parse/parse_prs.c: Removed extraneous ()'s.
rpc_parse/parse_spoolss.c: Fixed the security descriptor marshalling in a INFO_2 struct.
for some reason SD's should be done inline after the info2, not
as the last buffer marshall.
rpc_server/srv_spoolss_nt.c: Removed extraneous ()'s.
Jeremy.
(This used to be commit f038a24e9f624fdb04cd52769d45783248ce8a38)

23 years agoremove util_list from LIB_OBJS since it broke smbd build
Gerald Carter [Tue, 18 Jul 2000 19:05:50 +0000 (19:05 +0000)]
remove util_list from LIB_OBJS since it broke smbd build
(undefined references in link).  This is a quick fix.
I'll resolve things later.

Sorry everyone.

jerry
(This used to be commit ea64f2525d649c0952af52c2ba21a3bac57b322e)

23 years agoAdded lib/util_list.[c|o] to Makefile.in
Gerald Carter [Tue, 18 Jul 2000 05:19:29 +0000 (05:19 +0000)]
Added lib/util_list.[c|o] to Makefile.in

--jerry
(This used to be commit 94967b31bbc913d9b45274d9eed846f871b66b6f)

23 years agoFixed some more client SPOOLSS functions. The following
Gerald Carter [Tue, 18 Jul 2000 05:16:30 +0000 (05:16 +0000)]
Fixed some more client SPOOLSS functions.  The following
functions work now:

  - spoolenum
  - spoolopen
  - spoolgetprinter
  - spoolgetprinterdriver

Items todo:

  - track down memory bug with spoolenumdata
  - fix spoolgetprinterdriverdir
  - fix spoolgetdata
  - fix display_job_info_ctr in spooljobs

All part of the ongoing rpcclient work.

Also included a new generic list ADT.  Cleaner and simplier
than the stuff in util_array.c i think (but then that's why I wrote it).

--jerry
(This used to be commit 381aba2c9a63faa53728f0520ac316478bc7a1c3)

23 years agofixed a bug (my own) in create_ntc_from_cli_state()
Gerald Carter [Tue, 18 Jul 2000 05:13:44 +0000 (05:13 +0000)]
fixed a bug (my own) in create_ntc_from_cli_state()

--jerry
(This used to be commit f7bc6df3befb8d0981dbd96f353039a5913321d7)

23 years agoI really didn't like the way generic arrays (lists) were
Gerald Carter [Tue, 18 Jul 2000 05:12:49 +0000 (05:12 +0000)]
I really didn't like the way generic arrays (lists) were
implemented in util_array.c so I wrote a smaller (and simplier
package).

I would like to replace the use of util_array.c functions
in the rest of the source tree if no one objects.
This will be an interface change, but not really a difference
in the functionality provided.

--jerry
(This used to be commit 0863ce3a31e4c76c8356850ac128f6d96ea54917)

23 years agograb functions that return RPC_HND_NODE (declared
Gerald Carter [Tue, 18 Jul 2000 05:10:26 +0000 (05:10 +0000)]
grab functions that return RPC_HND_NODE (declared
in include/util_list.h)

-- jerry
(This used to be commit ccebd70df2c096de1b183ae072c2c720e2277c6f)

23 years agoFixed some more client SPOOLSS functions. The following
Gerald Carter [Tue, 18 Jul 2000 05:07:28 +0000 (05:07 +0000)]
Fixed some more client SPOOLSS functions.  The following
functions work now:

  - spoolenum
  - spoolopen
  - spoolgetprinter
  - spoolgetprinterdriver

Items todo:

  - track down memory bug with spoolenumdata
  - fix spoolgetprinterdriverdir
  - fix spoolgetdata
  - fix display_job_info_ctr in spooljobs

All part of the rpcclient work.

Jeremy, this check includes emthods for associating
POLICY_HNDs and client states.  See the RpcHndList_...()
function calls (implemented in lib/util_list.c)

--jerry
(This used to be commit 84349394a988213724ca138e9692b3bc44fa0cb8)

23 years agoFixed some more SPOOLSS functions. The following
Gerald Carter [Tue, 18 Jul 2000 05:02:16 +0000 (05:02 +0000)]
Fixed some more SPOOLSS functions.  The following
functions work now:

  - spoolenum
  - spoolopen
  - spoolgetprinter
  - spoolgetprinterdriver

Items todo:

  - track down memory bug with spoolenumdata
  - fix spoolgetprinterdriverdir
  - fix spoolgetdata
  - fix display_job_info_ctr in spooljobs

--jerry
(This used to be commit 15b35912713557119aba5d0cd59605997d6b5ee9)

23 years agoMissing var.
Tim Potter [Mon, 17 Jul 2000 06:04:23 +0000 (06:04 +0000)]
Missing var.
(This used to be commit 5c1c5622269c54dca89eb178ca25981ab7928e75)

23 years agoReverted changes from rpcclient merge - contains memory leak!
Tim Potter [Mon, 17 Jul 2000 05:40:48 +0000 (05:40 +0000)]
Reverted changes from rpcclient merge - contains memory leak!
(This used to be commit dea06ad7a554089a7394cdcb6bf5a766e8e8a6c3)

23 years agoFree security descriptor after access check in update_printer_sec()
Tim Potter [Mon, 17 Jul 2000 05:38:26 +0000 (05:38 +0000)]
Free security descriptor after access check in update_printer_sec()
(This used to be commit bc5f9c00be5b8c2f6d258f0c95ed3b4fc0201b87)

23 years agoInitialise current time to time(NULL) in add_a_printer_2()
Tim Potter [Mon, 17 Jul 2000 05:37:16 +0000 (05:37 +0000)]
Initialise current time to time(NULL) in add_a_printer_2()

Added get and free security old descriptor in nt_printing_setsec() after
access checking was moved up to rpc level.
(This used to be commit a5b7cafc87e14ca3f28dcfc1ed6bcc6f47e79639)

23 years agomake proto
Tim Potter [Mon, 17 Jul 2000 03:13:06 +0000 (03:13 +0000)]
make proto
(This used to be commit df0ef98d7ed41899ce97d20163ab49081347ae83)

23 years agomake proto
Tim Potter [Mon, 17 Jul 2000 02:43:12 +0000 (02:43 +0000)]
make proto
(This used to be commit 4443a8b6e698a6572152e575c41dfb760b9888a9)

23 years agoAllow job owner to delete own print job.
Tim Potter [Mon, 17 Jul 2000 02:42:25 +0000 (02:42 +0000)]
Allow job owner to delete own print job.
(This used to be commit 90b1857c81627e587a7395ee2bdb51b26ea46512)

23 years agoMoved access check for nt_printing_setsec() up into rpc function.
Tim Potter [Mon, 17 Jul 2000 02:41:38 +0000 (02:41 +0000)]
Moved access check for nt_printing_setsec() up into rpc function.

Use sid + rid instead of lp_workgroup()/Administrator for printer owner sid
as per JF's advice.

Default printer owner is either the administrator of the pdc workgroup or
Everyone depending on whether winbindd is running.  Still the subject of
some debate...

Renamed se_access_check() parameters.
(This used to be commit e92e161a813ac0793897ffe3d33b01054912d4c7)

23 years agoRenamed arguments to se_access_check()
Tim Potter [Mon, 17 Jul 2000 02:38:43 +0000 (02:38 +0000)]
Renamed arguments to se_access_check()
(This used to be commit 714b50b47dab46f5cdde49d7c200b353c2e0398a)

23 years agoRenamed a parameter in init_request() function.
Tim Potter [Mon, 17 Jul 2000 02:37:11 +0000 (02:37 +0000)]
Renamed a parameter in init_request() function.

Initialise response structure correctly.
(This used to be commit 587c8e58fdd79dce47fb59ce702596ea58c8b4a6)

23 years agoAdded some debugs.
Tim Potter [Mon, 17 Jul 2000 02:36:19 +0000 (02:36 +0000)]
Added some debugs.

Changed interface to se_access_check to take a user struct instead of each
bit as a separate parameter.
(This used to be commit ff7938310d0636b165b03a2b0a15e51494b2459f)

23 years agoI committed this change to the cliffs archive a while back and have heard
Christopher R. Hertel [Sat, 15 Jul 2000 20:57:24 +0000 (20:57 +0000)]
I committed this change to the cliffs archive a while back and have heard
no complaints.  ;)

Basically, instead of ignoring single-line C-style comments in IDL source
files this change allows token.awk to ignore both single- and multi-line
C-style comments.

Chris -)-----
(This used to be commit 34f69f09f840b8990b718e8585785e2a6ad7c314)

23 years agoLots of changes but no real progress in functionality.
Gerald Carter [Sat, 15 Jul 2000 08:37:17 +0000 (08:37 +0000)]
Lots of changes but no real progress in functionality.
more changes to remove the ncarpc_l_* stuff.

Fixed some cut and paste errors from TNG

There are very subtle bugs in this code.  I'll work on simplifying
them in round two or three.

--jerry
(This used to be commit f8509356178deb7e78836d1f5aceb96677ac738b)

23 years agoreverted a some previous additions.
Gerald Carter [Sat, 15 Jul 2000 08:33:43 +0000 (08:33 +0000)]
reverted a some previous additions.
Removed msrpc_local struct

--jerry
(This used to be commit b2317babb557f5bce390c7162c9936f5d46f4da3)

23 years agoa few changes to Makefile.in to clean up dependencies for rpcclient
Gerald Carter [Fri, 14 Jul 2000 17:04:57 +0000 (17:04 +0000)]
a few changes to Makefile.in to clean up dependencies for rpcclient

--jerry
(This used to be commit 9206d593603af959700794d252da8d07082012ef)

23 years agoMore functions merged from TNG for rpcclient. They don't all work
Gerald Carter [Fri, 14 Jul 2000 17:04:04 +0000 (17:04 +0000)]
More functions merged from TNG for rpcclient.  They don't all work
currently as I have to do something about the policy handle caching
issues.

--jerry
(This used to be commit 233b074f490b3b01f3a462284aa8117536df0082)

23 years agocleaned up access to prs_struct variables. Replaced all calls
Gerald Carter [Fri, 14 Jul 2000 17:01:49 +0000 (17:01 +0000)]
cleaned up access to prs_struct variables.  Replaced all calls

prs_free_data() => prs_mem_free
prs_realloc_data => prs_grow

--jerry
(This used to be commit 3d00e969df1800dadbb91fd8c410e9ce87188551)

23 years agoremoved references to loopback RPC connections.
Gerald Carter [Fri, 14 Jul 2000 16:59:41 +0000 (16:59 +0000)]
removed references to loopback RPC connections.
added a few more kfunctions from TNG for rpcclient

--jerry
(This used to be commit 549d1d262115aeb2cd4d3f0122a5771be17752bb)

23 years agoremoved prs_data(), prs_free_data(), and prs_realloc_data()
Gerald Carter [Fri, 14 Jul 2000 16:58:03 +0000 (16:58 +0000)]
removed prs_data(), prs_free_data(), and prs_realloc_data()
as these were unneeded and replaced by the real functions
already in HEAD.

Added a few more functions to parse_spoolss.c to help with the
rpcclient merge from TNG.
(This used to be commit 3bc9af4c1dbdb664970541f6091982ffccc87b31)

23 years agoFixed a bug in cmd_interp.c where if user%pass was entered on
Gerald Carter [Fri, 14 Jul 2000 16:54:07 +0000 (16:54 +0000)]
Fixed a bug in cmd_interp.c where if user%pass was entered on
the command line, the password would still be cached in memory
in plain text for the lifetime of the rpcclient command line session.

removed loopback connection functions from msrpc-client.c since
we don't support that in the server code now anyways.  simplify,
simplify, ...

--jerry
(This used to be commit 8599e1bc394b1caee2483ec72d439a34d3f30629)

23 years agomake proto
Gerald Carter [Fri, 14 Jul 2000 16:31:06 +0000 (16:31 +0000)]
make proto
and a few changes to ntdomain for rpcclient printing functions

--jerry
(This used to be commit eb3f545f54eabb8b2b9a735808ebf49808ea85eb)

23 years agoadding more spoolss command into rpcclient. They don't all work
Gerald Carter [Fri, 14 Jul 2000 16:29:22 +0000 (16:29 +0000)]
adding more spoolss command into rpcclient.  They don't all work
currently.  More to come later.

--jerry
(This used to be commit 0faf21662db5b24b7fd57736ea53772e3baca5df)

23 years agoDon't return winbind groups or users when responding to samr_enum_dom_users
Tim Potter [Thu, 13 Jul 2000 04:33:25 +0000 (04:33 +0000)]
Don't return winbind groups or users when responding to samr_enum_dom_users
and samr_enum_dom_aliases commands.  Unfortunately the algorithm for
determining winbind groups from normal groups is simply to check for the
presence of the lp_winbind_separator() character.  )-:
(This used to be commit 363a9c45bf0a7d3266ccdf4eeb0b9f5e3d38389f)

23 years agoUninitialised variables.
Tim Potter [Thu, 13 Jul 2000 01:21:21 +0000 (01:21 +0000)]
Uninitialised variables.
(This used to be commit a895868912a24589de3a904ca537cf3367a645bf)

23 years agowe are now sure the printer_info_2 timestamp is updated everytime
Jean-François Micouleau [Wed, 12 Jul 2000 16:11:33 +0000 (16:11 +0000)]
we are now sure the printer_info_2 timestamp is updated everytime
required.

J.F.
(This used to be commit 08b41bab177affac088c981d7c620728e8e6e9b0)

23 years ago- The printers are indexed by the sharename in both get_a_printer() and
Jean-François Micouleau [Wed, 12 Jul 2000 14:10:40 +0000 (14:10 +0000)]
- The printers are indexed by the sharename in both get_a_printer() and
add_a_printer() now.

- correctly unpack the private part of a devmode and remove a memleak

- correctly retrieve the pair(value,data) for getprinterdata

- handle null devicemode in printer_info_2

I still have some bugs but I'm not crashing anymore NT4SP6 d/c build :-)

        J.F.
(This used to be commit 493f7d11acf753ba24c88e6cbb73d86a8595a66a)