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

849 Commits

Author SHA1 Message Date
Volker Lendecke
044c6f513d Implement NETLOGON GetDCName client side. You can ask a DC for the name of
a DC it trusts.

Volker
(This used to be commit ae6840320f)
2004-04-02 12:56:18 +00:00
Jim McDonough
1fa1e931a3 More sync between passdb on 3.0 and HEAD.
Replace unknown_3 with fields_present.  Also causes rpc_samr structure field changes.
(This used to be commit 1976843345)
2004-02-12 16:16:53 +00:00
Gerald Carter
0cf45c96b4 fix another bug caused by cli_lsa_query_info_policy() changes
(This used to be commit faec928564)
2004-01-16 22:15:35 +00:00
Andrew Bartlett
7d068355aa This merges in my 'always use ADS' patch. Tested on a mix of NT and ADS
domains, this patch ensures that we always use the ADS backend when
security=ADS, and the remote server is capable.

The routines used for this behaviour have been upgraded to modern Samba
codeing standards.

This is a change in behaviour for mixed mode domains, and if the trusted
domain cannot be reached with our current krb5.conf file, we will show
that domain as disconnected.

This is in line with existing behaviour for native mode domains, and for
our primary domain.

As a consequence of testing this patch, I found that our kerberos error
handling was well below par - we would often throw away useful error
values.  These changes move more routines to ADS_STATUS to return
kerberos errors.

Also found when valgrinding the setup, fix a few memory leaks.

While sniffing the resultant connections, I noticed we would query our
list of trusted domains twice - so I have reworked some of the code to
avoid that.

Andrew Bartlett
(This used to be commit 7c34de8096)
2004-01-08 08:19:18 +00:00
Andrew Bartlett
af8fb7e01e Change (unused) structure parameter for cli_ds_enum_domain_trusts() cleanup.
(This used to be commit 6e5b084c20)
2004-01-05 02:05:19 +00:00
Tim Potter
80bbfbaf44 Fix comment.
(This used to be commit a999f7f23f)
2003-12-07 10:48:31 +00:00
Tim Potter
36d534ef74 Patch from James Henstridge to allow rpcclient adddriver command to specify
printer driver version.  Closes bug #514.
(This used to be commit c5865e3dfe)
2003-11-05 16:40:13 +00:00
Tim Potter
4ebe9f9167 Remove trailing comma on typedef enum. albert chin (china@thewrittenword.com)
(This used to be commit 67dd1c4366)
2003-10-27 23:43:15 +00:00
Jim McDonough
3d8e3f314b Add initshutdown pipe commands to rpcclient. Second part of fix to bug
#534
(This used to be commit 4e86243ea1)
2003-10-24 13:49:29 +00:00
cvs2svn Import User
6440c4b34d This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to be commit e569418861) 2003-10-24 13:38:14 +00:00
Jim McDonough
6258550534 New files for support of initshutdown pipe. Win2k doesn't respond properly
to all requests on the winreg pipe, so we need to handle this new pipe.

First part of fix for bug #534
(This used to be commit 532fab74c1)
2003-10-24 13:38:13 +00:00
Jeremy Allison
cc88a03cd0 Fixed typo spotted by Daniel Jarboe <daniel.jarboe@custserv.com>.
Jeremy.
(This used to be commit 89d42685b7)
2003-10-20 21:02:08 +00:00
Jeremy Allison
5fad0208ad Fixed typo spotted by Daniel Jarboe <daniel.jarboe@custserv.com>.
Jeremy.
(This used to be commit c68b6f64d9)
2003-10-20 21:02:05 +00:00
Jim McDonough
2cfb3e9b70 Several updates:
- add support for named pipe and netbios queries in parse code
- fix map request structure...unknown byte was alignment
- add sample of named pipe over netbios query in rpcclient (comment only)
(This used to be commit 71dcdf54e6)
2003-10-20 18:35:12 +00:00
Jim McDonough
86102b0e15 Add epmapper commands to rpcclient
(This used to be commit 1d68e108a7)
2003-10-18 01:14:41 +00:00
Jim McDonough
2702510b46 Add client side code to do endpoint map queries. Currently does one
fixed query.  Updates to come soon.
(This used to be commit 3ca8240aff)
2003-10-18 01:13:01 +00:00
Gerald Carter
e9568f8df2 commit sign only patch from Andrew; bug 167; tested using 2k & XP clientspreviously joined to the Samba domain
(This used to be commit 9d2e585e5e)
2003-10-01 22:00:19 +00:00
Gerald Carter
cbe69f65f6 commit sign only patch from Andrew; bug 167; tested using 2k & XP clientspreviously joined to the Samba domain
(This used to be commit 3802f5895e)
2003-10-01 21:18:32 +00:00
Tim Potter
5400952f7f Merge from 3.0:
>Fix for #480. Change the interface for init_unistr2 to not take a length
>but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string.
>This is not the case. Count it after conversion.
>Jeremy.
(This used to be commit e2ab9e54cd)
2003-09-29 06:17:09 +00:00
Jeremy Allison
d3b9384308 Fix for #480. Change the interface for init_unistr2 to not take a length
but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string.
This is not the case. Count it after conversion.
Jeremy.
(This used to be commit f82c273a42)
2003-09-25 21:26:16 +00:00
Jeremy Allison
30fd359914 The "unknown_5" 32 bit field in the user structs is actually 2 16-bit
fields, bad_password_count and logon_count. Ensure this is stored/fetched
in the various SAMs. As it replaces the unknown_5 field this fits
exactly into the tdb SAM without any binary problems. It also is added
to the LDAP SAM as two extra attributes. It breaks compatibility with
the experimental SAMs xml and mysql. The maintainers of these SAMs must
fix them so upgrades like this can be done transparently. I will insist
on the "experimental" status until this is solved.
Jeremy.
(This used to be commit 71ecd10181)
2003-09-18 23:54:12 +00:00
Jeremy Allison
3a48e4b287 The "unknown_5" 32 bit field in the user structs is actually 2 16-bit
fields, bad_password_count and logon_count. Ensure this is stored/fetched
in the various SAMs. As it replaces the unknown_5 field this fits
exactly into the tdb SAM without any binary problems. It also is added
to the LDAP SAM as two extra attributes. It breaks compatibility with
the experimental SAMs xml and mysql. The maintainers of these SAMs must
fix them so upgrades like this can be done transparently. I will insist
on the "experimental" status until this is solved.
Jeremy.
(This used to be commit cd7bd8c2da)
2003-09-18 23:53:48 +00:00
Gerald Carter
4093bf7ff8 sync 3.0 into HEAD for the last time
(This used to be commit c17a7dc9a1)
2003-09-09 04:07:32 +00:00
Andrew Bartlett
f1be3a5c5d - Make 'net' use a single funciton for setting the 'use machine account' code.
- Make winbindd try to use kerberos for connections to DCs, so that it can
   access RA=2 servers, particularly for netlogon.
 - Make rpcclient follow the new flags for the NETLOGON pipe
 - Make all the code that uses schannel use the centralised functions for doing so.

Andrew Bartlett
(This used to be commit 96b4187963)
2003-08-19 22:47:10 +00:00
Andrew Bartlett
f0cd6b35e5 - Fix the kerberos downgrade problem:
- When connecting to the NETOGON pipe, we make a call to auth2, in order
   to verify our identity.  This call was being made with negotiation flags
   of 0x1ff.  This caused our account to be downgraded.  If we instead make
   the call with flags > 1ff (such as 0x701ff), then this does not occour.

 - This is *not* related to the use of kerberos for the CIFS-level connection

My theory is that Win2k has a test to see if we are sending *exactly* what
NT4 sent - setting any other flags seems to cause us to remain intact.

Also ensure that we only have 'setup schannel' code in a few places, not
scattered around cmd_netlogon too.

