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

276 Commits

Author SHA1 Message Date
Volker Lendecke
161ebbc17a r23757: Fix Coverity id 386
(This used to be commit 91be38f7ab)
2007-10-10 12:23:53 -05:00
Günther Deschner
7eb828135b r23627: Allow to pass down the lookup-level to rpccli_lsa_lookup_names().
Guenther
(This used to be commit e9a7512a9f)
2007-10-10 12:23:38 -05:00
Jeremy Allison
ce02d0dfcb r23554: Fix bug #4711 by makeing cli_connect return an NTSTATUS.
Long overdue fix....
Jeremy.
(This used to be commit 073fdc5a58)
2007-10-10 12:23:28 -05:00
Alexander Bokovoy
1f073a0319 r22867: With Samba4's IDL, we now have two new flags for share types: STYPE_TEMPORARY and STYPE_HIDDEN
Strip them out when referencing share_type[] entries.

Apparently, some Windows XP installs create shares set to STYPE_HIDDEN by default, found by
Damir Shayhutdinov <damir@altlinux.org>. This also fixes smb4k crashes as it does call 'net share -l'.
(This used to be commit c3f4fdd37e)
2007-10-10 12:22:04 -05:00
Jeremy Allison
540911001d r21768: Fix the client dfs code such that smbclient can
process deep dfs links (ie. links that go to non root
parts of a share). Make the directory handling conanonical
in POSIX and Windows pathname processing.
dfs should not be fully working in client tools. Please
bug me if not.
Jeremy.
(This used to be commit 1c9e10569c)
2007-10-10 12:18:30 -05:00
Jeremy Allison
aab1dd4ddb r21755: Memory leak fixes from Zack Kirsch <zack.kirsch@isilon.com>.
Jeremy.
(This used to be commit 02d08ca0be)
2007-10-10 12:18:28 -05:00
Jeremy Allison
8e00e9d7a6 r21609: Fix memory leaks in error code paths (and one in winbindd_group.c).
Patch from Zack Kirsch <zack.kirsch@isilon.com>.
Jeremy.
(This used to be commit df07a662e3)
2007-10-10 12:18:16 -05:00
Jeremy Allison
57881f7494 r20917: Fix missing error returns pointed out by "Li, Ying (ESG)" <ying.li2@hp.com>
Jeremy.
(This used to be commit 78387b3cd2)
2007-10-10 12:17:20 -05:00
Jelmer Vernooij
62e11c4f17 r20832: Remove extra pointers previously added to unique [out] pointers. Instead,
add [ref] pointers where necessary (top-level [ref] pointers,
by spec, don't appear on the wire).

This brings us closer to the DCE/RPC standard again.
(This used to be commit 580f2a7197)
2007-10-10 12:17:11 -05:00
Volker Lendecke
b906886e9e r20824: Send access to the trusted domain passwords through the pdb backend, so that
in the next step we can store them in LDAP to be replicated across DCs.

Thanks to Michael Adam <ma@sernet.de>

Volker
(This used to be commit 3c879745cf)
2007-10-10 12:17:10 -05:00
Volker Lendecke
01367cdfd0 r19797: Convert the remaining pipes to the "new" unique out ptr handling
(This used to be commit bc4e0a388a)
2007-10-10 12:15:56 -05:00
Volker Lendecke
f916352de9 r19447: Do not throw away information
(This used to be commit 141e0dd717)
2007-10-10 12:15:36 -05:00
Volker Lendecke
f29a0d90a3 r19446: Comment can be NULL now
(This used to be commit f4dcb9bd56)
2007-10-10 12:15:36 -05:00
Volker Lendecke
0dab687fce r19445: Attempt to fix net rpc share
(This used to be commit 769988f83a)
2007-10-10 12:15:36 -05:00
Gerald Carter
bbaa0b178d r18919: * Get the new rpccli_winreg_XXXX() functions into the tree
There some broken functionality here that I'm still working on.
* remove unneeded parsing routines
(This used to be commit cbfe1a4b49)
2007-10-10 12:14:46 -05:00
Andrew Tridgell
0c3194816b r18865: fixed some of the most obvious NTSTATUS/WERROR mixups in Samba3. It
still doesn't compile with immediate structures and the
NTSTATUS/WERROR separation, as there are still several places where
the two error types are mixed up. I haven't fixed those as they
require decisions about the rpcclient code that I really don't want to
get into (the error handling there is a mess)

So samba3 compiles now, but only becaise HAVE_IMMEDIATE_STRUCTURES is
not used (look for HAVE_IMMEDIATE_STRUCTURES_XX_DISABLED)
(This used to be commit 8438a6a7d4)
2007-10-10 12:01:06 -05:00
Jelmer Vernooij
7ba2554d88 r18802: Use the pidl-generated code for the srvsvc interface, both client and server code.
This has had some basic testing. I'll do more during the next couple of days and hopefully also
make RPC-SRVSVC from Samba4 pass against it.
(This used to be commit ef10672399)
2007-10-10 12:00:59 -05:00
Gerald Carter
05ba38f754 r18747: replace rpccli_lsa_close() with rpccli_lsa_Close()
(This used to be commit 50d74ce048)
2007-10-10 12:00:54 -05:00
Gerald Carter
8a1439b10d r18727: set the winreg_AbortSystemShutdown() server * to NULL rather than a dummy placeholder
(This used to be commit 92903ab926)
2007-10-10 12:00:52 -05:00
Gerald Carter
970d33c65a r18714: fix the build after replaceing rpccli_reg_abort_shutdown()
(This used to be commit 403b0cf1ec)
2007-10-10 12:00:51 -05:00
Volker Lendecke
f2e7b8d144 r18643: Fix a 64-bit warning
(This used to be commit bd17517796)
2007-10-10 11:52:03 -05:00
Gerald Carter
c4013df0c1 r18560: * Add in the winreg and initshutdown IDL files
* rename PI_SHUTDOWN from include/smb.h to PI_INITSHUTDOWN
  for compatibility with pidl libndr output
(This used to be commit 23a8828613)
2007-10-10 11:51:50 -05:00
Gerald Carter
2b27c93a9a r18271: Big change:
* autogenerate lsa ndr code
* rename 'enum SID_NAME_USE' to 'enum lsa_SidType'
* merge a log more security descriptor functions from
  gen_ndr/ndr_security.c in SAMBA_4_0

The most embarassing thing is the "#define strlen_m strlen"
We need a real implementation in SAMBA_3_0 which I'll work on
after this code is in.
(This used to be commit 3da9f80c28)
2007-10-10 11:51:18 -05:00
Jelmer Vernooij
995205fc60 r18188: merge 3.0-libndr branch
(This used to be commit 1115745cae)
2007-10-10 11:43:56 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
2b8abc030b r16644: Fix bug #3887 reported by jason@ncac.gwu.edu
by converting the lookup_XX functions to correctly
return SID_NAME_TYPE enums.
Jeremy.
(This used to be commit ee2b2d96b6)
2007-10-10 11:19:05 -05:00
Jeremy Allison
4471ce9a68 r16638: Fix bug #3885, reported by jason@ncac.gwu.edu. Use
the correct enumerated type in the macro.
Jeremy.
(This used to be commit 63ad19f71c)
2007-10-10 11:19:05 -05:00
Volker Lendecke
e7fc37cf0f r16360: Fix Klocwork ID 136 520 521 522 523 542 574 575 576 607
in net_rpc.c: 715 716 732 734 735 736 737 738 739 749

in net_rpc_audit.c: 754 755 756

in net_rpc_join.c: 757

in net_rpc_registry: 766 767

in net_rpc_samsync.c: 771 773

in net_sam.c: 797 798

Volker
(This used to be commit 3df0bf7d60)
2007-10-10 11:18:48 -05:00
Günther Deschner
bf9b5b9baf r16345: Improve the chance that our users can discover one of the coolest 'net'
features.

Guenther
(This used to be commit 446d79a000)
2007-10-10 11:17:37 -05:00
Günther Deschner
c893dfa500 r16344: Allow to set passwords directly when creating users via "net rpc user
add" (as the documentation says, and currently onle "net ads user add"
did). Fixes #3843.