Andrew Bartlett
(This used to be commit e10f0529fe)
2003-08-19 20:39:32 +00:00
Gerald Carter
5ba60c5608 working on fix for BUG #294. Not done yet, but this at least clears
up some of the false positives in "rpcclient -c getdriver".
Also make sure that we ask for version2 and 3 drivers on x86.
(This used to be commit 5be5151568)
2003-08-19 16:56:53 +00:00
Herb Lewis
aa39cc37da get rid of more compiler warnings
(This used to be commit 398bd14fc6)
2003-08-15 04:42:05 +00:00
Andrew Bartlett
172766eea7 Change Samba to always use extended security for it's guest logins, (ie,
NTLMSSP with "" username, NULL password), and add --machine-pass (-P) to
all of Samba's clients.

When connecting to an Active Directory DC, you must initiate the CIFS level
session setup with Kerberos, not a guest login.  If you don't, your machine
account is demoted to NT4.

Andrew Bartlett
(This used to be commit 3547cb3def)
2003-08-14 01:08:00 +00:00
Jeremy Allison
8d94de787e Patch from waider@waider.ie to print out Port Type.
Jeremy.
(This used to be commit 8516baf58d)
2003-08-07 00:55:35 +00:00
Simo Sorce
04bf12b176 port latest changes from SAMBA_3_0 tree
(This used to be commit 3101c236b8)
2003-08-02 20:06:57 +00:00
Jeremy Allison
29ca70cd34 Add a command line option (-S on|off|required) to enable signing on client
connections. Overrides smb.conf parameter if set.
Jeremy.
(This used to be commit 879309671d)
2003-07-30 23:49:29 +00:00
Gerald Carter
c856d9274b add a few more tidy ups. Now onto winbindd
(This used to be commit f8abdd23e1)
2003-07-30 17:37:46 +00:00
Gerald Carter
de1a998622 add support for DsEnumerateDomainTrusted for enumerating all the
trusted domains in a forest.
(This used to be commit c691c7f7d9)
2003-07-30 17:29:00 +00:00
Andrew Bartlett
c9305f1c64 Schannel, once setup, may be used on *ANY* TCP/IP connection until the
connection that set it up has been shut down.

(Also, pipes still connected, and reconnections to the same pipe (eg SAMR)
may continue to use that session key until their TCP/IP connection is shut
down)

Allow further testing by printing out the session key, and allowing it's input
into rpcclient.

Next step is automatic storage in a TDB.

Andrew Bartlett
(This used to be commit fa4d7be161)
2003-07-25 01:26:19 +00:00
Gerald Carter
3a5dc7c2ec convert snprintf() calls using pstrings & fstrings
to pstr_sprintf() and fstr_sprintf() to try to standardize.
lots of snprintf() calls were using len-1; some were using
len.  At least this helps to be consistent.
(This used to be commit 9f835b85dd)
2003-07-23 12:33:59 +00:00
Tim Potter
274f1f8806 Replace the eight (!) copies of dummy become/unbecome root with a single one.
(This used to be commit 8b818ce381)
2003-07-22 00:20:53 +00:00
Gerald Carter
4a090ba06a trying to get HEAD building again. If you want the code
prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE
(This used to be commit adb98e7b7c)
2003-07-16 05:34:56 +00:00
Andrew Bartlett
456f51bcbe Jeremy requested that I get my NTLMSSP patch into CVS. He didn't request
the schannel code, but I've included that anyway. :-)

This patch revives the client-side NTLMSSP support for RPC named pipes
in Samba, and cleans up the client and server schannel code.  The use of the
new code is enabled by the 'sign', 'seal' and 'schannel' commands in
rpcclient.

The aim was to prove that our separate NTLMSSP client library actually
implements NTLMSSP signing and sealing as per Microsoft's NTLMv1 implementation,
in the hope that knowing this will assist us in correctly implementing
NTLMSSP signing for SMB packets.  (Still not yet functional)

This patch replaces the NTLMSSP implementation in rpc_client/cli_pipe.c with
calls to libsmb/ntlmssp.c.  In the process, we have gained the ability to
use the more secure NT password, and the ability to sign-only, instead of
having to seal the pipe connection.  (Previously we were limited to sealing,
and could only use the LM-password derived key).

Our new client-side NTLMSSP code also needed alteration to cope with our
comparatively simple server-side implementation.  A future step is to replace
it with calls to the same NTLMSSP library.

Also included in this patch is the schannel 'sign only' patch I submitted to
the team earlier.  While not enabled (and not functional, at this stage) the
work in this patch makes the code paths *much* easier to follow.  I have also
included similar hooks in rpccleint to allow the use of schannel on *any* pipe.

rpcclient now defaults to not using schannel (or any other extra per-pipe
authenticiation) for any connection.  The 'schannel' command enables schannel
for all pipes until disabled.

This code is also much more secure than the previous code, as changes to our
cli_pipe routines ensure that the authentication footer cannot be removed
by an attacker, and more error states are correctly handled.

(The same needs to be done to our server)

Andrew Bartlett
(This used to be commit 5472ddc9ea)
2003-07-14 08:46:32 +00:00
Gerald Carter
816724fb39 more compile fixes for become/unbecome_root()
(This used to be commit f005f1cf12)
2003-07-09 03:32:07 +00:00
Jeremy Allison
ce0709666c More conversions I missed. Thanks metze.
Jeremy.
(This used to be commit 4f78d747e6)
2003-07-04 18:52:31 +00:00
Jeremy Allison
ce72beb2b5 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
(This used to be commit ff222716a0)
2003-07-03 19:11:31 +00:00
Gerald Carter
f36c96d59c * s/get_dc_name/rpc_dc_name/g (revert a previous change)
* move back to qsort() for sorting IP address in get_dc_list()

* remove dc_name_cache in cm_get_dc_name() since it slowed
  things down more than it helped.  I've made a note of where
  to add in the negative connection cache in the ads code.
  Will come back to that.

* fix rpcclient to use PRINTER_ALL_ACCESS for set printer (instead
  of MAX_ALLOWED)

* only enumerate domain local groups in our domain

* simplify ldap search for seqnum in winbindd's rpc backend
(This used to be commit f8cab8635b)
2003-06-23 19:05:23 +00:00
Jelmer Vernooij
0914e541f5 Reverse previous patch from Stefan and me after comments by Andrew Bartlett
(This used to be commit d817eaf0ec)
2003-05-10 11:49:51 +00:00
Jelmer Vernooij
7ed8b615b9 Reverse previous patch from Stefan and me after comments by Andrew Bartlett.
(This used to be commit d31509fe88)
2003-05-10 11:47:29 +00:00
Jelmer Vernooij
ec40d70b3b Patch from metze and me that adds dummy smb_register_*() functions
(This used to be commit 367a5cad1e)
2003-05-10 10:56:20 +00:00
Jelmer Vernooij
c507ebe567 Patch from metze and me that adds dummy smb_register_*() functions so
that is now possible to, for example, load a module which contains
an auth method into a binary without the auth/ subsystem built in.
(This used to be commit 74d9ecfe2d)
2003-05-10 10:53:48 +00:00
Volker Lendecke
d1da999e0a This puts real netlogon connection caching to winbind. This becomes
important once we start doing schannel, as there would be a lot more
roundtrips for the second PIPE open and bind. With this patch logging
in to a member server is a matter of two (three if you count the
ack...) packets between us and the DC.

Volker
(This used to be commit 5b3cb7725a)
2003-05-08 08:02:52 +00:00
Tim Potter
9784320676 Merge:
> Perform lp_load() before popt to fix -W option.
(This used to be commit f8db590b07)
2003-04-28 07:05:50 +00:00
Tim Potter
d31cb1b468 Perform lp_load() before popt to fix -W option.
(This used to be commit d20f4bf5d8)
2003-04-28 07:03:08 +00:00
Tim Potter
507cdd1996 Merge:
>Patch from waider to set exit code of last executed command specified
>as an argument to -c.
(This used to be commit b1ad692688)
2003-04-28 05:54:37 +00:00
Tim Potter
ee007fc7b8 Merge from HEAD:
>Return NT_STATUS_UNSUCCESSFUL if the sourcedata and echodata rpcs
>return unexpected data.
>
>Closes bug #2.
(This used to be commit 2e5f75beaf)
2003-04-28 03:36:01 +00:00
Tim Potter
39fbda7f03 Return NT_STATUS_UNSUCCESSFUL if the sourcedata and echodata rpcs
return unexpected data.