Guenther
(This used to be commit 5d776d5fab)
2007-10-10 11:17:36 -05:00
Jeremy Allison
300acb99ad r16284: Start fixing up gcc4 -O6 warnings on an x86_64 box. size_t != unsigned
int
in a format string.
Jeremy.
(This used to be commit face01ef01)
2007-10-10 11:17:31 -05:00
Volker Lendecke
a835209278 r15657: Fix some Tru64 warnings
(This used to be commit a85dfb9eff)
2007-10-10 11:17:05 -05:00
Gerald Carter
2c029a8b96 r15543: New implementation of 'net ads join' to be more like Windows XP.
The motivating factor is to not require more privileges for
the user account than Windows does when joining a domain.

The points of interest are

* net_ads_join() uses same rpc mechanisms as net_rpc_join()
* Enable CLDAP queries for filling in the majority of the
  ADS_STRUCT->config information
* Remove ldap_initialized() from sam/idmap_ad.c and
  libads/ldap.c
* Remove some unnecessary fields from ADS_STRUCT
* Manually set the dNSHostName and servicePrincipalName attribute
  using the machine account after the join

Thanks to Guenther and Simo for the review.

Still to do:

* Fix the userAccountControl for DES only systems
* Set the userPrincipalName in order to support things like
  'kinit -k' (although we might be able to just use the sAMAccountName
  instead)
* Re-add support for pre-creating the machine account in
  a specific OU
(This used to be commit 4c4ea7b20f)
2007-10-10 11:16:57 -05:00
Volker Lendecke
18250bc299 r15471: Clarify error message
(This used to be commit f21adc04f7)
2007-10-10 11:16:51 -05:00
Günther Deschner
ad8493d90c r15198: Mention the auditing tool in "net rpc help".
Guenther
(This used to be commit e55e1e1e96)
2007-10-10 11:16:28 -05:00
Günther Deschner
8fca274e47 r15194: We need to be able to join as PDC as well. Thanks to Andrew Bartlett.
Guenther
(This used to be commit ba81b508ca)
2007-10-10 11:16:28 -05:00
Volker Lendecke
fb1f83b05d r15137: Refuse to join if our netbios name is longer than 15 chars. I think this is
sufficient to fix bug #3659.

Volker
(This used to be commit 0ef5e4372c)
2007-10-10 11:16:26 -05:00
Volker Lendecke
d4d04313ea r15136: Fix join consistency check
(This used to be commit a6e88785e7)
2007-10-10 11:16:25 -05:00
Günther Deschner
4549efe696 r15123: Don't even try to join with an inproper configuration.
Guenther
(This used to be commit 22b6875897)
2007-10-10 11:16:25 -05:00
Gerald Carter
8c9eb7631e r15053: fix portabilities issues between 32-bit winbind clients and a 64-bit winbindd server
(This used to be commit a95d11345e)
2007-10-10 11:16:00 -05:00
Günther Deschner
655b04e4f8 r15041: Adding rpc client calls to manipulate auditing policies on remote CIFS
servers. Also add a new "net rpc audit" tool. The lsa query infolevels
were taken from samb4 IDL, the lsa policy flags and categories are
partly documented on msdn. I need to cleanup the double
lsa_query_info_policy{2}{_new} calls next.

Guenther
(This used to be commit 0fed66926f)
2007-10-10 11:15:59 -05:00
Volker Lendecke
42131b759d r15011: Fix bug # 2413. net rpc info can't reliably work anonymously anymore.
Volker
(This used to be commit ba41c62b8b)
2007-10-10 11:15:56 -05:00
Volker Lendecke
35d2856ae3 r14101: Fix a segfault in trustdom establish, cli is NULL here.
(This used to be commit 1df58c7a00)
2007-10-10 11:11:12 -05:00
Jeremy Allison
894358a8f3 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
(This used to be commit 1d710d06a2)
2007-10-10 11:10:59 -05:00
Günther Deschner
e54786b535 r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16.
* Fix a couple of related parsing issues.
* in the info3 reply in a samlogon, return the ACB-flags (instead of
  returning zero)

Guenther
(This used to be commit 5b89e8bc24)
2007-10-10 11:10:25 -05:00
Gerald Carter
f351b9c6eb r13382: added server affinity cache stores for 'net rpc join' and trusted domain code
(This used to be commit 9eb743584d)
2007-10-10 11:09:57 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Lars Müller
c42be9fd38 r12986: Use d_fprintf(stderr, ...) for any error message in net.
All 'usage' messages are still printed to stdout.

Fix some compiler warnings for system() calls where we didn't used the
return code.  Add appropriate error messages and return with the error
code we got from system() or NT_STATUS_UNSUCCESSFUL.
(This used to be commit f650e3bdaf)
2007-10-10 11:06:09 -05:00
Günther Deschner
ce5bde1e84 r12338: add ifdef DEBUG_PASSWORD before printing clear text password.
Guenther
(This used to be commit e0be0e0523)
2007-10-10 11:05:54 -05:00
Jeremy Allison
8d7c886671 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
(This used to be commit d720867a78)
2007-10-10 11:05:02 -05:00
Jim McDonough
a5b2ec0ba0 r10909: Give better shutdown messages
(This used to be commit 8075b99b44)
2007-10-10 11:04:56 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Gerald Carter
9a82b0da7c r10431: fix segfault when the pip open fails in 'net rpc' commands
(This used to be commit ffe4188847)
2007-10-10 11:03:41 -05:00
Jim McDonough
3c3fd2fab3 r10247: Fix help text for net rpc shutdown.
(This used to be commit 7af7343d9c)
2007-10-10 11:03:39 -05:00
Gerald Carter
063078d927 r9787: BUG 2998: patch from Humberto Diogenes <virtual.spirit@digizap.com.br> to include 'net rpc service' help in net rpc usage output
(This used to be commit ace8556b65)
2007-10-10 11:03:26 -05:00
Tim Potter
850a6f3a8d r8935: Fix signed/unsigned comparison warning. Bugzilla #2943.
(This used to be commit e928a20c2b)
2007-10-10 11:00:21 -05:00
Günther Deschner
fefbaf2bca r8911: cosmetic fixes.
Guenther
(This used to be commit bf67a86114)
2007-10-10 11:00:19 -05:00
Volker Lendecke
6ccc69c532 r8833: Fix some uninitialized variables.
Volker
(This used to be commit 503a58b6be)
2007-10-10 11:00:18 -05:00
Jim McDonough
e0ffbfc558 r8189: commit vampire ldif patch, mostly from Don Watson (dwatson@us.ibm.com). Yes,
that's my copyright...that's just how we have to do things at big blue.