Closes bug #2.
(This used to be commit 0c3314ab97)
2003-04-28 03:33:56 +00:00
Andrew Bartlett
2a3a9f0bf4 Merge the 'safe' parts of my StrnCpy patch - many of the users really wanted
a pstrcpy/fstrcpy or at most a safe_strcpy().

These have the advantage of being compiler-verifiable.

Get these out of the way, along with a rewrite of 'get_short_archi' in the
spoolss client and server.  (This pushes around const string pointers, rather
than copied strings).

Andrew Bartlett
(This used to be commit 32fb801ddc)
2003-04-23 13:27:35 +00:00
Tim Potter
1fe7ec8b4b Patch from waider to set exit code of last executed command specified
as an argument to -c.
(This used to be commit 048aeefcdc)
2003-04-23 07:10:28 +00:00
Andrew Bartlett
f071020f5e Merge from HEAD - save the type of channel used to contact the DC.
This allows us to join as a BDC, without appearing on the network as one
until we have the database replicated, and the admin changes the configuration.

This also change the SID retreval order from secrets.tdb, so we no longer
require a 'net rpc getsid' - the sid fetch during the domain join is sufficient.
Also minor fixes to 'net'.

Andrew Bartlett
(This used to be commit 876e00fd11)
2003-04-21 14:09:03 +00:00
Andrew Bartlett
2cb0b91ed1 Store the type of 'sec channel' that we establish to the DC. If we are a
workstation, we have to use the workstation type, if we have a BDC account,
we must use the BDC type - even if we are pretending to be a workstation
at the moment.

Also actually store and retreive the last change time, so we can do
periodic password changes again (for RPC at least).

And finally, a couple of minor fixes to 'net'.

Andrew Bartlett
(This used to be commit 6e6b7b79ed)
2003-04-16 10:20:14 +00:00
Tim Potter
c182b78639 Merge: remove unused variable.
(This used to be commit 6a1d99d318)
2003-04-14 05:26:30 +00:00
Tim Potter
69605f6fa9 Removed unused variable.
(This used to be commit 117cc35dd0)
2003-04-14 05:22:17 +00:00
Tim Potter
c967d21ca7 Merge Jelmer's popt updates from HEAD.
Also merged a bunch of other random changes as this file has
been drifting off due to lack of janitors.
(This used to be commit 38337ec5ef)
2003-04-14 03:31:19 +00:00
Tim Potter
3b865c7398 Merge of rpcecho pipe for testing large dcerpc requests and responses.
Only compiled in when --enable-developer argument passed to configure.
(This used to be commit 017da9393b)
2003-04-14 02:08:03 +00:00
Tim Potter
cb621ec3a6 Merge of samr lookup domain rpc client call from HEAD.
(This used to be commit 5b1807dddf)
2003-04-14 01:17:05 +00:00
cvs2svn Import User
a47d06a2c2 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to be commit 381649916e) 2003-04-13 13:50:46 +00:00
Tim Potter
065561932c A new RPC pipe! The \pipe\echo named pipe is for testing large RPC
requests and responses and is only compiled in when --enable-developer
is passed to configure.  It includes server and client side code for
generating and responding to functions on this pipe.  The functions are:

 - AddOne: add one to the uint32 argument and return ig
 - EchoData: echo back a variable sized char array to the caller
 - SourceData: request a variable sized char array
 - SinkData: send a variable sized char array and throw it away

There's a win32 implementation of the client and server in the
junkcode CVS repository in the rpcecho-win32 subdirectory.
(This used to be commit 4ccd34ef83)
2003-04-11 04:09:14 +00:00
Volker Lendecke
7238bf5f40 This is the netlogon schannel client code. Try a
rpcclient -S pdc -U% -c "samlogon user password"

and it should work with the schannel. Needs testing against platforms
different from NT4SP6.

Volker
(This used to be commit eaef0d8aef)
2003-04-09 15:54:17 +00:00
Volker Lendecke
803e23f403 This is the netlogon schannel client code. Try a
rpcclient -S pdc -U% -c "samlogon user password"

and it should work with the schannel. Needs testing platforms
different from NT4SP6.

Volker
(This used to be commit ecd0ee4d24)
2003-04-09 15:47:06 +00:00
Tim Potter
0bcc0c343f SAMR lookupdomain rpc client patches from amber palekar <amber@nu3.net>
(This used to be commit 67bc6bccc2)
2003-04-04 00:52:42 +00:00
Tim Potter
676e2707e8 This file deleted in HEAD.
(This used to be commit 6174560e50)
2003-04-02 06:00:41 +00:00
Jelmer Vernooij
41a09c3c53 Revoke some of the popt patch from metze I applied earlier today. It added
some double options and broke some parameters.
(This used to be commit d5f9b0275c)
2003-03-24 14:15:14 +00:00
Jelmer Vernooij
11e9de855c Patch from metze to generalise POPT_COMMON_SAMBA, with some minor changes
(This used to be commit 2ddfed298d)
2003-03-24 11:25:34 +00:00
Tim Potter
417bf608f4 Merge of waider's rpcclient return type patch.
(This used to be commit fb91bfa7a2)
2003-03-18 06:30:30 +00:00
Tim Potter
e6d438c2db Merge of enumdomusers rpcclient command.
(This used to be commit 8cabdd635d)
2003-03-18 06:11:17 +00:00
Tim Potter
1eae003fef Applied waider's patch to return DOS error codes for pipes that
support it.
(This used to be commit ac3df9a805)
2003-03-17 05:55:41 +00:00
Martin Pool
4724780212 Patch from Ronan Waide:
> when doing "enumdomusers", rpcclient prints each one preceded by the
> word "group" instead of "user"
(This used to be commit 0e9a2f41df)
2003-03-11 03:41:21 +00:00
Martin Pool
2e3f9c35d5 Patch from Ronan Waide:
> when doing "enumdomusers", rpcclient prints each one preceded by the
> word "group" instead of "user"
(This used to be commit 17567dd1d5)
2003-03-11 00:14:55 +00:00
Andrew Bartlett
80087e6cfe safe_strcpy() -> fstrcpy() fix, and a cleanup to how rpcclient calls the
IP address resolving code.
(This used to be commit 1f605fe77c)
2003-03-07 09:25:48 +00:00
Tim Potter
4c8091ef9c Use PRINTER_ALL_ACCESS instead of MAXIMUM_ALLOWED_ACCESS in setprinter
command.  From Ronan Waide <waider@waider.ie>.
(This used to be commit 992b5eb4e0)
2003-03-05 05:14:19 +00:00
Tim Potter
130d49aa6b Merge: const fixes.
Merge: add popt_common_version to command line options table.

Merge: mbp's rewrite of do_cmd()
(This used to be commit 20f153cee3)
2003-02-25 23:53:38 +00:00
Tim Potter
1788f806e7 Merge: const fixes.
(This used to be commit a20aba0999)
2003-02-25 23:51:56 +00:00
Tim Potter
991f6cc3c1 More const fixes and flow on fixes from yesterday's const-fest.
(This used to be commit 018733eedd)
2003-02-25 23:34:57 +00:00
Tim Potter
3a2f56cb63 Fixed up some const related compiler warnings.
(This used to be commit 923425e497)
2003-02-25 06:24:13 +00:00
Tim Potter
696895d5b1 Added enumdomusers command.
(This used to be commit 30353da3e9)
2003-02-21 04:28:32 +00:00
Tim Potter
4834c61ebc Fix for only specifying one command with -c
(This used to be commit 7418351427)
2003-02-21 04:25:04 +00:00
Jelmer Vernooij
896e133c3c Remove obsolete files
(This used to be commit 1a68ead433)
2003-02-20 19:13:37 +00:00
Jelmer Vernooij
9d913a62ad Remove obsolete files
(This used to be commit f035cba2cf)
2003-02-20 19:10:19 +00:00
Tim Potter
39cf300869 Merge typo fix.
(This used to be commit 7406fabe7c)
2003-02-19 22:54:21 +00:00
Tim Potter
7024ab8dca Merge NTSTATUS vs WERROR return for cli_srvsvc_net_srv_get_info()
(This used to be commit 7edaf93796)
2003-02-19 22:52:50 +00:00
Jelmer Vernooij
5eb7b6113b Add -V option (to print out version) to utilities where possible
(pdbedit already has a -V option..)
(This used to be commit 5de622968d)
2003-02-18 18:43:59 +00:00
Martin Pool
188c5195ed Check return code of string_to_sid. (Merge from HEAD)
(This used to be commit 5d09aea6f7)
2003-02-18 07:05:02 +00:00
Martin Pool
7741d66b18 Doxygen janitor. No other changes.
(This used to be commit 735c99dadb)
2003-02-18 01:55:50 +00:00
Martin Pool
05e3070b23 cmd_lsa_lookup_sids: Check return code from string_to_sid; skip SIDs
which are not valid.
(This used to be commit bfb6104521)
2003-02-18 01:35:19 +00:00
Volker Lendecke
0cf080f719 Dummy commit, I can't get through to samba-cvs@samba.org. It can't really
remember under what mail address I have to post.

My last commit to this file made it compile again, my fingers were a bit
too fast to really type this message.

Sorry for this confusion,

Volker
(This used to be commit 3b905f5a16)
2003-02-17 21:12:21 +00:00
Volker Lendecke
bf89801bd2 cmd_srvsvc.c
(This used to be commit fcfbb3c430)
2003-02-17 21:04:09 +00:00
Martin Pool
f203f1643c Typo: /mized/mixed/
(This used to be commit ada36d2fe3)
2003-02-17 06:54:43 +00:00
Martin Pool
645d68a45a Don't pstrcpy into an fstring. (Harmless in this case since it comes
from an environment variable.)
(This used to be commit 9f9077346b)
2003-02-17 06:28:58 +00:00
Martin Pool
541ed81a63 Start reworking rpcclient to use popt rather than next_token to parse
command lines.  This makes the code much simpler and also stops
trivial syntax errors from causing a crash.

Also fix support for semicolon-separated commands in -c, which is
promised by the manual but apparently never working due to an
off-by-one error.
(This used to be commit d85a25e733)
2003-02-17 05:42:36 +00:00
Andrew Bartlett
497470214d merge desired_access for open_printer_ex from HEAD, allowing cupsaddsmb to
work again!

Andrew Bartlett
(This used to be commit 94976a4128)
2003-02-12 11:23:24 +00:00
Andrew Bartlett
749d90dfc7 Match Samba 2.2 by chosing the correct desired access, and getting cupsaddsmb
back working again.

Andrew Bartlett
(This used to be commit 512e65a6a6)
2003-02-12 11:17:35 +00:00
Andrew Tridgell
6c66e42d2c added the 'lsaenumacctwithright' command to rpcclient. This allows you
to lookup what SIDs have a particular privilege (that is how
privileges are stored).
(This used to be commit 3ddb5fb0dd)
2003-02-10 11:31:23 +00:00
Jeremy Allison
f8601187ca Merge tpot's changes to request the correct sizes for user dispinfo
from HEAD. I had to do this for him as he was *so* tired, the poor
chap, plus he has this bad leg, plus the dog ate his homework etc. etc.
Jeremy.
(This used to be commit 1e752b48a1)
2003-01-29 20:15:35 +00:00
Jeremy Allison
ef49ed3e06 Remove NULL buffer checks before rpcstr_pull() as they're now done
inside this function. Merge from HEAD (tpot).
Jeremy.
(This used to be commit e20cb9ca55)
2003-01-29 06:53:07 +00:00
Tim Potter
7634efbfec Use new interface for cli_samr_query_dispinfo().
(This used to be commit d3962da61a)
2003-01-29 06:24:13 +00:00
Tim Potter
e536c2e9d3 Remove NULL buffer checks before rpcstr_pull() as they're now done
inside this function.
(This used to be commit cdc7c599c7)
2003-01-29 02:57:03 +00:00
Jeremy Allison
438b5c92d4 Merge tridge's client priv code from HEAD.
Jeremy
(This used to be commit 49739be1e2)
2003-01-29 02:24:12 +00:00
Andrew Tridgell
79b26867c0 added LsaRemoveAccountRights
this now gives us complete remove privileges control in the client
libs, so we are in good shape for starting on the server side.
(This used to be commit bf99440398)
2003-01-28 21:31:45 +00:00
Jeremy Allison
734c6d8a51 Merging tridge's privillage client changes from HEAD.
Jeremy.
(This used to be commit 30a33920b4)
2003-01-28 21:09:56 +00:00
Andrew Tridgell
5f9112ac1b cleaned up the lsa_enum_acct_rights function and added a
lsa_add_acct_rights function.

This allows us to add privileges remotely to accounts using rpcclient.
(This used to be commit 2e5e659e09)
2003-01-28 12:52:51 +00:00
Jim McDonough
e47fbbd37f revert accidentally committed changes
(This used to be commit 5d43346761)
2003-01-21 14:05:37 +00:00
Jim McDonough
19938c0d2c Properly display popt errors. Also fix debug to be -d for consistency with other progs.
(This used to be commit 97133f7168)
2003-01-21 13:58:16 +00:00
Andrew Tridgell
96c795cea7 reverted this patch till I sort out the craziness with UNIHDR
(This used to be commit e3d00fa47d)
2003-01-17 06:15:18 +00:00
Andrew Tridgell
ec879eacc2 This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd
argument incorrect, so I thought it best just to remove the argument.

The incorrect usage was caused by callers using strlen() to determine
the length of the string. The 3rd argument to init_unistr2() was
supposed to be the character length, not the byte length of the
string, so for non-english this could come out wrong.

I also removed the bogus 'always allocate at least 256 bytes'
hack. There may be some code that relies on this, but if there is then
the code is broken and needs fixing.
(This used to be commit b9eff31b14)
2003-01-17 04:58:45 +00:00
Andrew Tridgell
70bf249cfb allow a couple of LSA functions to take a username instead of a SID,
They still accept a SID, it just can be tedious to have to type SIDs
instead of names all the time.
(This used to be commit 665cc9b1ac)
2003-01-16 04:14:59 +00:00
Gerald Carter
99cdb46208 *lots of small merges form HEAD
*sync up configure.in
*don't build torture tools in make all
*make sure to remove torture tools as part of make clean
(This used to be commit 0fb724b321)
2003-01-15 18:57:41 +00:00
Gerald Carter
4242eda183 merging some rpcclient and net functionality from HEAD
(This used to be commit 7a4c874842)
2003-01-15 17:22:48 +00:00
Gerald Carter
9eeab10e54 [merge]
* removed unused variable from rpcclient code
* added container option to net command (patch from SuSE)
* Makefile patch for examples/VFS from SuSE
(This used to be commit 25a9681ddd)
2003-01-15 16:10:57 +00:00
Gerald Carter
43e4cae106 * removed unused variable from rpcclient code
* added container option to net command (patch from SuSE)
* Makefile patch for examples/VFS from SuSE
(This used to be commit 4a6d8280ea)
2003-01-15 16:07:14 +00:00
Andrew Tridgell
eb6312af9f added cli_lsa_enum_account_rights() call. Note that this is in
principal similar to the existing cli_lsa_enum_privsaccount() call,
except that cli_lsa_enum_account_rights() doesn't require a call to
open_account first. There is also the minor matter that
cli_lsa_enum_account_rights() works whereas
cli_lsa_enum_privsaccount() doesn't!

this call can be used to find what privileges an account or group
has. This is a first step towards proper privileges support in Samba.
(This used to be commit 65bac11d71)
2003-01-15 07:40:40 +00:00
Andrew Bartlett
27b7e51a3c Merge from HEAD:
- fstring/pstring mixups
 - the detection code that found them (disabled)
 - a bit of whitespace
 - a static