Adds subcommand to vampire to allow data to be put into an ldif file instead
of actually writing to the passdb.  See "net rpc help vampire" for usage
info.  This should be added to docs as well.
(This used to be commit cb5634a305)
2007-10-10 10:58:18 -05:00
Jeremy Allison
19ca97a70f r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Günther Deschner
57fa9dbfe7 r7876: Now that we have "net rpc share migrate security" completly remove the
share-acl from "net rpc share migrate shares".

God, how ugly does this syntax get.

Guenther
(This used to be commit 6f4d4acc86)
2007-10-10 10:57:59 -05:00
Jeremy Allison
63c78a5e70 r7852: Correct fix from Lars for the argv issue.
Jeremy.
(This used to be commit a667d9e474)
2007-10-10 10:57:59 -05:00
Jeremy Allison
98d1f6ceff r7849: Dodgy fix - we shouldn't be assuming argc++ points to a valid argv.
Jeremy.
(This used to be commit 5fbabaef8c)
2007-10-10 10:57:59 -05:00
Günther Deschner
75545d578e r7632: Cleanup "net share migrate"-code.
* Allow to copy share security descriptors to already existing shares
  separatly.

* Added abstraction function to enum all or a single share info

Guenther
(This used to be commit 97097497ae)
2007-10-10 10:57:17 -05:00
Lars Müller
7cbd740c62 r7609: Move top level dir handling in from of the loop. This makes the code
much straither.

copy_top_level_perms() is jra's work.

I modified the copy_top_level_perms() function to use the copy_clistate.

And I don't forget trunk.

Lars
(This used to be commit 2c68568e52)
2007-10-10 10:57:16 -05:00
Günther Deschner
075649d3c2 r7532: compile fix.
Guenther
(This used to be commit 1815e0745e)
2007-10-10 10:57:11 -05:00
Lars Müller
ebb42167c9 r7512: Fix net share migrate files to also migrate the ACLs of the top level
dir of a share.  Till now we excluded '.' and '..' in general.  For the
fix the information about top or lower level dir is stored in the
copy_clistate.  src and dst share are now also part of this struct and
we only pass a pointer to the struct to the functions.

This bug was found by Bill Calero of Novell.  Thanks Bill!

With this checkin no new functionality was added.  But the copy_clistate
already knows about a mode. Later beside the migrate an additional
report mode will be added.

This changes are coordinated with Günther <gd>.

Lars
(This used to be commit 506aaefa37)
2007-10-10 10:57:10 -05:00
Gerald Carter
fed660877c r7415: * big change -- volker's new async winbindd from trunk
(This used to be commit a0ac9a8ffd)
2007-10-10 10:57:08 -05:00
Günther Deschner
4bc39f05b7 r7391: - Added client-support for various lsa_query_trust_dom_info-calls and a
rpcclient-tester for some info-levels.

  Jerry, I tried to adopt to prs_pointer() where possible and to not
  interfere with your work for usrmgr.

- Add "net rpc trustdom vampire"-tool.

  This allows to retrieve Interdomain Trust(ed)-Relationships from
  NT4-Servers including cleartext-passwords (still stored in the local
  secrets.tdb).

  The net-hook was done in cooperation with Lars Mueller
  <lmuelle@suse.de>.

  To vampire trusted domains simply call:

        net rpc trustdom vampire -S nt4dc -Uadmin%pass

Guenther
(This used to be commit 5125852939)
2007-10-10 10:57:07 -05:00
Gerald Carter
dc993c13a8 r6943: missed in last sync
(This used to be commit 3002aa2250)
2007-10-10 10:56:58 -05:00
Volker Lendecke
3b0df6770d r6880: Fix bug 2070 after positive feedback from Leon Vernikov. Thanks!
Volker
(This used to be commit f25da82ffd)
2007-10-10 10:56:56 -05:00
John Terpstra
b5c736d0f0 r6823: Add deletion confirmation / error message.
(This used to be commit 11804521f9)
2007-10-10 10:56:55 -05:00
Gerald Carter
28824fb197 r6601: fixing query and set alias info calls (level 1 from the
MMC manage computer plugin.
(This used to be commit c43c1ec80c)
2007-10-10 10:56:46 -05:00
Volker Lendecke
83e11ba86c r6263: Get rid of generate_wellknown_sids, they are const static and initializable
statically.

Volker
(This used to be commit 3493d9f383)
2007-10-10 10:56:33 -05:00
Gerald Carter
2e3ce1d534 r6029: adding files necessary to support 'net rpc service' functions; will fill in tomorrow
(This used to be commit 6bbd61cfd1)
2007-10-10 10:56:16 -05:00
Günther Deschner
7c198517da r5954: Fix some compiler warnings and add missing exclude-block in "net rpc
share migrate" (found by Lars Mueller <lmuelle@suse.de>).

Guenther
(This used to be commit 45a2a7bedb)
2007-10-10 10:56:11 -05:00
Volker Lendecke
b4ecaaf599 r5910: Partial fix for bug 2438. I'll leave the debug message in place, that fix is a
bit more effort.

The real fix for this would be to open an schannel netlogon connection to the
remote DC and change the trust account password...

Volker
(This used to be commit ab8991c384)
2007-10-10 10:56:08 -05:00
Herb Lewis
5794ada01f r5888: fix incorrect test - don't print anything if user is not in any groups
(This used to be commit 2461a8e482)
2007-10-10 10:56:07 -05:00
Gerald Carter
6b06ba4a87 r5614: fix proto for copy_fn() after changes to cli_list()
(This used to be commit fb8e746ed6)
2007-10-10 10:55:50 -05:00
Jim McDonough
7f5611ce55 r5594: Fix comment to read "remove" instead of "add"
(This used to be commit 6884a2fa6e)
2007-10-10 10:55:49 -05:00
Jim McDonough
ac1cc87122 r5591: Implement "net rpc trustdom del", including client side of
samr_remove_sid_from_foreign_domain.
(This used to be commit 8360695fc0)
2007-10-10 10:55:49 -05:00
Jim McDonough
180fa12026 r5580: Fix "net rpc trustdom add". Much closer to what windows does. Also stop
referencing unknown_6 from sam, because it's just fixed at 1260, the max
len of LOGON_HRS.  Need to go in and mark it as "remove me" from passdb.
(This used to be commit ffac752875)
2007-10-10 10:55:48 -05:00
Volker Lendecke
dc0ec44483 r5471: In cli_samr_lookup_rids, flags is not a flags but an array size. W2k3 rejects
everything but 1000 here, so there's no point in exposing that to the caller.

Thanks,

Volker
(This used to be commit 03ec1bd9e5)
2007-10-10 10:55:42 -05:00
Richard Sharpe
5ba4fb5eb9 r5318: Fix a small problem in where we ignore the response from a SamrGetGroupsForUser
that says the user is in 0 groups, and we issue an RPC to LookupIds for 0 RIDs.

The printing that there are no groups the user is a member of might be overkill
in that it might upset existing scripts that don't expect that output.
(This used to be commit d3482e118f)
2007-10-10 10:55:37 -05:00
Günther Deschner
9b1e5a7118 r4972: Fix a warning and some debugging-outputs.
Guenther
(This used to be commit 1eabfa050b)
2007-10-10 10:55:10 -05:00
Günther Deschner
725edd20f1 r4868: Add "net rpc user RENAME"-command.
Note that Samba3 does not yet support it server-side.

Guenther
(This used to be commit b2c8220931)
2007-10-10 10:55:05 -05:00
Gerald Carter
862e610e4a r4820: add beginnings of 'net rpc rights' for managing privilege assignments
(This used to be commit 164f94e529)
2007-10-10 10:53:55 -05:00
Jeremy Allison
bd22606da0 r4656: Convert the winreg pipe to use WERROR returns (as it should).
Also fix return of NT_STATUS_NO_MORE_ENTRIES should be
ERROR_NO_MORE_ITEMS reported by "Marcin Porwit" <mporwit@centeris.com>.
Jeremy.
(This used to be commit 511cdec60d)
2007-10-10 10:53:50 -05:00
Volker Lendecke
c85d9e735c r4570: Replace cli->nt_pipe_fnum with an array of NT file numbers, one for each
supported pipe. Netlogon is still special, as we open that twice, one to do
the auth2, the other one with schannel.

The client interface is completely unchanged for those who only use a single
pie. cli->pipe_idx is used as the index for everything except the "real"
client rpc calls, which have been explicitly converted in my last commit. Next
step is to get winbind to just use a single smb connection for multiple pipes.

Volker
(This used to be commit dc294c52e0)
2007-10-10 10:53:47 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jim McDonough
0cd225cbf3 r3771: Fix bug #1952: no comment on XP shutdown
Try INITSHUTDOWN pipe first, used by newer clients.  If it fails, fall back
to WINREG.
(This used to be commit f05858df65)
2007-10-10 10:53:17 -05:00
Günther Deschner
3eff1f48d5 r2942: Add client-side support of triggering ads printer publishing over msrpc
setprinter calls inside the net-tool.

This is usefull to mimic the same queries a windows-client does. At
least win2k returns WERR_IO_PENDING when printer is published via
setprinter, samba returns WERR_OK but this does not hurt.

Guenther
(This used to be commit 69b745fb98)
2007-10-10 10:52:57 -05:00
Volker Lendecke
e66c8217f8 r2935: This is a long-standing one in my patch-queue: A pair of net commands
(usersidlist/allowedusers) to scan a file server's share and list all users
who have permission to connect there.

Volker
(This used to be commit f7f84aa1de)
2007-10-10 10:52:57 -05:00
Tim Potter
b4cf9e9505 r2835: Since we always have -I. and -I$(srcdir) in CFLAGS, we can get rid of
'..' from all #include preprocessor commands.   This fixes bugzilla #1880
where OpenVMS gets confused about the '.' characters.
(This used to be commit 7f161702fa)
2007-10-10 10:52:55 -05:00
Günther Deschner
676aa559fe r2746: Fix typos in net's usage-output.
Guenther
(This used to be commit 4886d6663d)
2007-10-10 10:52:50 -05:00
Günther Deschner
e4c4d91896 r2080: Remove last traces of static migration to localhost. Needed to allow a
local netbios-alias bound to non-loopback interface as a migration target.

It's now possible to migrate printers|shares|files from Server A to
Server B while running the net-command on client C.

Guenther
(This used to be commit 0cfd2866df)
2007-10-10 10:52:30 -05:00
Günther Deschner
19e949a91b r1966: further work on and cleanup of the net-migration-tool.
It's now possible to migrate files preserving dos-attributes and correct
timestamps. Also added some small docu- and syntax-fixes.

Guenther
(This used to be commit 0e990582a0)
2007-10-10 10:52:25 -05:00
Günther Deschner
60727acc3b r1692: first commit :)
* add IA64 to the architecture table of printer-drivers