Andrew Bartlett
(This used to be commit 9b70fa868e)
2003-01-14 08:53:59 +00:00
Andrew Bartlett
ad20186707 A couple more fstring/pstring issues - and move from sizeof(fstring) to
sizeof(var) in slprintf statements, so as to ensure we don't get mixups there.

Also remove fstrcpy() into a variable that is about to be printed into anyway.

Andrew Bartlett
(This used to be commit 9b76123732)
2003-01-11 12:18:57 +00:00
Tim Potter
4315edcdca Display an error message when the server cannot be resolved when running at
debug level 0.
(This used to be commit 451286febd)
2003-01-08 02:54:42 +00:00
Andrew Bartlett
b327f5ba53 Merge from HEAD - idra's fix for the fact that the shutdown command takes two 1
byte boolean flags, not a 16 bit bitmask.

Andrew Bartlett
(This used to be commit a4f7777ca0)
2003-01-04 07:50:04 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Andrew Bartlett
6d66fb308a BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings.
 - That is, all string literals are marked as 'const'.  These strings are
always read only, this just marks them as such for passing to other functions.

What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables).  The rest
is just adding a lot of 'const'.

As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).

Andrew Bartlett
(This used to be commit 92a777d0ea)
2003-01-02 09:07:17 +00:00
Simo Sorce
60667264b7 the shutdown call does not have a 16 bit flags, but 2 byte representing booleans
this commit change the structure and code to reflect this

some test revelead I'm right.

some other revelead currently the abort shutdown does not work against my test machine even if it returns successfully ... need investigation
(This used to be commit c5892b656d)
2002-12-30 04:41:27 +00:00
Jeremy Allison
98ac4503ac Finish adding strings to all talloc_init() calls.
Jeremy.
(This used to be commit aa8439a49e)
2002-12-23 23:54:10 +00:00
Jeremy Allison
0fdf60f051 Finish adding strings to all talloc_init() calls.
Jeremy.
(This used to be commit 784d15761c)
2002-12-23 23:53:56 +00:00
Jeremy Allison
7f23546730 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
(This used to be commit 842e08e52a)
2002-12-20 20:23:06 +00:00
Jeremy Allison
ef8bd7c4f7 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
(This used to be commit 09a218a9f6)
2002-12-20 20:21:31 +00:00
Tim Potter
53a87ee8eb Merge from HEAD:
>fix rpcclient querygroup command (from 2.2 and head)
(This used to be commit 77b403434f)
2002-12-20 01:31:13 +00:00
Simo Sorce
e8c80081b5 fix rpcclient querygroup command (from 2.2 and head)
(This used to be commit ea2154b269)
2002-12-08 12:03:42 +00:00
Simo Sorce
a543e6ea62 make querygroup in rpcclient working, same fix as per 2.2 tree
(This used to be commit 8877ff2482)
2002-12-08 11:56:45 +00:00
Jeremy Allison
2f194322d4 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit f755711df8)
2002-11-12 23:20:50 +00:00
Jeremy Allison
250c980119 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit 82b8f749a3)
2002-11-12 23:15:52 +00:00
Jim McDonough
18cb3695df Add getdata and getdataex commands
(This used to be commit 1bdd639751)
2002-11-11 15:43:09 +00:00
Jim McDonough
3eb60559d8 Add getdata and getdataex commands
(This used to be commit 101727335f)
2002-11-11 15:41:04 +00:00
Gerald Carter
cda79e5d36 deldriver fix
(This used to be commit 78ff2cc34a)
2002-11-09 14:49:26 +00:00
Gerald Carter
4be3750d8e deldriver fix
(This used to be commit f20de1f9b0)
2002-11-09 14:48:27 +00:00
Jim McDonough
3b90ef84a5 Add enumdataex command
(This used to be commit 932a501273)
2002-11-08 21:40:31 +00:00
Jim McDonough
66a1f9b1fe Add enumdataex command
(This used to be commit 6d1d2849a7)
2002-11-08 21:39:53 +00:00
Jim McDonough
9429b7d8ab Implement enumdata command
(This used to be commit a22fdf26fe)
2002-11-08 20:51:04 +00:00
Jim McDonough
a363c52885 Implement enumdata command
(This used to be commit 33ffe07e05)
2002-11-08 20:50:06 +00:00
Jim McDonough
28258023b4 Add enumkey command (EnumPrinterKey api)
(This used to be commit 5bccbbeb59)
2002-11-08 19:07:36 +00:00
Jim McDonough
eedcd7239b Add enumkey command (EnumPrinterKey api)
(This used to be commit a2e17d4344)
2002-11-08 19:06:34 +00:00
Jeremy Allison
47955b2f6c Merge of scalable printing code fix... Needs testing.
Also tidied up some of Richard's code (I don't think he uses the compiler
flags -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual like
I do :-) :-).
Jeremy.
(This used to be commit 10024ed06e)
2002-11-07 02:38:42 +00:00
Jeremy Allison
9304248788 Merge of scalable printing code fix... Needs testing.
Jeremy.
(This used to be commit d030df7643)
2002-11-07 02:15:35 +00:00
Tim Potter
ab1cf8d1cf Merge of get_dc_list() api change from HEAD.
(This used to be commit 6ba7847ce2)
2002-11-06 05:14:15 +00:00
Tim Potter
ea24bb2da8 Merge of get_dc_list() api change. This was slightly more intrusive
than the version in APPLIANCE so watch out for boogs.
(This used to be commit 1e054e3db6)
2002-11-06 01:29:07 +00:00
Jelmer Vernooij
a0f1bbdcb3 Sync with head...
(This used to be commit 60c83a6007)
2002-10-28 19:45:47 +00:00
Jeremy Allison
389a16d9d5 Added new error codes. Fix up connection code to retry in the same way
that app-head does.
Jeremy.
(This used to be commit b521abd86b)
2002-10-17 17:10:29 +00:00
Jeremy Allison
c53eb2ed54 Added new error codes. Fix up connection code to retry in the same way
that app-head does.
Jeremy.
(This used to be commit ec7953f201)
2002-10-17 17:10:24 +00:00
Jelmer Vernooij
272fee5809 Update popt help message and use popt-common
(This used to be commit 821b27037b)
2002-10-05 16:45:54 +00:00
Gerald Carter
9c1b62c0fd merge of working dsrolegetprimdominfo() client code from APP_HEAD
(This used to be commit 028477e352)
2002-10-04 19:33:41 +00:00
cvs2svn Import User
326a429d46 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to be commit 7950dfc795) 2002-10-04 19:11:37 +00:00
Gerald Carter
d2ea6d5ae7 merge of working dsrolegetprimdominfo() client code from APP_HEAD
(This used to be commit f70caa25e4)
2002-10-04 19:11:36 +00:00
Gerald Carter
36ef82a529 merge of new client side support the Win2k LSARPC UUID in rpcbind
from APP_HEAD
(This used to be commit 1cfd2ee433)
2002-10-04 04:10:23 +00:00
Gerald Carter
83e58265b5 merge of new client side support the Win2k LSARPC UUID in rpcbind
from APP_HEAD
(This used to be commit 38c9e42998)
2002-10-04 03:51:43 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Tim Potter
1974c5d92e The new popt_common_debug code obviates the need to muck around with
AllowDebugChange, saving the debuglevel across lp_load() calls etc.
(This used to be commit 561204905b)
2002-09-05 02:00:14 +00:00
Gerald Carter
2d8e2cfc79 remove inet_aton()
(This used to be commit a7616b2b94)
2002-09-04 01:15:01 +00:00
Tim Potter
9a4110d3d1 Fix setprinterdata rpcclient command to use new cli_spoolss_setprinterdata
function.  Also fixed crash bug - I don't think anyone uses this
command anymore...
(This used to be commit 82c9bf2a6f)
2002-09-03 04:56:39 +00:00
Tim Potter
f02b14f7c6 Change JOB_INFO_CTR to return a pointer to an array rather than array of pointers.
(This used to be commit e9b71b354d)
2002-09-03 03:20:21 +00:00
Jean-François Micouleau
bba043c9e4 allow rpcclient's samlogon command to use cli_net_3().
J.F.
(This used to be commit 3cf419bdfb)
2002-08-30 11:57:06 +00:00
Jean-François Micouleau
cfb5e91178 added cli_net_auth_3 client code.
changed cli_nt_setup_creds() to call cli_net_auth_2 or cli_net_auth_3 based on a switch.
pass also the negociation flags all the way.
all the places calling cli_nt_setup_creds() are still using cli_net_aut2(), it's just for future use and for rpcclient.

in the future we will be able to call auth_2 or auth_3 as we want.

	J.F.
(This used to be commit 4d38caca40)
2002-08-30 10:46:59 +00:00
Jelmer Vernooij
e095e77a5c Forgot to remove old usage() function
(This used to be commit 4631e1fd10)
2002-08-29 12:44:37 +00:00
Jelmer Vernooij
4d64593834 Use popt for printing --help message
(This used to be commit 355d28d9ea)
2002-08-29 12:05:30 +00:00
Andrew Tridgell
901ffd7ca8 slprintf() takes a size argument
(This used to be commit 4e142ba374)
2002-08-27 05:04:16 +00:00
Tim Potter
dbbb157b2e Don't try to convert enumprinters name to a unc name.
(This used to be commit e09007dd5d)
2002-08-27 01:48:00 +00:00
Tim Potter
83c5985880 Pass the object name down to the enum_printers rpc. By default this is the
server name and everything works as advertised.  See the MSDN doco for details.
(This used to be commit d6b10fe969)
2002-08-27 00:38:55 +00:00
Tim Potter
55315b4b4e Moved calculation of secure channel type into a new function.
(This used to be commit b8dba26978)
2002-08-23 13:38:00 +00:00
Tim Potter
6232468dca Fix for change in cli_netlogon_sam_sync()
(This used to be commit 6ec267618a)
2002-08-22 23:44:36 +00:00
Tim Potter
266fd83651 Added some new delta types discovered by Ronnie from ethereal"
- SAM_DELTA_RENAME{USER,GROUP,ALIAS}
 - SAM_DELTA_DELETE{USER,GROUP}

Renamed some of the unknown delta types and their unmarshalling functions:

 - SAM_DELTA_TRUST_DOMS
 - SAM_DELTA_SECRET_INFO
(This used to be commit 1f29276c2f)
2002-08-22 23:39:26 +00:00
Andrew Tridgell
2a505d023f added a 'net rpc samdump' command for dumping the whole sam via
samsync operations (as a BDC)
(This used to be commit e4cb106d2e)
2002-08-22 22:48:54 +00:00
Andrew Bartlett
2749f5e998 A few fixes towards libsmbclient and rpcclient - get pointer types right and
try to keep to functions inside libsmbclient.

Andrew Bartlett
(This used to be commit 340bc31fdb)
2002-08-22 00:51:00 +00:00
Andrew Bartlett
bad6e2dbe2 Move comment
(This used to be commit 009b331182)
2002-08-22 00:16:21 +00:00
Andrew Tridgell
42364e1b24 make rpcclient use print_guid()
(This used to be commit f2c48cadb2)
2002-08-19 16:55:47 +00:00
Jelmer Vernooij
64c53e819b sync 3.0 branch with HEAD
(This used to be commit 6497eb78e8)
2002-08-17 15:33:49 +00:00
Jim McDonough
28bf5e5f2d Add lsaqueryinfo2, but keep under "lsaquery" command. It will autoselect
which lsaqueryinfo to do based in infoclass.  Currently 12 is the only one
that causes a queryinfo2.
(This used to be commit f4ec2d52a7)
2002-08-12 13:41:52 +00:00
Jim McDonough
b3d49538fd Use samr connect4, then fall back to samr connect if it fails. This is
what 2k does.
(This used to be commit 99437db17a)
2002-08-12 08:26:28 +00:00
Tim Potter
335aa54b46 Merge of incomplete rffpcnex testing code from APPLIANCE_HEAD.
(This used to be commit fe43c2ac2d)
2002-08-08 04:58:19 +00:00
Andrew Tridgell
ab9ff0fa73 This fixes a number of ADS problems, particularly with netbiosless
setups.

- split up the ads structure into logical pieces. This makes it much
  easier to keep things like the authentication realm and the server
  realm separate (they can be different).

- allow ads callers to specify that no sasl bind should be performed
(used by "net ads info" for example)

- fix an error with handing ADS_ERROR_SYSTEM() when errno is 0

- completely rewrote the code for finding the LDAP server. Now try DNS
  methods first, and try all DNS servers returned from the SRV DNS
  query, sorted by closeness to our interfaces (using the same sort code
  as we use in replies from WINS servers). This allows us to cope with
  ADS DCs that are down, and ensures we don't pick one that is on the
  other side of the country unless absolutely necessary.

- recognise dnsRecords as binary when displaying them

- cope with the realm not being configured in smb.conf (work it out
  from the LDAP server)

- look at the trustDirection when looking up trusted domains and don't
  include trusts that trust our domains but we don't trust
  theirs.

- use LDAP to query the alternate (netbios) name for a realm, and make
  sure that both and long and short forms of the name are accepted by
  winbindd. Use the short form by default for listing users/groups.

- rescan the list of trusted domains every 5 minutes in case new trust
  relationships are added while winbindd is running

- include transient trust relationships (ie. C trusts B, B trusts A,
  so C trusts A) in winbindd.

- don't do a gratuituous node status lookup when finding an ADS DC (we
  don't need it and it could fail)

- remove unused sid_to_distinguished_name function

- make sure we find the allternate name of our primary domain when
  operating with a netbiosless ADS DC (using LDAP to do the lookup)

- fixed the rpc trusted domain enumeration to support up to approx
  2000 trusted domains (the old limit was 3)

- use the IP for the remote_machine (%m) macro when the client doesn't
  supply us with a name via a netbios session request (eg. port 445)

- if the client uses SPNEGO then use the machine name from the SPNEGO
  auth packet for remote_machine (%m) macro

- add new 'net ads workgroup' command to find the netbios workgroup
  name for a realm
(This used to be commit e358d7b24c)
2002-08-05 02:47:46 +00:00
Tim Potter
3130577acb Some crash fixes for netshareenum returning zero shares.
(This used to be commit a5a0ff8bd7)
2002-07-30 04:32:29 +00:00
Tim Potter
362f534fa1 Our include popt is starting to get a bit old - fixed some compile
problems here.

Also fixed some non-constant initialisers in samsync.
(This used to be commit 33bd721473)
2002-07-29 23:50:54 +00:00
Andrew Bartlett
0ddfa38e8d We don't need this silly unix username stuff. NT username is basicly unused,
and must == unix username for sane implementation in passdb.

Andrew Bartlett
(This used to be commit 412c791980)
2002-07-29 12:52:27 +00:00
Tim Potter
3a99ab6aa5 Started to get samsync to insert account information in the passdb. It's
pretty half-arsed at the moment and doesn't work very well but Mr Bartlett
was interested in it.

Also started playing around with the more interesting bits of popt.  The
auto-generated usage information is pretty neat.
(This used to be commit b3e51bfe6c)
2002-07-29 09:32:25 +00:00
Tim Potter
11785c7bc8 Use common popt definition for -d option.
(This used to be commit 8c17904848)
2002-07-29 09:25:23 +00:00
Andrew Bartlett
0cdc28ab40 Tpot missed one...
(This used to be commit 28373e5bc2)
2002-07-21 02:36:33 +00:00
Tim Potter
0357388636 Renamed all the new_cli_netlogon_* functions to cli_netlogon_*
as they're no longer new!
(This used to be commit 277f6bbb9a)
2002-07-21 00:49:16 +00:00
Andrew Bartlett
27ca538a3c If we can't connect, make sure its a level 0 so we see it, and the reason.
(This used to be commit 6129718bea)
2002-07-20 08:59:58 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Andrew Bartlett
e7c9c29904 Apply patch from "Kai Krueger" <kai@kruegernetz.de> to make it easier to
determine what access masks should be applied to various SAMR calls.