* add new "net"-subcommands:

  net rpc printer migrate {drivers|printers|forms|security|settings|all}
        [printer]
  net rpc share migrate {shares|files|all} [share]

  this is the first part of the migration suite. this will will (once
  feature-complete) allow to do 1:1 server-cloning in the best possible way by
  making heavy use of samba's rpc_client-functions. all migration-steps
  are implemented as rpc/smb-client-calls; net communicates via rpc/smb
  with two servers at the same time (a remote, source server and a
  destination server that currently defaults to the local smbd). this
  allows e. g. printer-driver migration including driverfiles, recursive
  mirroring of file-shares including file-acls, etc. almost any migration
  step can be called with a migrate-subcommand to provide more flexibility
  during a migration process (at the cost of quite some redundancy :) ).

  "net rpc printer migrate settings" is still in a bad condition (many
  open questions that hopefully can be adressed soon).

  "net rpc share migrate security" as an isolated call to just migrate
  share-ACLs will be added later.

  Before playing with it, make sure to use a test-server. Migration is a
  serious business and this tool-set can perfectly overwrite your
  existing file/print-shares.

* along with the migration functions had to make I the following
  changes:

        - implement setprinter level 3 client-side

        - implement net_add_share level 502 client-side

        - allow security descriptor to be set in setprinterdata level 2
          serverside

guenther
(This used to be commit 8f1716a29b)
2007-10-10 10:52:19 -05:00
Volker Lendecke
47af5445f3 r977: Implement 'net rpc group rename' -- rename domain groups.
Volker
(This used to be commit 9ceff80327)
2007-10-10 10:51:52 -05:00
Volker Lendecke
92cb49de77 r964: The max_size field in cli_samr_enum_als_groups is more like an account_control
field with indiviual bits what to retrieve. Set this to 0xffff as NT4
usrmgr.exe does to get everything. I'm too lazy (sorry) to get this through to
rpc_parse/ etc.

Volker
(This used to be commit d7239c2611)
2007-10-10 10:51:51 -05:00
Volker Lendecke
7f00878fe6 r269: Patch from Krischan Jodies <kj@sernet.de>: Implement 'net rpc group delete'.
Volker
(This used to be commit ec32167496)
2007-10-10 10:51:16 -05:00
Volker Lendecke
ef4a7b3c40 Two little annoyances:
net rpc did not inform you if no smbd is running.

I never liked the error message (!) Success! when we established a trust.

Volker
(This used to be commit 4191a434d4)
2004-03-18 07:32:15 +00:00
Volker Lendecke
5dc2b72f9b Another typo, sorry for samba-cvs spam :-)
(This used to be commit 3e39d157cb)
2004-03-04 17:51:29 +00:00
Volker Lendecke
869561ad76 Fix typo.
Volker
(This used to be commit 8ba5bdc330)
2004-03-04 17:47:14 +00:00
Volker Lendecke
c4877403a0 net_rpc.c: Don't complain if [add|del]mem was successful.
srv_samr_nt.c: Correctly report that a user is not member of an alias.

Volker
(This used to be commit 540f625036)
2004-02-29 16:34:33 +00:00
Volker Lendecke
efd357b732 Print an informative error message if trying to add/remove members from
something not a group.

Volker
(This used to be commit 73f26de5c0)
2004-02-29 12:47:45 +00:00
Volker Lendecke
a92de03d9e Add 'net rpc group [add|del]mem' for domain groups and aliases.
Volker
(This used to be commit e597420421)
2004-02-28 18:41:16 +00:00
Volker Lendecke
0e2de3d27e Fix my fix to net rpc group list. We can certainly have more than a single
set of groups.

Volker
(This used to be commit e77fe4a77a)
2004-02-28 08:18:09 +00:00
Volker Lendecke
f934f5d7df Add 'net rpc group add'. For this parse_samr.c had to be changed: The
group_info4 in set_dom_group_info also has the level in the record
itself. This seems not to be an align. Tested with NT4 usrmgr.exe. It can
still create a domain group on a samba machine.