Andrew Bartlett
(This used to be commit dbf28f992b)
2002-07-14 08:37:31 +00:00
Tim Potter
d2707f1059 Added -I option to rpcclient.
(This used to be commit 2674adf1b5)
2002-07-09 19:11:26 +00:00
Andrew Bartlett
d29d29e4a2 Updates to the 'name -> sid' code:
Correct the 'none mapped' behaviour, (so that it matches Win2k) and  add a
function to make the SID types appear as text strings in logs/rpcclient.

Also, remove a silly case that would cause 'failure' to be 'success'.  (Might
look at this a bit more in future).

Andrew Bartlett
(This used to be commit c20d057f88)
2002-07-07 03:34:24 +00:00
Andrew Tridgell
9930b0b065 used findstatic.pl to make some variables static and remove some dead
code
(This used to be commit 91ad9041e9)
2002-07-01 09:12:41 +00:00
Jeremy Allison
452eb38df0 Proper merge of all the working printing stuff from APPLIANCE_HEAD.
Now let's keep this in sync !
Jeremy.
(This used to be commit 3603cd4947)
2002-06-28 00:17:15 +00:00
Andrew Bartlett
77011e353c Qualify some of the hexidecimal responses with 0x
(This used to be commit e77e21cdbe)
2002-06-26 02:52:51 +00:00
Andrew Bartlett
6fc42047ec Try to avoid infinite loops when reteriving users - even from broken servers.
Andrew Bartlett
(This used to be commit ebc8452a30)
2002-06-25 11:20:14 +00:00
Andrew Bartlett
0746576113 Update cli_full_connection() to take a 'flags' paramater, and try to get a
few more places to use it.

Andrew Bartlett
(This used to be commit 23689b0746)
2002-06-25 08:57:24 +00:00
Tim Potter
8e9a8b29f2 Fixed compiler warning.
(This used to be commit 361afd241b)
2002-06-04 03:19:20 +00:00
Tim Potter
15e5ef6ce8 Added getdompwinfo function.
(This used to be commit b3b3e45583)
2002-06-03 02:24:22 +00:00
Jim McDonough
f2d37f907c Update for new interface to netfileenum
(This used to be commit c3921e3607)
2002-06-01 01:02:23 +00:00
Jim McDonough
e011750206 Update netfileenum to new api.
(This used to be commit 70f8adf297)
2002-05-31 17:02:44 +00:00
Tim Potter
8787088f2e Fixed crash bug in querydispinfo.
Some reformatting.
(This used to be commit 612eae45ef)
2002-05-31 04:25:00 +00:00
Tim Potter
0e3260de6f Added netfileenum (sorry - no output though (-:) command.
(This used to be commit 099b750b4e)
2002-05-30 07:12:32 +00:00
Tim Potter
568deecbf0 Added netremotetod to try and figure out which srvsvc commands are denied
when using restrictanonymous.
(This used to be commit 0c65978ed0)
2002-05-29 01:43:44 +00:00
Tim Potter
65a31d8dd8 Added netshareenum command at level 1 and 2.
(This used to be commit 99ac1b339c)
2002-05-28 08:40:29 +00:00
Tim Potter
3b464a1f8f Some fixes for enumerating domain groups and aliases:
- close down connect and domain policy handles when exiting
 - allow enumeration of > 65535 groups or aliases
 - error handling for non-zero return value from enumeration functions
(This used to be commit a48f362ca7)
2002-05-28 04:10:04 +00:00
Andrew Bartlett
9c3d5d6fd0 Remove the password length paramater from cli_full_connection - it really
didn't make any sense, and its was always just strlen(password) anyway.

This fixes it to be strlen(password)+1

Andrew Bartlett
(This used to be commit c205b18bd6)
2002-05-24 05:14:16 +00:00
Andrew Bartlett
e46a6ecc69 Given Jeremy's positive response, and a lack of one from tpot, I'll commit
this:

More code cleanup - this lot a bit more dodgy than the last:

The aim is to trim pwd_cache down to size.  Its overly complex, and a
pain to deal with.  With a header comment like this:

'obfusticaion is planned'

I think it deserved to die (at least partly).

This was being done to allow 'cli_establish_connection' to die - its
functionality has been replaced by cli_full_connection(), which does
not duplicate code everywhere for creating names etc.

This also removes the little 'init' fucntions for the various pipes,
becouse they were only used in one place, and even then it was dodgy.

(I've reworked smbcacls not to use anonymous connections any more, as
this will (should) fail with a 'restrict anonymous' PDC).

This allowed me to remove cli_pipe_util.c, which was calling
cli_establish_connection.

tpot:  I'm not sure what direction you were going with the client stuff,
and you may well have been wanting the init functions.  If thats the case,
give me a yell and I'll reimplement them against cli_full_connection.

Andrew Bartlett
(This used to be commit fa67e4626b)
2002-05-23 14:02:17 +00:00
Andrew Bartlett
f9d2db36f3 Remove unused files.
The size of samba going down for once :-)

Andrew Bartlett
(This used to be commit 00ef4aad88)
2002-05-18 13:50:59 +00:00
Andrew Bartlett
3fe27b7f9d A few more trusted domains updates from mimir.
I think we may still need to look at our server enumeration code, but
other than that, its much better in the tree than out.

Andrew Bartlett
(This used to be commit d57a1b4629)
2002-05-17 13:49:01 +00:00
Tim Potter
1df5f81247 The cli_spoolss_setprinterdata() function interface changed slightly.
(This used to be commit 79d7bcf42e)
2002-05-14 05:27:58 +00:00
Tim Potter
ee2306d881 Merge from HEAD:
>Added cli_spoolss_enumjobs() function.