Volker
(This used to be commit 76c75bb8a7)
2004-02-24 18:00:41 +00:00
Volker Lendecke
96a5c5e38c Don't try to show groups that could not be listed.
Volker
(This used to be commit d713e76a24)
2004-02-17 15:24:28 +00:00
Volker Lendecke
6b7e509004 If there are no alias members, don't ask for their sids :-)
Volker
(This used to be commit 99f03a641e)
2004-02-17 10:08:18 +00:00
Gerald Carter
439bcaf9e7 BUG 1055; patch from SATOH Fumiyasu <fumiya@miraclelinux.com>; formatting fixes for 'net share'
(This used to be commit 44db163b30)
2004-02-11 14:59:08 +00:00
Volker Lendecke
6268f1bdbc Expand 'net rpc group members' to local groups.
Volker
(This used to be commit 90fabe6ec0)
2004-02-09 18:19:25 +00:00
Andrew Bartlett
784c631a3a Make it possible to 'net rpc samdump' of any domain you are currently joined
to, despite any smb.conf settings.

Work to allow the same for 'net rpc vampire', but instead give a clear
error message on what is incorrect.

Andrew Bartlett
(This used to be commit 6b629344c5)
2004-02-08 10:59:09 +00:00
Andrew Bartlett
62df6251cc Add some help for 'net rpc password'.
Andrew Bartlett
(This used to be commit 4c7d6b9be3)
2004-02-08 09:25:58 +00:00
Andrew Bartlett
7acbbe9ba0 I should have done this years ago...
This adds the very simple 'admin set password' capability to 'net rpc',
much as we have it for 'net ads'.

Andrew Bartlett
(This used to be commit ced7fb5527)
2004-02-07 03:54:39 +00:00
Andrew Bartlett
784b05c489 This adds client-side support for the unicode/SAMR password change scheme.
As well as avoiding DOS charset issues, this scheme returns useful error
codes, that we can map back via the pam interface.

This patch also cleans up the interfaces used for password buffers, to
avoid duplication of code.

Andrew Bartlett
(This used to be commit 2a2b1f0c87)
2004-01-26 08:45:02 +00:00
Volker Lendecke
f9e9acb07f Fix compiler warning
(This used to be commit 413ed77142)
2004-01-21 14:48:02 +00:00
Jim McDonough
261fba09ef Fix another join problem. Don't use a TALLOC_CTX before it has been
initialized.

Also split out the oldstyle join into a new fn, allowing us to call it
with no failure message from net rpc join, but displaying a failure message
when used with net rpc oldjoin.
(This used to be commit 07d6ed4343)
2004-01-16 15:07:28 +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
b4593e92ff JHT came up with a nasty (broken) torture case in preparing examples for
his book.

This prompted me to look at the code that reads the unix group list.  This
code did a lot of name -> uid -> name -> sid translations, which caused
problems.  Instead, we now do just name->sid

I also cleaned up some interfaces, and client tools.

Andrew Bartlett
(This used to be commit f9e59f8bc0)
2004-01-02 05:32:07 +00:00
Volker Lendecke
748b268a4f In the brief 'net rpc group' listing, don't cut off group names at 21 chars.
Volker
(This used to be commit 5d0b8280f6)
2003-12-01 14:12:26 +00:00
Volker Lendecke
3dda7cf2ca Implement 'net rpc group list [global|local|builtin]*' for a select listing of
the respective user databases.

Volker
(This used to be commit 39e4ee0c5b)
2003-11-28 15:10:00 +00:00
Volker Lendecke
dd51a9be94 Only ask for 512 names at a time.
Volker
(This used to be commit d5775b7106)
2003-11-27 17:31:18 +00:00
Volker Lendecke
5efc777a0f Implement "net rpc group members": Get members of a domain group in
human-readable format.

Volker
(This used to be commit 4e3a2eb8e0)
2003-11-26 10:07:07 +00:00
Andrew Bartlett
78404434d0 Add support for variable-length session keys in our client code.
This means that we now support 'net rpc join' with KRB5 (des based)
logins.  Now, you need to hack 'net' to do that, but the principal is
important...

When we add kerberos to 'net rpc', it should be possible to still do
user management and the like over RPC.

(server-side support to follow shortly)

Andrew Bartlett
(This used to be commit 9ecf9408d9)
2003-11-22 23:38:41 +00:00
Jim McDonough
debbecb23c Add shutdown abort try over initshutdown pipe first, then fall back to
winreg pipe if it doesn't work.  Fixes bug #534.

I will go back and add the same logic for the shutdown itself, even though
that works so far against win2k (haven't tested all win clients).
(This used to be commit e660b04e8f)
2003-10-24 14:03:18 +00:00
Gerald Carter
88c95aa735 fix some warnings found by the Sun C compiler
(This used to be commit e1fac713e2)
2003-09-22 17:53:59 +00:00
Rafal Szczesniak
b1993600e6 In case of 'net rpc trustdom add' without domain name we were silently
asking for password without a piece of error message or explanation.


rafal
(This used to be commit d46793b335)
2003-08-15 21:57:59 +00:00
Rafal Szczesniak
bb6fb2880b Give a temporary hint on how to delete trust account.
rafal
(This used to be commit 836746beab)
2003-08-15 19:47:10 +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
Herb Lewis
d294d4b98f get rid of warning on IRIX
(This used to be commit 6ec683e24e)
2003-08-15 02:01:56 +00:00
Rafal Szczesniak
1a43ca5ace Small typo fix found while testing domain trusts.
rafal
(This used to be commit 033ee6e687)
2003-08-13 20:53:48 +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
f51d769dd3 large change:
*)  consolidates the dc location routines again (dns
    and netbios)  get_dc_list() or get_sorted_dc_list()
    is the authoritative means of locating DC's again.

    (also inludes a flag to get_dc_list() to define
     if this should be a DNS only lookup or not)

    (however, if you set "name resolve order = hosts wins"
     you could still get DNS queries for domain name IFF
     ldap_domain2hostlist() fails.  The answer?  Fix your DNS
     setup)

*)  enabled DOMAIN<0x1c> lookups to be funneled through
    resolve_hosts resulting in a call to ldap_domain2hostlist()
    if lp_security() == SEC_ADS

*)  enables name cache for winbind ADS backend

*)  enable the negative connection cache for winbind
    ADS backend

*)  removes some old dead code

*)  consolidates some duplicate code

*)  moves the internal_name_resolve() to use an IP/port pair
    to deal with SRV RR dns replies.  The namecache code
    also supports the IP:port syntax now as well.

*)  removes 'ads server' and moves the functionality back
    into 'password server' (which can support "hostname:port"
    syntax now but works fine with defaults depending on
    the value of lp_security())
(This used to be commit d7f7fcda42)
2003-06-25 17:41:05 +00:00
Volker Lendecke
e1f4d66b73 Fix for bug#3. Show comments when doing 'net group -l'.
Volker
(This used to be commit e5664adc07)
2003-06-12 16:21:22 +00:00
Volker Lendecke
c8667b03f8 Working on bug#3. We want all of the aliases, so start with 0.
Volker
(This used to be commit ec1a58d09e)
2003-06-12 15:37:06 +00:00
Andrew Bartlett
4407869ad2 Fix compile.
(This used to be commit ca2e453c78)
2003-05-11 23:49:36 +00:00
Volker Lendecke
0710bab071 Set the password for a newly created trustdom account. Tested against
PDCs running NT4SP1, NT4SP6 and Samba 3.0.

Volker
(This used to be commit 2143446043)
2003-05-11 16:59:06 +00:00
Andrew Bartlett
a0af88e8c1 Fix the spinning bug for 'net rpc user' as well - there are more errors in
this world than 'status more entires'...

Also move all the cases to 'NT_STATUS_EQUAL()' to test it.

Andrew Bartlett
(This used to be commit b4645bf066)
2003-05-07 22:56:02 +00:00
Rafal Szczesniak
8be0f0d145 Turn off using lsa_qos in OpenPolicy call. This way we avoid annoying
debug msg while establishing trust and listing relations of Samba PDC.


Rafal
(This used to be commit 8681cbae0d)
2003-05-05 08:32:30 +00:00
Andrew Bartlett
aa79f23d9b Turn down some DEBUG()s and remove some duplicate code spotted by dfenwick.
Andrew Bartlett
(This used to be commit 542a8b1817)
2003-05-01 02:51:49 +00:00
Jim McDonough
ad8e83f78f Allow net rpc user -l to list longer than 50 characters in a user comment.
Net.exe on windows won't allow more than 50 characters to be entered, but
through AD you can have much more than this.
(This used to be commit ca2886c938)
2003-04-29 15:09:54 +00:00
Tim Potter
bf3e2980bc Merge of missed another while condition when enumerating aliases.
(This used to be commit ee78196bcf)
2003-04-25 04:09:01 +00:00
Tim Potter
d3ba70356e Merge:
>When calling cli_samr_enum_{dom,als}_groups in a while loop, the
>terminating condition should be result != STATUS_MORE_ENTRIES, not
>result == NT_STATUS_OK otherwise we get stuck in an infinite loop
>when there's any sign of trouble.
(This used to be commit 4998a72cf8)
2003-04-25 02:00:47 +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
Jeremy Allison
09a50497d1 Fixes to make SCHANNEL work in 3.0 against a W2K DC. Still need to fix
multi-PDU encode/decode with SCHANNEL. Also need to test against WNT DC.
Jeremy.
(This used to be commit ff66d40970)
2003-04-16 15:39:57 +00:00
Jelmer Vernooij
9397cdba52 - Change ADS CHOSTPASS -> ADS CHANGETRUSTPW
- Add general CHANGETRUSTPW function that calls ADS CHANGETRUSTPW or RPC CHANGETRUSTPW
(Merged from HEAD)
(This used to be commit f0982e1102)
2003-04-14 22:27:09 +00:00
Tim Potter
00352663c4 Merge of bugfix for cli_lsa_query_info_policy() usage.
(This used to be commit ab64a0b1e7)
2003-04-14 04:00:15 +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