>Added cmd_spoolss_enumjobs() function to rpcclient.
>
>The semantics of the src_len argument to rpcstr_pull() seem to have changed
>breaking most of the spoolss commands in rpcclient.  Changed a bunch of
>0's to -1's to fix it.
(This used to be commit dce534d437)
2002-05-07 06:36:22 +00:00
Tim Potter
5f0a3bf295 Added cmd_spoolss_enumjobs() function to rpcclient.
The semantics of the src_len argument to rpcstr_pull() seem to have changed
breaking most of the spoolss commands in rpcclient.  Changed a bunch of
0's to -1's to fix it.
(This used to be commit f32e3f2087)
2002-05-07 06:30:10 +00:00
Tim Potter
a04166f35e Fixed more compiler warnings.
(This used to be commit fa5c1ba12b)
2002-05-07 04:38:33 +00:00
Tim Potter
535779e9fc Fixed compile warning.
(This used to be commit 671607a3ee)
2002-05-07 04:31:56 +00:00
Tim Potter
67d99a88c4 Fixed command line argument parsing.
(This used to be commit 28c1fae4d8)
2002-04-17 06:43:47 +00:00
Gerald Carter
1d49e9bc71 merges from SAMBA_2_2
(This used to be commit 91929afbb0)
2002-04-16 16:49:08 +00:00
Tim Potter
d9cfe0f3eb Merge of lsa lookup names/sids patch from HEAD.
(This used to be commit e57c162897)
2002-04-15 05:02:22 +00:00
Tim Potter
d0386372b2 The cli_lsa_lookup_{names,sids} functions were returning useless
information when one or more of the names/sids being queried were not
resolvable.  We now return a list the same length as the parameters passed
instead of an array of just the resolvable names/sids.
(This used to be commit 245468dbab)
2002-04-14 11:21:25 +00:00
Tim Potter
f8b1f9608f Fixed comment.
(This used to be commit 06df6c79ae)
2002-04-14 04:57:02 +00:00
Tim Potter
29e67cad05 Free popt context after argument parsing.
(This used to be commit f287f62962)
2002-04-04 04:29:09 +00:00
Gerald Carter
d843380398 removing unused files....
(This used to be commit 3d542abdb1)
2002-04-03 03:06:22 +00:00
Gerald Carter
f624d6f3ae added "list <pipe>" command to display the available commands
one a single pipe
(This used to be commit b73a8416d3)
2002-04-02 23:28:40 +00:00
Gerald Carter
9cb6a94406 some mergee from SAMBA_2_2. Does compile, but needs some more testing.
This is an intermediate check-in.  More to come....
(This used to be commit 5b9b152971)
2002-04-02 01:10:41 +00:00
Tim Potter
ab13654dc9 Renamed get_nt_error_msg() to nt_errstr().
(This used to be commit 1f007d3ed4)
2002-03-17 04:36:35 +00:00
Jim McDonough
bc6959c6f6 Swap order of close brace and done: tag to appease AIX compiler. Order shouldn't matter for logic...if anyone disagrees whack me over the head and explain why...
(This used to be commit 4081ce40dd)
2002-03-08 03:36:03 +00:00
Jim McDonough
f3df73c0cf One more fix to get popt to work for some compilers...this is the downside to popt. Every option has to be in fixed storage.
(This used to be commit e5e7132e80)
2002-03-08 03:31:01 +00:00
Jim McDonough
6e6318525a Convert rpcclient to use popt instead of getopt. Includes changing of got_pass from BOOL to int. Also includes long option names...anyone want those different before I update the doc? Please try this out. I've tried to test all the flags, but the more times we kick the tires...
(This used to be commit cd34897749)
2002-03-07 18:56:51 +00:00
Tim Potter
fd7cdf6da4 Cosmetic fixup for enum_printers
(This used to be commit bb0ef8bc30)
2002-03-07 04:29:13 +00:00
Tim Potter
6fbd44c77a Fixed a bunch of crash bugs for enumprinters at various info levels.
(This used to be commit d9df00e2b1)
2002-03-07 04:22:16 +00:00
Tim Potter
b89b7d4d12 argc == 0 is an impossible condition.
(This used to be commit 5b195f8bf1)
2002-03-07 04:03:21 +00:00
Andrew Bartlett
81b2d66c97 Allow Samba to trust NT4 Domains.
This commit builds on the auth subsystem to give Samba support for trusting NT4
domains.  It is off by default, but is enabled by adding 'trustdomain' to the
'auth methods' smb.conf paramater.

Tested against NT4 only - there are still some issues with the join code for
Win2k servers (spnego stuff).

The main work TODO involves enumerating the trusted domains (including the RPC
calls to match), and getting winbind to run on the PDC correctly.

Similarly, work remains on getting NT4 to trust Samba domains.

Andrew Bartlett
(This used to be commit ac8c24a9a8)
2002-03-02 08:25:44 +00:00
Herb Lewis
361d0f9f7b merge from 2.2 - fix parsing of options
(This used to be commit c849e93392)
2002-02-26 20:04:54 +00:00
Tim Potter
bb117fdca7 Implemented client side functions for SPOOLSS addform, getform, setform and
enumforms.
(This used to be commit e69222f081)
2002-02-25 06:43:31 +00:00
Tim Potter
e026103a97 Converted remaining spoolss rpcclient functions to werror/needed/offered.
I couldn't test some of these because I didn't know the right magic
arguments to pass to rpcclient (familiar anyone? (-:) so there may be some
bugs lurking.
(This used to be commit 029e2b307d)
2002-02-20 18:41:07 +00:00
Tim Potter
902cc03807 Converted {cmd,cli}_spoolss_getprinter() to WERROR and offered/neede.
(This used to be commit fccfa034e9)
2002-02-19 02:12:01 +00:00
Tim Potter
9a0a35d09a Converted cmd_spoolss_enumprinterdrivers() to use new
cli_spoolss_enumprinterdrivers() function.
(This used to be commit ae38fcf62c)
2002-02-19 01:06:55 +00:00
Tim Potter
1b70d2769a Added addform, setform and deleteform commands. The only one I could get
to actually work was addform.  )-:

Removed a whole bunch of calls to werror_to_ntstatus() because there isn't
a one-to-one mapping of NTSTATUS values to WERROR values.  This function
maps WERR_ACCESS_DENIED to NTSTATUS_INVALID_LOCK_SEQUENCE or something
silly like that.
(This used to be commit 825b5c8bd6)
2002-01-31 11:36:30 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Andrew Bartlett
ba8c1c6e45 Back out some of the less well thought out ideas from last weeks work on
winbind default domains, particulary now I understand whats going on a lot
better.  This ensures that the RPC client code does as little 'magic' as
possible - this is up to the application/user.  (Where - for to name->sid code
- it was all along).  This leaves the change that allows the sid->name code to
return domains and usernames in seperate paramaters.

Andrew Bartlett
(This used to be commit 5dfba2cf53)
2002-01-26 11:48:42 +00:00
Andrew Bartlett
84ce7ec0a4 Make a talloc'ed copy of this strings so we can pass the right kind of pointer
to the function.  This fixes a nice little segfault the brute-force-casting
created. :-)

Andrew Bartlett
(This used to be commit c84fa7f5fd)
2002-01-26 10:06:23 +00:00
Andrew Bartlett
93a8358910 This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd.

It is mostly my code, with a few changes and testing performed by Alexander
Bokovoy <a.bokovoy@sam-solutions.net>.  ab has tested it in security=domain and
security=ads, but more testing is always appricatiated.

The idea is that we no longer cart around a 'domain\user' string, we keep them
seperate until the last moment - when we push that string into a pwent on onto
the socket.

This removes the need to be constantly parsing that string - the domain prefix
is almost always already provided, (only a couple of functions actually changed
arguments in all this).

Some consequential changes to the RPC client code, to stop it concatonating the
two strings (it now passes them both back as params).

I havn't changed the cache code, however the usernames will no longer have a
double domain prefix in the key string.  The actual structures are unchanged
 - but the meaning of 'username' in the 'rid' will have changed.  (The cache is
invalidated at startup, so on-disk formats are not an issue here).

Andrew Bartlett
(This used to be commit e870f0e727)
2002-01-20 01:24:59 +00:00
Simo Sorce
7019bfe546 fixes (asprintf) from 2.2
(This used to be commit 6b123adda9)
2002-01-19 17:29:32 +00:00
Tim Potter
9a02c6b4e8 Converted getprinterdriver to WERROR - it always returns dos error 6
(invalid handle) though.  )-:
(This used to be commit 7bfd1f35e4)
2002-01-07 03:33:46 +00:00
Tim Potter
2f25e5118f Converted enumprinters and enumports cmd functions to use WERROR
values returned from cli functions.  They are converted to NTSTATUS codes
using the error map functions.

Do buffer size loop checks by setting offered = 0 and using the return
value of needed in the next call.
(This used to be commit 4efbdda3fc)
2002-01-06 09:03:48 +00:00
Tim Potter
cd0772e51e spoolss rpc client cleanup:
- converted OpenPrinterEx and ClosePrinter to WERROR instead of NT_STATUS
 - doc
(This used to be commit 248d114f85)
2002-01-06 03:54:40 +00:00
Tim Potter
84dbcd6147 Display nicer message when server name could not be resolved.
(This used to be commit 950d8e3656)
2002-01-06 03:24:51 +00:00
Tim Potter
9c1ddeca6f Fixed crash bug in display_print_info_2()
(This used to be commit b70f870cd9)
2002-01-03 03:51:13 +00:00
Tim Potter
af8ed15401 Fixed crash bug in display_print_info_1()
(This used to be commit d1564fbf1f)
2002-01-03 02:48:23 +00:00
Tim Potter
a4c612078f Unicode byte ording fix from Benjamin Kuit <bj@it.uts.edu.au>
(This used to be commit 6b7e9d03cf)
2001-12-30 21:25:46 +00:00
Andrew Bartlett
72898d4821 Finish idra's cleanup of the RPC remote shutdown code.
(This used to be commit 79031b68ce)
2001-12-30 10:19:56 +00:00