1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-04 05:18:06 +03:00
Commit Graph

2019 Commits

Author SHA1 Message Date
Volker Lendecke
7b9ef5e840 r19292: Avoid some potential segfaults: In winreg_EnumValue all pointers are unique
pointers and can thus be independently NULL.

Thanks,

Volker
(This used to be commit d48ac0726a)
2007-10-10 12:15:29 -05:00
Volker Lendecke
4980baf2e1 r19224: Add setting the rng_fault_state to the already converted pipes.
Convert the low-hanging fruit of the LSA server. This provides a sample how
the server calls can be converted one by one, see the "proxy_lsa_call"
function.

Volker
(This used to be commit 99e54a213a)
2007-10-10 12:15:23 -05:00
Volker Lendecke
b71a0be998 r19220: Check if a backend has set rng_fault_state and send a dce-level fault pdu.
Volker
(This used to be commit 21c08e7ef4)
2007-10-10 12:15:22 -05:00
Volker Lendecke
9d8d4f24b1 r19156: Make enumprinters use the share iterators.
Volker
(This used to be commit 9b1759617c)
2007-10-10 12:15:18 -05:00
Volker Lendecke
e918cf3abf r19154: Trivial logic simplification: Get rid of two indentation levels. Survives the
consistency checks just checked into Samba4.

Volker
(This used to be commit c48bb4b37b)
2007-10-10 12:15:17 -05:00
Jim McDonough
dc1f0804dd r19058: Implement "user cannot change password", and complete "user must change
password at next logon" code.  The "password last set time" of zero now
means "user must change password", because that's how windows seems to
use it.  The "can change" and "must change" times are now calculated
based on the "last set" time and policies.

We use the "can change" field now to indicate that a user cannot change
a password by putting MAX_TIME_T in it (so long as "last set" time isn't
zero).  Based on this, we set the password-can-change bit in the
faked secdesc.
(This used to be commit 21abbeaee9)
2007-10-10 12:15:06 -05:00
Volker Lendecke
7ced2e983d r19028: Implement getprinterinfo level 6 (only the status) and get rid of snum in the
getprinter calls. Survives the RPC-SAMBA3-SPOOLSS test which I will activate
when the Samba4 build farm has picked it up.

Volker
(This used to be commit d7248b6cfa)
2007-10-10 12:15:03 -05:00
Gerald Carter
b3ec4697ef r18962: * Add IDL for SaveKey() and RestoreKey() and regenerated
* Tested RegSaveKey() using win32 app.  Apparently
  this code has been brokne for a really long time.
(This used to be commit 5381dcbde3)
2007-10-10 12:14:51 -05:00
Gerald Carter
2279881bd4 r18954: Fix segv in QueryValue and Enumvalue. regedit.exe now
is happy again when creating keys and values
(This used to be commit 6e9e9f8fac)
2007-10-10 12:14:50 -05:00
Gerald Carter
d89a951517 r18940: Fix a few memory corruption bugs to make CreateKey() and DeleteKey() work
(This used to be commit e7e3e35c1d)
2007-10-10 12:14:49 -05:00
Gerald Carter
c67b555874 r18934: fix a segv in CreateKey()
(This used to be commit 92f22f67ed)
2007-10-10 12:14:48 -05:00
Gerald Carter
855d12e567 r18932: In RegEnumvalue() and RegQueryValue(), the output buffer
size must match the real value of the data.
(This used to be commit e11108024a)
2007-10-10 12:14:48 -05:00
Gerald Carter
49c73b5734 r18931: * Fix the IDL for QueryInfoKey. teh Classname in an
in,out ref pointer
* Clarify variable names in EnumValue IDL
* Fix server code for _winreg_EnumValue() and _winreg_QueryInfoKe()
(This used to be commit f520a9d0fb)
2007-10-10 12:14:48 -05:00
Gerald Carter
5935ea9da1 r18929: * Clarify QueryValue IDL and regenerate code
* Fix server _winreg_Query_Value() implementation so that
  usrmgr.exe starts now
(This used to be commit 435d7bfc37)
2007-10-10 12:14:47 -05:00
Jeremy Allison
fec9850644 r18898: Fix for bug #4100 from Udo Eberhardt <udo.eberhardt@thesycon.de>.
Ensure we initialize values for smb_io_notify_info_data_strings to
fix crash.
Jeremy.
(This used to be commit ceefb8dd3c)
2007-10-10 12:14:44 -05:00
Volker Lendecke
10a8d62e96 r18888: Fix a 64-bit warning
(This used to be commit 94b53f2f2a)
2007-10-10 12:14:41 -05:00
Jelmer Vernooij
387bfebfcf r18823: Fix some errors in the srsvc handling code and start running the RPC-SRVSVC
test against samba3.
(This used to be commit f0508ecb44)
2007-10-10 12:01:03 -05:00
Stefan Metzmacher
7239a85f0a r18804: resume_hnd isn't a ref pointer and can be NULL
metze
(This used to be commit 8736262342)
2007-10-10 12:00:59 -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
1303cd8245 r18794: Make ENumKey() work again in the registry server
(This used to be commit 7ead5ac792)
2007-10-10 12:00:58 -05:00
Gerald Carter
c8ef27a3c3 r18792: small fix for server QueryValue code
(This used to be commit b11558c232)
2007-10-10 12:00:58 -05:00
Gerald Carter
8e0217da6f r18790: Correct the IDL (still a bug in pidl) for QueryValue()
(This used to be commit 44851d7afa)
2007-10-10 12:00:58 -05:00
Gerald Carter
eab57a0a0f r18789: Replace the winreg server code with the libndr parsing code.
Many things work (OpenHKLM, etc...) but some still don't.
This shouldn't block anyone so I'm checking it in.
Will probably move to a bzr tree after this for
longer dev cycles between checkins.
(This used to be commit cf1404a0d7)
2007-10-10 12:00:57 -05:00
Gerald Carter
045567f2be r18756: cleanup copyrights after moving to new wkssvc implementation code
(This used to be commit 18b24e0fe9)
2007-10-10 12:00:55 -05:00
Jim McDonough
f002bb2a46 r18754: Get rid of some more invalid time sets
(This used to be commit 3840d3785f)
2007-10-10 12:00:54 -05:00
Jelmer Vernooij
4db7642caa r18745: Use the Samba4 data structures for security descriptors and security descriptor
buffers.

Make security access masks simply a uint32 rather than a structure
with a uint32 in it.
(This used to be commit b41c52b9db)
2007-10-10 12:00:54 -05:00
Stefan Metzmacher
12a5226534 r18742: this function returns WERROR
gix the build on RedHat 7.0

metze
(This used to be commit d6f5a0cc7a)
2007-10-10 12:00:53 -05:00
Gerald Carter
b7d069097b r18739: * Get the wkssvc patch right this time.
* Remove the old wkssvc server, client, & parsing code.
* Update srv_wkssvc_nt.c with stubs for the remaining
  stubs
(This used to be commit 0cb79ee13f)
2007-10-10 12:00:53 -05:00
Gerald Carter
01c684a3e9 r18730: readd missing files (one more)
(This used to be commit 8e0b801c8b)
2007-10-10 12:00:53 -05:00
Gerald Carter
8126f91375 r18728: revert previous commit until I fix the wkssvc_nt.c changes
(This used to be commit 57d8519185)
2007-10-10 12:00:52 -05:00
Gerald Carter
9dda6cdf4c r18725: Replace out one wkssvc call (wkssrv_GetInfo()) with autogenerated
code.  Removed first rpc_parse/*.c file.  w00t!
(This used to be commit bb9b7a058d)
2007-10-10 12:00:52 -05:00
Jim McDonough
77a7066d79 r18724: Fixup time(0) -> time(NULL)
(This used to be commit 6b17af0769)
2007-10-10 12:00:52 -05:00
Jim McDonough
e04dda6a2a r18722: Fix up password change times. The can change and must change times are
calculated based on the last change time, policies, and acb flags.

Next step will be to not bother storing them.  Right now I'm just trying to
get them reported correctly.
(This used to be commit fd5761c9e5)
2007-10-10 12:00:52 -05:00
Günther Deschner
d1e28fa76d r18680: Fix last struct uuids (in uncommented code).
Guenther
(This used to be commit 41c79ee5ac)
2007-10-10 12:00:47 -05:00
Jelmer Vernooij
4e7d11449a r18654: Rename "struct uuid" => "struct GUID" for consistency.
(This used to be commit 5de76767e8)
2007-10-10 11:52:19 -05:00
Günther Deschner
1e02ed76eb r18621: Fix samr server build.
Guenther
(This used to be commit 23d6656427)
2007-10-10 11:52:01 -05:00
Jelmer Vernooij
e5db7fee0f r18572: Use the autogenerated client and server for the echo interface and implement
some of the missing functions. RPC-ECHO now passes against Samba3.
(This used to be commit 9e9a053661)
2007-10-10 11:51:51 -05:00
Jelmer Vernooij
71453ab90d r18526: Use generated server for unixinfo RPC interface.
(This used to be commit a5c0606d76)
2007-10-10 11:51:46 -05:00
Jelmer Vernooij
e6b7c350c1 r18487: Add NULL checks
(This used to be commit 3df11307f8)
2007-10-10 11:51:44 -05:00
Jelmer Vernooij
48e2a2bfb7 r18481: Use pidl-generated server side code for dfs.
(This used to be commit 3f337c104d)
2007-10-10 11:51:43 -05:00
Gerald Carter
bad8c0d6f1 r18429: fix a regression renaming local group introduced by trying to handle renames to the same name
(This used to be commit 4faa5004fb)
2007-10-10 11:51:23 -05:00
Simo Sorce
62c78742c4 r18413: Based on the new torture test I added in samba4 it turns out
the flags determines what kind of share is this.
I suppose 0x80000000 means something like (legacy) as it will
fail for any share name longer then 13 chars (same size accepted
for old RAP calls that come from pre NT OSs.

Jerry,
let me know if you want me to commit this to 3_0_23

Simo.
(This used to be commit f09f8b2d82)
2007-10-10 11:51:22 -05:00
Gerald Carter
5e1146ab58 r18404: * swap from POLICY_HND to the struct policy_handle from ndr/misc.h
* move OUR_HANDLE macro to include/rpc_misc.h
(This used to be commit 2b37079af2)
2007-10-10 11:51:22 -05:00
Stefan Metzmacher
703881988b r18390: give a better error code
metze
(This used to be commit b2709f4fe5)
2007-10-10 11:51:20 -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
b65eb11a2e r17872: Fix possible null deref found by the Stanford checker.
Jeremy.
(This used to be commit ac06fc42cb)
2007-10-10 11:38:56 -05:00
Gerald Carter
6717e0d467 r17797: Just say "ok" when trying to rename a local group to its same name.
(This used to be commit e6e5412500)
2007-10-10 11:38:48 -05:00
Volker Lendecke
03e3cd1d5a r17554: Cleanup
(This used to be commit 761cbd52f0)
2007-10-10 11:38:38 -05:00
Volker Lendecke
76362d0d33 r17468: To minimize the diff later on, pre-commit some changes independently: Change
internal mapping.c functions to return NTSTATUS instead of BOOL.

Volker
(This used to be commit 4ebfc30a28)
2007-10-10 11:38:36 -05:00
Volker Lendecke
e1e62d8999 r17463: A bit of cleanup work:
Remove some unused code: pdb_find_alias is not used anymore, and nobody I
think has ever used the pdb_nop operations for group mapping. smbpasswd and
tdb use the default ones and ldap has its own.

Make the functions pdb_getgr* return NTSTATUS instead of BOOL. Nobody right
now really makes use of it, but it feels wrong to throw away information so
early.

Volker
(This used to be commit f9856f6490)
2007-10-10 11:38:36 -05:00
Günther Deschner
11673dc07a r17453: Fix msdfs RPC management (this broke with the autogenerated dfs rpcs).
* Remove "unknown" from dfs_Enum (samba4 dfs IDL updates to follow).

* When encountering an unsupported infolevel the rpc server must reply
with a dfs_info_0 structure and WERR_OK (observed from w2k3 when talking
to nt4).

Guenther
(This used to be commit f9bef1f08f)
2007-10-10 11:38:34 -05:00
Volker Lendecke
ff7c0a7c35 r17451: Change pdb_getgrsid not to take a DOM_SID but a const DOM_SID * as an
argument.

Volker
(This used to be commit 873a5a1211)
2007-10-10 11:38:34 -05:00
Jeremy Allison
6cab0fbb8b r17439: Fix logic error in checking TALLOC return. Spotted by Volker.
Jeremy.
(This used to be commit 06aea05c52)
2007-10-10 11:38:33 -05:00
Gerald Carter
22c9a3151e r17386: fix inverted logic pointed out by Volker. When deleting a printer return access denied if the printer still exists after the delete_printer_hook() is called
(This used to be commit c05e2bdc0c)
2007-10-10 11:38:30 -05:00
Volker Lendecke
8eebd925b2 r17364: Another NT4 join bug: The idealx tools set the primary group sid, and if we do
an update_sam_account later on, we want to also set it using the delete/add
method. As the idealx tools use the replace method, they don't care about what
has been in there before.

Jerry, this is a likely 3.0.23b candidate. Not merging, it's your call :-)

Volker
(This used to be commit f002a36338)
2007-10-10 11:38:28 -05:00
Volker Lendecke
430fa0eba0 r17348: Some C++ warnings
(This used to be commit ae6b9b34e5)
2007-10-10 11:38:27 -05:00
Jeremy Allison
49001a5b1b r17346: Add optimisation vl needs for the cluster code where
we don't get the chainlock when getting the byte range
lock record read-only.
Jeremy.
(This used to be commit fcd798ca0c)
2007-10-10 11:38:27 -05:00
Volker Lendecke
e23781b3b3 r17316: More C++ warnings -- 456 left
(This used to be commit 1e4ee728df)
2007-10-10 11:38:25 -05:00
Jeremy Allison
a093a76dc1 r17293: After the results from the cluster tests in Germany,
fix the messaging code to call the efficient calls :

save_re_uid()
set_effective_uid(0);

messaging_op

restore_re_uid();

instead of using heavyweight become_root()/unbecome_root()
pairs around all messaging code. Fixup the messaging
code to ensure sec_init() is called (only once) so that non-root
processes still work when sending messages.

This is a lighter weight solution to become_root()/unbecome_root()
(which swaps all the supplemental groups) and should be more
efficient. I will migrate all server code over to using this
(a similar technique should be used in the passdb backend
where needed).

Jeremy.
(This used to be commit 4ace291278)
2007-10-10 11:38:24 -05:00
Jeremy Allison
29a4d666ba r17245: Second part of fix for #3962. Don't do a double
free in the infolevel2 case. Free both queue and
NT_PRINTER_INFO_LEVEL in the same place.
Jeremy.
(This used to be commit 6ac3a4ce78)
2007-10-10 11:38:21 -05:00
Jeremy Allison
9d4fa2b27b r17244: There were several error paths where NT_PRINTER_INFO_LEVEL
wasn't being freed - also one enum jobs case where the
NT_PRINTER_INFO_LEVEL and queue weren't being freed.
Strange that Coverity or Klokwork didn't pick these up.
Hopefully will fix #3962.
Jeremy.
(This used to be commit bb26412387)
2007-10-10 11:38:21 -05:00
Gerald Carter
8cc35cc8da r17217: Fix a couple of "smbldap_open(): Cannot open when not root" bugs
when viewing or modifying local group membership.
(This used to be commit 41e30a9666)
2007-10-10 11:38:19 -05:00
Volker Lendecke
aac411b7dd r17199: Add comment to the RID/SID miracle
(This used to be commit 4c4ae01c67)
2007-10-10 11:38:19 -05:00
Volker Lendecke
dc833fa694 r17194: To run rpc-samba3-lsa in the build farm, we can't rely on geteuid()==0. Adapt
it to other "Am I root?" checks.

Jerry, Jeremy, please check this!

Thanks,

Volker
(This used to be commit f777b2d294)
2007-10-10 11:38:19 -05:00
Volker Lendecke
e85be720a3 r17192: Make this actually survive valgrind. We NEED pidl here...
Maybe bzr is not such a bad idea, then you would probably see less spam on
samba-cvs, sorry for that... :-)

Volker
(This used to be commit 41456b498a)
2007-10-10 11:38:19 -05:00
Volker Lendecke
19cc80b40f r17188: Dump lsa_lookupsids3. I could not make it work at all against W2k3, the
rpc-lsa test even considers NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED not to be an
error.

Before someone re-activates this, show me a working sniff please :-)

Volker
(This used to be commit b185fb9fa6)
2007-10-10 11:38:18 -05:00
Gerald Carter
efc7ac209d r17183: LsaLookupSids() shoudl return the string form of a SID when
it cannot be mapped and not the hex of the RID.  Who wrote that?
(This used to be commit 4e51cf34cf)
2007-10-10 11:38:18 -05:00
Volker Lendecke
e0c68d0a1d r17177: Get rid of a global variable by adding a private data pointer to
share_mode_forall().

Volker
(This used to be commit f97f6cedff)
2007-10-10 11:38:17 -05:00
Gerald Carter
9f6fb43eee r17150: MMC User & group plugins fixes:
* Make sure to lower case all usernames before
  calling the create, delete, or rename hooks.
* Preserve case for usernames in passdb
* Flush the getpwnam cache after renaming a user
* Add become/unbecome root block in _samr_delete_dom_user()
  when trying to verify the account's existence.
(This used to be commit bbe11b7a95)
2007-10-10 11:38:16 -05:00
Volker Lendecke
4c713703d0 r17097: Move share_access_check from rpc_server/srv_srvsvc_nt.c to lib/sharesec.c
(This used to be commit 220dd43330)
2007-10-10 11:38:11 -05:00
Volker Lendecke
283b74fce5 r17096: Simplify share_access_check a bit: It takes the sharename instead of the snum,
and the decision which token to use (conn or vuser) does not really belong
here, it is better done in the two places where this is called.

Volker
(This used to be commit 0a138888ad)
2007-10-10 11:38:11 -05:00
Volker Lendecke
f512695ea4 r17064: lsa_GetUserName needs to return the name for S-1-5-7 on an anonymous login.
Found that because I want to play around with setsharesecurity, for this I
need the "whoami" call figuring out the SID of the currently connected user.

Not activating this test yet until the build farm has picked up the new samba4
revision.

Volker
(This used to be commit 5cfe482841)
2007-10-10 11:38:10 -05:00
Volker Lendecke
2203228c79 r17039: Eliminate snum from enumshares and getshareinfo. Get rid of some pstrings.
Volker
(This used to be commit c5e393d5ed)
2007-10-10 11:19:21 -05:00
Volker Lendecke
5b474afa74 r17033: Restructure init_srv_share_info_ctr so that there's only one loop, not a dozen
or so. Next step will be to eliminate the explicit snum reference.

Volker
(This used to be commit 6e98f8d6c6)
2007-10-10 11:19:21 -05:00
Volker Lendecke
1f2419d9f8 r17032: I thought I had already merged this from trunk:
> r16959 | vlendec | 2006-07-11 23:10:44 +0200 (Di, 11 Jul 2006) | 1 line
>
> get_share_security does not need snum, activate RPC-SAMBA3-SRVSVC

Volker
(This used to be commit c89471e157)
2007-10-10 11:19:21 -05:00
Gerald Carter
751ad57534 r16954: Volker reminded me we already have code to do this check.
Reuse can_create() to prevent renameing a group to
an existing user or group.
(This used to be commit ce7091fda1)
2007-10-10 11:19:15 -05:00
Gerald Carter
7c1f79143b r16953: Don't allow groups to be renamed to an existing user or other group
(This used to be commit 7d619f127e)
2007-10-10 11:19:15 -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
Günther Deschner
d1a9ac533b r16799: Fix remote smbd crash bug by removing half-implemented info level 4
dfs_Enum.

Guenther
(This used to be commit 4e5ea585c3)
2007-10-10 11:19:11 -05:00
Gerald Carter
26c0b81d75 r16785: BUG 3908: Fix rpc bin authentication failure which broke user password changes
Jeremy, please review.
(This used to be commit 154e4a2815)
2007-10-10 11:19:10 -05:00
Jeremy Allison
b85c276e95 r16678: Fix bug #3898 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit 5c5ea3152f)
2007-10-10 11:19:07 -05:00
Jeremy Allison
45bc56c27b r16646: Fix bug #3888 reported by Jason Mader <jason@ncac.gwu.edu>.
Jeremy.
(This used to be commit 433d7a1bc9)
2007-10-10 11:19:05 -05:00
Jeremy Allison
d1014c1cdf r16582: Fix Klocwork #1997 and all generic class of problems
where we don't correctly check the return from memdup.
Jeremy.
(This used to be commit ce14daf51c)
2007-10-10 11:19:01 -05:00
Jeremy Allison
24814867c3 r16544: Fix bug #3864 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit 16e42b446b)
2007-10-10 11:18:59 -05:00
Jeremy Allison
429cd6db0b r16542: Fix #3863, reported by jason@ncac.gwu.edu
Jeremy.
(This used to be commit cde8323fdc)
2007-10-10 11:18:59 -05:00
Jeremy Allison
607f9ffc8e r16433: Fix Coverity #300 (triggered by a Klockwork bugfix
I think). If a alloc fails just return NT_STATUS_NO_MEMORY,
don't go to "done" label and deref pointers.
Jeremy.
(This used to be commit 490c7c8467)
2007-10-10 11:18:54 -05:00
Volker Lendecke
3c34f6085a r16409: Fix Klocwork ID's.
1177

In reg_perfcount.c: 1200 1202 1203 1204
In regfio.c: 1243 1245 1246 1247 1251

Jerry, the reg_perfcount and regfio.c ones, can you take a look please? This
is really your code, and I'm not sure I did the right thing to return an
error.

smbcacls.c: 1377
srv_eventlog_nt.c: 1415 1416 1417
srv_lsa_nt.c: 1420 1421
srv_netlog_nt.c: 1429
srv_samr_nt: 1458 1459 1460

Volker

Volker
(This used to be commit d6547d12b1)
2007-10-10 11:18:52 -05:00
Volker Lendecke
eb41bfb91b r16301: Fix a memleak
(This used to be commit 21aaede518)
2007-10-10 11:17:32 -05:00
Jeremy Allison
f9147c4e40 r16241: Fix Klocwork #106 and others like it.
Make 2 important changes. pdb_get_methods()
returning NULL is a *fatal* error. Don't try
and cope with it just call smb_panic. This
removes a *lot* of pointless "if (!pdb)" handling
code. Secondly, ensure that if samu_init()
fails we *always* back out of a function. That
way we are never in a situation where the pdb_XXX()
functions need to start with a "if (sampass)"
test - this was just bad design, not defensive
programming.
Jeremy.
(This used to be commit a0d368197d)
2007-10-10 11:17:27 -05:00
Volker Lendecke
efdc5b72fd r16065: Re-add a strlower_m(account) in samr_create_user that was dropped for no
reason but to increase fidelity with W2k3. Tom Bork has raised valid concerns
that Unix scripts might rely on the account names being lower-case, so keep
that. We might later decide to only lower-case the unix name passed to
'add [user|group] script' but keep the passdb entry upper-case. But there are
enough user-visible changes in 3_0 already so that we should push this off to
a later date.

Tom, waiting for more bug reports from you ;-))

Thanks for insisting!

Volker
(This used to be commit bc78cca290)
2007-10-10 11:17:19 -05:00
Volker Lendecke
c594a5519d r16060: This is one of the more dirty patches I've put in lately. Parse enough of
SetUserInfo level 25 to survive the join method XP uses if the user did not
exist before. For good taste this contains way too much cut&paste, but for a
real fix there is just not enough time.

Up to 3.0.22 we completely ignored that a full level 21 is being sent together
with level 25, but we got away with that because on creation we did not set
the "disabled" flag on the workstation account. Now we correctly follow W2k3
in this regard, and we end up with a disabled workstation after join.

Man, I hate rpc_parse/. The correct fix would be to import PIDL generated samr
parsing, but this is would probably be a bit too much for .23...

Thanks to Tom Bork for finding this one.

Volker
(This used to be commit 5a37aba105)
2007-10-10 11:17:18 -05:00
Jeremy Allison
656d8c30db r16054: Janitor for Volker ? Volker - some reason you didn't
fix this in 3.0 ?
Jeremy.

We had no way to return NT_STATUS_OK from the netlogon serverpwset,
although
we successfully set the machine password...

One thing the samba3 join test found.

Volker
(This used to be commit e5b7acc9b5)
2007-10-10 11:17:18 -05:00
Gerald Carter
1a850a4f37 r15975: Only call the printer publishing calls if 'security = ads'
(prevent a segv)
(This used to be commit a2ef525d9e)
2007-10-10 11:17:15 -05:00
Volker Lendecke
77aa11f4dc r15570: Fix Coverity bug # 286. I really wonder why gcc -O1 did not catch this one.
Volker
(This used to be commit c6bf2c8922)
2007-10-10 11:17:02 -05:00
Günther Deschner
4137c63d02 r15455: Add rpccli_samr_query_dom_info2() and return the comment string in
samr_query_domain_info(2) for consistency reasons.

Guenther
(This used to be commit 870495e2c8)
2007-10-10 11:16:48 -05:00
Günther Deschner
212b832e4a r15454: As testing, documentation and samba4 idl indicate that there is no known
difference between samr_query_domain_info and samr_query_domain_info2,
wrap the info2 call around the info call. There have been various "could
not access LDAP when not root" bugs lurking around in
samr_query_domain_info2 anyway.

Guenther
(This used to be commit 3e181b46be)
2007-10-10 11:16:48 -05:00
Günther Deschner
c5e2804762 r15452: Again purely cosmetic reformat of the samr query domain info calls.
Guenther
(This used to be commit 6ed7d7fa70)
2007-10-10 11:16:47 -05:00
Günther Deschner
0fe21ac560 r15442: Add some more client rpc for the querydominfo calls (from samba4 idl).
Also return the hostname for the level 6 call (to be consistent with the
server name in level 2).

Guenther
(This used to be commit 41b72e77ae)
2007-10-10 11:16:44 -05:00
Günther Deschner
52e778e6f8 r15438: Fix samrQueryDomainInfo level 5 where we returned our netbios
name eversince instead of the domain name when we are a DC.

Yes, there are applications relying on this call to be correct.

Guenther
(This used to be commit 26dd22c9af)
2007-10-10 11:16:43 -05:00
Gerald Carter
2bdbd3fa6d r15380: default eventlog tdbs to mode 0660 to allow easier access by BUILTIN\Administrators
(This used to be commit a02933c958)
2007-10-10 11:16:38 -05:00
Jeremy Allison
1f3fe6a504 r15334: Fix warning. This table and function not used anymore. Jerry please
check.
Jeremy.
(This used to be commit 9f676603aa)
2007-10-10 11:16:36 -05:00
Gerald Carter
d4a51cc500 r15309: normalize printing keys when deleting
(This used to be commit 037f9f831e)
2007-10-10 11:16:34 -05:00
Jeremy Allison
0498f3b889 r15129: Separate out mechanism and policy for NTLMSSP auth/sign/seal.
With this change (and setting lanman auth = no in smb.conf)
we have *identical* NTLMSSP flags to W2K3 in SPNEGO auth.
Jeremy
(This used to be commit 93ca3eee55)
2007-10-10 11:16:25 -05:00
Volker Lendecke
e17302200c r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring does not
have the timeout argument in Samba4. Add a new routine
tdb_lock_bystring_with_timeout.

Volker
(This used to be commit b9c6e3f556)
2007-10-10 11:16:23 -05:00
Günther Deschner
3f2b06d614 r15044: Fix the build. (void returning non-void).
Guenther
(This used to be commit 3ff278b852)
2007-10-10 11:15:59 -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
Jeremy Allison
2178bcaa39 r14788: Fix coverity bug #276. null deref.
Jeremy.
(This used to be commit 0217f7d7bf)
2007-10-10 11:15:48 -05:00
Jeremy Allison
00fb5e431d r14786: Fix coverity #275. null deref.
Jeremy.
(This used to be commit 363d31c9ec)
2007-10-10 11:15:48 -05:00
Günther Deschner
20204ab040 r14646: Adding samr querygroup infolevels 2 & 5.
Guenther
(This used to be commit 6c4fe819c6)
2007-10-10 11:15:42 -05:00
Gerald Carter
1839b4be14 r14634: Many bug fixes thanks to train rides and overnight stays in airports
* Finally fix parsing idmap uid/gid ranges not to break with spaces
  surrounding the '-'
* Allow local groups to renamed by adding info level 2 to
  _samr_set_aliasinfo()
* Fix parsing bug in _samr_del_dom_alias() reply
* Prevent root from being deleted via Samba
* Prevent builting groups from being renamed or deleted
* Fix bug in pdb_tdb that broke renaming user accounts
* Make sure winbindd is running when trying to create the Administrators
  and Users BUILTIN groups automatically from smbd (and not just check the
  winbind nexted groups parameter value).
* Have the top level rid allocator verify that the RID it is about to
  grant is not already assigned in our own SAM (retries up to 250 times).
  This fixes passdb with existing SIDs assigned to users from the RID algorithm
  but not monotonically allocating the RIDs from passdb.
(This used to be commit db1162241f)
2007-10-10 11:15:41 -05:00
Günther Deschner
1d5ab8fd05 r14597: Merge DCERPC_FAULT constants from Samba 4.
Guenther
(This used to be commit 3f195f8248)
2007-10-10 11:15:38 -05:00
Gerald Carter
f4a5c016e3 r14482: Fixes for spoolss code (after coverity fixes) when the
client sends a NULL RPC_BUFFER*
(This used to be commit 69f816e9f8)
2007-10-10 11:15:33 -05:00
Gerald Carter
36f622acea r14450: Fix more get_md4pw() breakage caused by missing "breaks"
in the switch statement which matched the schannel type
against the account type.
(This used to be commit 57c705ea63)
2007-10-10 11:15:30 -05:00
Gerald Carter
0f0ad2992e r14448: * protect against NULL cli_state* pointers in cli_rpc_pipe_open()
* Fix inverted logic check for machine accounts in get_md4pw()
(This used to be commit a36529535d)
2007-10-10 11:15:30 -05:00
Günther Deschner
24961b173b r14443: rework get_md4pw() to ease debugging. The only functional change is that
we now check wheter the sec_channel_type matches the trust account type.

Guenther
(This used to be commit c35eb44937)
2007-10-10 11:15:30 -05:00
Gerald Carter
0ce53f8ba5 r14403: * modifies create_local_nt_token() to create a BUILTIN\Administrators
group IFF sid_to_gid(S-1-5-32-544) fails and 'winbind nested groups = yes'

* Add a SID domain to the group mapping enumeration passdb call
  to fix the checks for local and builtin groups.  The SID can be
  NULL if you want the old semantics for internal maintenance.
  I only updated the tdb group mapping code.

* remove any group mapping from the tdb that have a
  gid of -1 for better consistency with pdb_ldap.c.
  The fixes the problem with calling add_group_map() in
  the tdb code for unmapped groups which might have had
  a record present.

* Ensure that we distinguish between groups in the
  BUILTIN and local machine domains via getgrnam()
  Other wise BUILTIN\Administrators & SERVER\Administrators
  would resolve to the same gid.

* Doesn't strip the global_sam_name() from groups in the
  local machine's domain (this is required to work with
  'winbind default domain' code)

Still todo.

* Fix fallback Administrators membership for root and domain Admins
  if nested groups = no or winbindd is not running

* issues with "su - user -c 'groups'" command

* There are a few outstanding issues with BUILTIN\Users that
  Windows apparently tends to assume.  I worked around this
  presently with a manual group mapping but I do not think
  this is a good solution.  So I'll probably add some similar
  as I did for Administrators.
(This used to be commit 612979476a)
2007-10-10 11:15:28 -05:00
Jeremy Allison
be2bc3147c r14395: Fix coverity bug #55. Ensure no unsigned/signed comparisons.
Jeremy.
(This used to be commit cd3ad3f1a6)
2007-10-10 11:15:28 -05:00
Jeremy Allison
e6676a9a69 r14387: Try and fix the coverity issues (#53, #54) with negative
sink by ensuring all uses of rpcstr_push are consistent
with a size_t dest size arg.
Jeremy.
(This used to be commit f65d7afe19)
2007-10-10 11:15:27 -05:00
Jeremy Allison
d1684fa82e r14353: Fix coverity bugs #61 and #62. Remember to divide by
the size of the data table. Clean up the struct a little.
Jeremy.
(This used to be commit 338538410d)
2007-10-10 11:15:26 -05:00
Jeremy Allison
bd1e853c19 r14338: Fix coverity #55 by explicit cast.
Jeremy.
(This used to be commit 1fece52da4)
2007-10-10 11:15:25 -05:00
Jeremy Allison
d72bb5627c r14303: Fix coverity #223. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
(This used to be commit f71aa3ab8f)
2007-10-10 11:15:24 -05:00
Jeremy Allison
ad838bf65e r14301: Fix coverity #224. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
(This used to be commit f1a5e5aefe)
2007-10-10 11:15:24 -05:00
Jeremy Allison
860015db1f r14299: Fix coverity #225. In a loop we were forgetting to free
resources on error exit path.
Jeremy.
(This used to be commit 1c0b4ed0ac)
2007-10-10 11:15:24 -05:00
Jeremy Allison
19879eba83 r14289: Fix coverity #101, resource leak on error code path.
Jeremy.
(This used to be commit d9e1d6fed0)
2007-10-10 11:15:23 -05:00
Jeremy Allison
acc651a31b r14286: Similar clarifiction fix for coverity #102.
Jeremy.
(This used to be commit f458596b0e)
2007-10-10 11:15:23 -05:00
Jeremy Allison
e4600491cf r14284: Fix coverity bug #103. Make code clearer - probably
not a real issue but this code is easier to read.
Jeremy.
(This used to be commit 6621acc68f)
2007-10-10 11:15:23 -05:00
Jeremy Allison
bb0d6f0459 r14268: Fix coverity error #204. Resource leak on error path.
Jeremy.
(This used to be commit 5f74e56b86)
2007-10-10 11:15:22 -05:00
Jeremy Allison
88dda37184 r14266: Fix coverity #205. Resource leak on error path.
Jeremy.
(This used to be commit 23d69758bb)
2007-10-10 11:15:21 -05:00
Jeremy Allison
65eb331afc r14264: Fix coverity #207. Resource leak on error path.
Jeremy.
(This used to be commit 0429b6e8c3)
2007-10-10 11:15:21 -05:00
Jeremy Allison
05b4d0b38e r14250: Fix coverity bug #107. Resource leak on error path.
Jeremy.
(This used to be commit ca96c7be77)
2007-10-10 11:15:20 -05:00
Volker Lendecke
71bf1be099 r14233: Fix Coverity bug # 206
(This used to be commit 0dc3030bce)
2007-10-10 11:15:18 -05:00
Volker Lendecke
c9f256cb6c r14226: Fix Coverity bug # 109
(This used to be commit e9a63e3b35)
2007-10-10 11:15:18 -05:00
Jeremy Allison
dd728b4712 r14182: Ensure we know that dom_sid cannot be null.
Jeremy.
(This used to be commit e3a28bf4c8)
2007-10-10 11:15:15 -05:00
Jeremy Allison
5a1c225c18 r14178: Clarify code for Coverity #49. Ensure we know we
can't have an uninitialized *returned val.
Jeremy.
(This used to be commit e83515afd2)
2007-10-10 11:15:15 -05:00
Jeremy Allison
77709e58ad r14031: Coverity bug CID #110. Free all resources correctly
on pipe initialization failure.
Jeremy.
(This used to be commit daa919a94b)
2007-10-10 11:11:06 -05:00
Jeremy Allison
f7bf439030 r13994: Belt and braces - ensure RPC_BUFFER is valid.
Jeremy.
(This used to be commit d993797191)
2007-10-10 11:11:03 -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
Gerald Carter
129fd6c5c6 r13878: move PORT_DATA_1 to use static sized UNICODE strings as per MSDN
(This used to be commit c803e1b2af)
2007-10-10 11:10:57 -05:00
Gerald Carter
5df58c38f3 r13829: From the "It's not pretty but it works" category
* Finish prototype of the "add port command" implementation
  Format is "addportcommand portname deviceURI"

* DeviceURI is either
  - socket://hostname:port/
  - lpr://hostname/queue
  depending on what the client sent in the request
(This used to be commit 6d74de7a67)
2007-10-10 11:10:56 -05:00
Gerald Carter
889ff32b5e r13824: * add api table for Xcv TCPMON and LOCALMON calls starting
with the "MonitorUI" call
* Fix some parsing errors

This gets us to the Add Port Wizard dialog.
(This used to be commit a444aa7f00)
2007-10-10 11:10:56 -05:00
Gerald Carter
2a7847ea37 r13821: replacing some strings with macros
(This used to be commit a34ab5c827)
2007-10-10 11:10:56 -05:00
Gerald Carter
354c24d525 r13820: * Start fleshing out the XcvDataPort() server implementation
* Add support for the "Local Port" monitor as well through this API
(This used to be commit ba9cdd88a0)
2007-10-10 11:10:55 -05:00
Gerald Carter
e33b728c7b r13815: "Into the blind world let us now descend,"
Began the poet, his face as pale as death.
"I will go first, and you will follow me."
---

Adding XcvDataPort() to the spoolss code for remotely
add ports.  The design is to allow an intuitive means
of creating a new CUPS print queue from the Windows 2000/XP
APW without hacks like specifying the deviceURI in the
location field of the printer properties dialog.

Also set 'default devmode = yes' as the new default
since it causes no harm and only is executed when you
have a NULL devmode anyways.
(This used to be commit 123e478ce5)
2007-10-10 11:10:55 -05:00
Jeremy Allison
1b456f2894 r13778: When deleting machine accounts it's the SeMachineAccountPrivilege
that counts.
Jeremy.
(This used to be commit aa85ba4f37)
2007-10-10 11:10:53 -05:00
Gerald Carter
a2327fc688 r13766: Patch from Arek Glabek <aglabek@centeris.com>:
* Fix parsing error in eventlogadm caused by log entries
  with no DAT: line.
(This used to be commit f0a8f43879)
2007-10-10 11:10:53 -05:00
Simo Sorce
aec8de1703 r13715: Put back the code that actually modify the account,
removed, I presume by mistake, by Jerry in the recent
patch the removes the primary group SID stuff.

set_user_info_21 is called to update many other things
like the description of a user for example (that's what
failed on me).

Jerry, please review this one.
(This used to be commit 239a37d201)
2007-10-10 11:10:50 -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
d95e13e68f r13679: Commiting the rm_primary_group.patch posted on samba-technical
* ignore the primary group SID attribute from struct samu*
* generate the primary group SID strictlky from the Unix
  primary group when dealing with passdb users
* Fix memory leak in original patch caused by failing to free a
  talloc *
* add wrapper around samu_set_unix() to prevent exposing the create
  BOOL to callers.  Wrappers are samu_set_unix() and samu-allic_rid_unix()
(This used to be commit bcf269e2ec)
2007-10-10 11:10:23 -05:00
Günther Deschner
cab298856a r13622: Allow to rename machine accounts in a Samba Domain. This still uses the
"rename user script" to do the rename of the posix machine account (this
might be changed later). Fixes #2331.

Guenther
(This used to be commit b2eac2e6eb)
2007-10-10 11:10:19 -05:00
Gerald Carter
cd55919263 r13590: * replace all pdb_init_sam[_talloc]() calls with samu_new()
* replace all pdb_{init,fill}_sam_pw() calls with samu_set_unix()
(This used to be commit 6f1afa4acc)
2007-10-10 11:10:16 -05:00
Gerald Carter
2203bed32c r13576: This is the beginnings of moving the SAM_ACCOUNT data structure
to make full use of the new talloc() interface.  Discussed with Volker
and Jeremy.

* remove the internal mem_ctx and simply use the talloc()
  structure as the context.
* replace the internal free_fn() with a talloc_destructor() function
* remove the unnecessary private nested structure
* rename SAM_ACCOUNT to 'struct samu' to indicate the current an
  upcoming changes.  Groups will most likely be replaced with a
  'struct samg' in the future.

Note that there are now passbd API changes.  And for the most
part, the wrapper functions remain the same.

While this code has been tested on tdb and ldap based Samba PDC's
as well as Samba member servers, there are probably still
some bugs.  The code also needs more testing under valgrind to
ensure it's not leaking memory.

But it's a start......
(This used to be commit 19b7593972)
2007-10-10 11:10:15 -05:00
Gerald Carter
fb5362c069 r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a)
2007-10-10 11:10:14 -05:00
Jeremy Allison
0bc643620b r13557: (Hopefully) get the creds store/restore key right from
the correct part of the netlogon and schannel packets.
Jeremy.
(This used to be commit 4877f336b2)
2007-10-10 11:10:13 -05:00
Jeremy Allison
5539d3d5a8 r13556: Ensure that any potential creds operation are protected
by schannel if "server schannel = true" was set.
Jeremy.
(This used to be commit fd84d9703e)
2007-10-10 11:10:13 -05:00
Jeremy Allison
9132acff08 r13553: Fix all our warnings at -O6 on an x86_64 box.
Jeremy.
(This used to be commit ea82958349)
2007-10-10 11:10:13 -05:00
Jeremy Allison
3403fc2d49 r13552: Make sure we're using the same name to load the stored
creds under all circumstances. This may be wrong, but
at least we're now consistent.
Jeremy.
(This used to be commit 09f0b3e1a3)
2007-10-10 11:10:13 -05:00
Jeremy Allison
952a631d5d r13548: Always use the get_remote_macinhe_name() as the key
for the creds store. This should fix the problems
Jerry reported (but I have still to run tests :-).
Jeremy.
(This used to be commit 43f095a38d)
2007-10-10 11:10:13 -05:00
Gerald Carter
b2ae6e08da r13547: add earlier checks to deny deleting a printer driver. The previous
code relied upon file permissions alone.  Now we check that
the user is a printer administrator and that the share has not been
marked read only for that user.
(This used to be commit 117d9fd9e1)
2007-10-10 11:10:12 -05:00
Volker Lendecke
a2f2a1d9f8 r13544: -O1 janitor work :-)
(This used to be commit a95d7d7222)
2007-10-10 11:10:12 -05:00
Jeremy Allison
39a572e010 r13539: Add 128 bit creds processing client and server. Thanks to Andrew Bartlett's
Samba4 code.
Jeremy.
(This used to be commit a2fb436fc5)
2007-10-10 11:10:11 -05:00
Jeremy Allison
8d5ef34aa3 r13521: Implement LOOKUPNAME3 and 4.
Jeremy.
(This used to be commit 6ec0e9124a)
2007-10-10 11:10:09 -05:00
Jeremy Allison
3e4cf56fa3 r13519: Fix the credentials chaining across netlogon pipe disconnects.
I mean it this time :-).
Jeremy.
(This used to be commit 80f4868944)
2007-10-10 11:10:09 -05:00
Gerald Carter
87d23f263f r13511: Fix bug in the samr dispinfo enumeration code.
Make sure to associate the DOMAIN dispinfo cache
with a User/Group SAMR handle (not the SID of the user or group).
Ensure that enumeration after deleting a user works.
(This used to be commit 7967f89caa)
2007-10-10 11:10:08 -05:00
Volker Lendecke
301d51e13a r13494: Merge the stuff I've done in head the last days.
Volker
(This used to be commit bb40e544de)
2007-10-10 11:10:06 -05:00
Jeremy Allison
85160e654e r13458: Add parsing functions - but stub internals for lookupnames3 and 4.
Jeremy.
(This used to be commit f1a362580a)
2007-10-10 11:10:04 -05:00
Jeremy Allison
785c78b795 r13456: Add lsa_lookup_names2.
Jeremy.
(This used to be commit b57406c89f)
2007-10-10 11:10:04 -05:00
Jeremy Allison
e22d38bdde r13455: Prepare to add lookupnames2.
Jeremy.
(This used to be commit 2274709587)
2007-10-10 11:10:04 -05:00
Jeremy Allison
acc4a837aa r13449: Ensure we don't crash if no dc struct on pipe.
Jeremy.
(This used to be commit a9e1d0f3b4)
2007-10-10 11:10:04 -05:00
Jeremy Allison
06cf1e18e5 r13447: Added LSA_LOOKUPSIDS2 and LSA_LOOKUPSIDS3.
Jeremy.
(This used to be commit a164cfab42)
2007-10-10 11:10:03 -05:00
Günther Deschner
72b30eba64 r13444: Add REJECT_REASON_OTHER for samr_chgpasswd_user3
Guenther
(This used to be commit 58baf718be)
2007-10-10 11:10:03 -05:00
Günther Deschner
e83c7d0141 r13442: Implement samr_chgpasswd_user3 server-side.
Guenther
(This used to be commit f60eddc0a4)
2007-10-10 11:10:03 -05:00
Jeremy Allison
e493d32912 r13439: Fix NET_SAM_LOGON_EX.
Jeremy.
(This used to be commit 9437ffc84f)
2007-10-10 11:10:02 -05:00
Jeremy Allison
e19ae28581 r13436: Add in NET_SAM_LOGON_EX. Still needs testing.
Jeremy
(This used to be commit f58d0ebf74)
2007-10-10 11:10:02 -05:00
Jeremy Allison
4d2b4c92d2 r13434: Add stub for NET_SAM_LOGON_EX.
Jeremy.
(This used to be commit 58544eb3c8)
2007-10-10 11:10:02 -05:00
Jeremy Allison
ad8b47a2ba r13407: Change the credentials code to be more like the Samba4 structure,
makes fixes much easier to port. Fix the size of dc->sess_key to
be 16 bytes, not 8 bytes - only store 8 bytes in the inter-smbd
store in secrets.tdb though. Should fix some uses of the dc->sess_key
where we where assuming we could read 16 bytes.
Jeremy.
(This used to be commit 5b3c2e63c7)
2007-10-10 11:09:59 -05:00
Jeremy Allison
cf7c47aac9 r13399: Get closer to passing RPC-SCHANNEL test.
Jeremy.
(This used to be commit 8ae70122b7)
2007-10-10 11:09:59 -05:00
Jeremy Allison
86358fc10b r13396: Add in userinfo26, re-enable userinfo25 - took the knowledge
from Samba4 on how to decode the 532 byte password buffers.
Getting closer to passing samba4 RPC-SCHANNEL test.
Jeremy.
(This used to be commit 205db6968a)
2007-10-10 11:09:59 -05:00
Gerald Carter
ef3f2c9675 r13393: Do not initialize the lp_svcctl_list() value since it is handled
internally in services_db.c now.  This prevents internal services from
being listed twice (one internal and one external) when no
'svcctl list' parameter is explcitly set in smb.conf
(This used to be commit 6c4ede6cee)
2007-10-10 11:09:58 -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
Jeremy Allison
d14af63e6a r13293: Rather a big patch I'm afraid, but this should fix bug #3347
by saving the UNIX token used to set a delete on close flag,
and using it when doing the delete. libsmbsharemodes.so still
needs updating to cope with this change.
Samba4 torture tests to follow.
Jeremy.
(This used to be commit 23f16cbc2e)
2007-10-10 11:06:21 -05:00
Jeremy Allison
f1022af07b r13176: Fix show-stopper bug for 3.0.21b where 4 leg NTLMSSP SPNEGO
auth was not generating the correct auth header on the 4th
packet. This may fix a lot of Windows client complaints and
is essential for release.
Jeremy.
(This used to be commit 48dd8c732b)
2007-10-10 11:06:16 -05:00
Jeremy Allison
60bcd1bd77 r13147: Raise creds_server_step fail log messages to debug level 2.
These can happen in normal operation (I think - not 100%
sure) and don't want to alarm admins. Jerry please add this
to 3.0.21b.
Jeremy.
(This used to be commit 47178b1b5a)
2007-10-10 11:06:15 -05:00
Simo Sorce
77965f6cf6 r13138: old fix I forgot to commit
need to access info when using the ldap backend
(This used to be commit 80c0625667)
2007-10-10 11:06:15 -05:00
Gerald Carter
e5d1583c59 r13086: hooking max connections into 'add share' as well (although the WinXP UI doesn't give you a way to set the value on add
(This used to be commit e6afdf1df5)
2007-10-10 11:06:13 -05:00
Gerald Carter
9ededd3151 r13085: hook the max connections spin box in the share properties MMC plugin
dialog to the 'max connections' smb.conf parameter.  Also added the max
uses int from the SHARE_INFO_2 structure to the 'modify share command'
(This used to be commit af68748baa)
2007-10-10 11:06:13 -05:00
Gerald Carter
0773e79761 r13082: revert an accidentally commited patch (still in progress)
(This used to be commit e43775fb31)
2007-10-10 11:06:12 -05:00
Gerald Carter
e95e6044b0 r13081: correct fix for the segv in nmbd caused by a double free on namerec.
(This used to be commit c908dbc4b2)
2007-10-10 11:06:12 -05:00
Alexander Bokovoy
a02415bf36 r12935: After discussion with Volker fix bug #3397 using a variant of the patch by Alex Deiter (tiamat@komi.mts.ru).
Introduces level 9 of getuserinfo and allows to successfully install MS SMS2003
on a member of a Samba domain. Also added support for this level in rpcclient.

The code for infolevel 9 is modelled upon Samba-TNG by Alex Deiter.

Jerry, we need this in 3.0.21b.
(This used to be commit 93461646ce)
2007-10-10 11:06:08 -05:00
Gerald Carter
005c88054f r12916: use rpcstr_pull() instead of unistr_to_ascii() when validating share names
(This used to be commit c08bc30698)
2007-10-10 11:06:07 -05:00
Gerald Carter
bb59be3e0d r12915: protect against changing the SCM security descriptor
(This used to be commit 5842da9968)
2007-10-10 11:06:07 -05:00
Gerald Carter
e7a1a0ead2 r12914: adding query/set ops for security descriptors on services.
(This used to be commit cefd2d7cb6)
2007-10-10 11:06:07 -05:00
Gerald Carter
6f91e3a862 r12262: * patch from Brian Moran to fix segv in eventlogadm when not eventlogs
are listed in smb.conf
* initialize the local group description in set_alias_info()
(This used to be commit 58f8b42069)
2007-10-10 11:05:51 -05:00
Gerald Carter
728e527d2c r12224: adding more characters to the invalid share name string
(This used to be commit e461143639)
2007-10-10 11:05:50 -05:00
Gerald Carter
2c0114d211 r12177: last of outstanding patches in my queue to deal with MMC.
Validate the share name and fail when trying to creating
a share with bad characters.
(This used to be commit 174fe494f9)
2007-10-10 11:05:48 -05:00
Gerald Carter
a489553067 r12173: doing some service control work
* Add a few new error codes for disabled services
* dump some more details about service status in 'net rpc service'
* disable the WINS and NetLogon services if not configured in smb.conf

Still trying to figure out how to disable the start button
on the NetLogon and WINS services.
(This used to be commit c0f54eeebc)
2007-10-10 11:05:47 -05:00
Volker Lendecke
661c5c741a r12163: Change lookup_sid and lookup_name to return const char * instead of char *,
use a temporary talloc_ctx for clarity.

Volker
(This used to be commit b15815c804)
2007-10-10 11:05:46 -05:00
Volker Lendecke
6a92f418ea r12133: Fix an uninitialized variable in new code in rpc_server/srv_samr_nt.c.
Fix winbind_lookup_name for the local domain, ie for aliases on a member
server.

Volker
(This used to be commit 4ba50c823e)
2007-10-10 11:05:46 -05:00
Volker Lendecke
05ac2de0df r12051: Merge across the lookup_name and lookup_sid work. Lets see how the build farm
reacts :-)

Volker
(This used to be commit 9f99d04a54)
2007-10-10 11:05:43 -05:00
Jeremy Allison
d1f91f7c72 r12043: It's amazing the warnings you find when compiling on a 64-bit
box with gcc4 and -O6...
Fix a bunch of C99 dereferencing type-punned pointer will break
strict-aliasing rules errors. Also added prs_int32 (not uint32...)
as it's needed in one place. Find places where prs_uint32 was being
used to marshall/unmarshall a time_t (a big no no on 64-bits).
More warning fixes to come.
Thanks to Volker for nudging me to compile like this.
Jeremy.
(This used to be commit c65b752604)
2007-10-10 11:05:42 -05:00
Günther Deschner
6ffd82ea77 r11964: rename flag to password_properties in SAM_UNK_INFO_1 because that's what
it is. (SAM_UNK_INFO_1 should get a better name as well).

Guenther
(This used to be commit d94aaeb625)
2007-10-10 11:05:40 -05:00
Jeremy Allison
05fafb8396 r11950: If we got a connection oriented cancel pdu we would spin processing it.
Fix that, and also add in comments for all possible CL and CO PDU
types. Make sure we process them correctly.
Jeremy.
(This used to be commit 672113a627)
2007-10-10 11:05:39 -05:00
Jeremy Allison
add7cff520 r11936: Fix bug in returning remote time found by Thomas Bork <tombork@web.de>.
get_time_zone() was overwriting static buffer returned by
gmtime(). Lars - this is a mandatory fix for the next patch...
Jeremy.
(This used to be commit 68d03a7a74)
2007-10-10 11:05:37 -05:00
Jeremy Allison
d9f26f78f6 r11927: No users or groups to return in BUILTIN domain.
Jeremy.
(This used to be commit 908e671c75)
2007-10-10 11:05:36 -05:00
Jeremy Allison
48c2f9fc72 r11924: Added Volkers's (C) to srv_samr_nt.c, removed separate "builtin"
search enumeration, fixed count of groups and users to return
zero if we're getting domain info on the builtin domain (need
to fix the enumgroup and enumuser calls also). Added count_sam_aliases
to return the correct alias count. Need to push the SID arg
down into the group mapping interface so we only return the
correct aliases. Upped passdb version numer for Volkers
changes. SAM-MYSQL guys - you will need to fix your backend
now. More tests needed.
Jeremy.
(This used to be commit b53d5cd565)
2007-10-10 11:05:36 -05:00
Volker Lendecke
10bc204efb r11923: Add samr_lookup_rids for the builtin domain. Doing it this way feels a bit
wrong, but so far we don't have proper multi-domain support in passdb yet...

Volker
(This used to be commit c917cfc320)
2007-10-10 11:05:36 -05:00
Volker Lendecke
046a8873b9 r11922: Looks bigger than it is: There's no point in allocating arrays in
samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in
the pdb module. Remove the latter, this might happen more often.

Volker
(This used to be commit 57f0cf8cdd)
2007-10-10 11:05:36 -05:00
Volker Lendecke
fcf14ebee2 r11921: samr_open_domain can only open "our" domain and BUILTIN.
Volker
(This used to be commit 049920ce4f)
2007-10-10 11:05:36 -05:00
Volker Lendecke
add1493a86 r11919: The generic mappings in srv_samr_nt.c are only used there -- make them
static.

One long overdue simplification: Change local_lookup_sid to local_lookup_rid
its responsible for "our" domain only, in fact it checked for it.

Volker
(This used to be commit 35ba5e083c)
2007-10-10 11:05:35 -05:00
Volker Lendecke
5976053f05 r11918: Remove two unused variables
(This used to be commit 5524d66295)
2007-10-10 11:05:35 -05:00
Volker Lendecke
4ce6499849 r11917: Move nt_token_to_group_list to srv_netlog_nt.c. srv_util.c is empty now.
Volker
(This used to be commit ae4ffc1cfb)
2007-10-10 11:05:35 -05:00
Volker Lendecke
3088a85c62 r11915: Remove unused extern declarations
(This used to be commit 3c35fb642a)
2007-10-10 11:05:35 -05:00
Volker Lendecke
ed6936598e r11898: Add a missing become_root().
Volker
(This used to be commit efb7576d4e)
2007-10-10 11:05:33 -05:00
Jeremy Allison
a509c20eb6 r11865: The only way to stop multiple LDAP searches is to agressively cache
results. We now cache them for 10 seconds, down from 30 seconds
(however each re-use will refresh the idle timeout). Any set calls
will flush the cache.
Jeremy.
(This used to be commit c9a0720f55)
2007-10-10 11:05:32 -05:00
Gerald Carter
f2ecd4fed0 r11860: BUG 3156: don't use find_service() when explicitly looking for a printer as the username map might get in the way
(This used to be commit 46bf28c81c)
2007-10-10 11:05:31 -05:00
Günther Deschner
4826f9d413 r11859: Another place where the SE_GROUP constants read better then "7".
Guenther
(This used to be commit 4c4b209645)
2007-10-10 11:05:31 -05:00
Günther Deschner
2770e98aec r11856: Replace unknown1 with group_attr.
Can anyone remember why we initialize groups only with 0x03 instead of 0x07 ?

Guenther
(This used to be commit 3282c7c458)
2007-10-10 11:05:30 -05:00
Jeremy Allison
9be0ce4422 r11793: Fix the SAMR cache so it works across completely insane
client behaviour (ie.:
open pipe/open SAMR handle/enumerate 0 - 1024
close SAMR handle, close pipe.
open pipe/open SAMR handle/enumerate 1024 - 2048...
close SAMR handle, close pipe.
And on ad-nausium. Amazing.... probably object-oriented
client side programming in action yet again.
This change should *massively* improve performance when
enumerating users from an LDAP database.
Jeremy.
(This used to be commit 8ce705d9cc)
2007-10-10 11:05:28 -05:00
Jeremy Allison
d09beee040 r11769: Looking at a performance problem enumerating accounts, wondered
if changing to support samr_connect5 might help so quickly coded
it up. No it doesn't :-(. Don't merge this for 3.0.21 please.
Jeremy.
(This used to be commit bff1df678a)
2007-10-10 11:05:27 -05:00
Gerald Carter
1ce2883865 r11762: fix my build breakage
(This used to be commit 9ee851630e)
2007-10-10 11:05:26 -05:00
Gerald Carter
5251618c7f r11761: * fix clearing of event logs by truncating the tdb.
This feature got broken in some of the other updates.
  Now each open handle stores an pointer to an open tdb
  data structure (not the tdb pointer itself).
  Clearing can be done with a simple elog_close_tdb( elog, True )
  to force a close and then calling elog_open_tdb( logname, True )
  to force an tdb truncate.  Permissions on existing tdbs are
  maintained which is important.

* We don't currently handle backup.  Haven't looked at the
  format of a backuped up eventlog to know what the deal is.
(This used to be commit 2df34c9403)
2007-10-10 11:05:26 -05:00
Gerald Carter
70cac98b6e r11760: fix sequential reads in the eventlog; event viewer is behaving better now as well but needs more testing
(This used to be commit ba2f94aeae)
2007-10-10 11:05:26 -05:00
Gerald Carter
c672a17ff0 r11617: fix typo
(This used to be commit 37d2bf02f3)
2007-10-10 11:05:22 -05:00
Jeremy Allison
fcceedd67c r11573: Adding Andrew Bartlett's patch to make machine account
logons work if the client gives the MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT
or MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT flags. This changes
the auth module interface to 2 (from 1). The effect of this is
that clients can access resources as a machine account if they
set these flags. This is the same as Windows (think of a VPN
where the vpn client authenticates itself to a VPN server
using machine account credentials - the vpn server checks
that the machine password was valid by performing a machine
account check with the PDC in the same was as it would a
user account check. I may add in a restriction (parameter)
to allow this behaviour to be turned off (as it was previously).
That may be on by default.
Andrew Bartlett please review this change carefully.
Jeremy.
(This used to be commit d1caef8663)
2007-10-10 11:05:20 -05:00
Jeremy Allison
6d5757395a r11511: A classic "friday night check-in" :-). This moves much
of the Samba4 timezone handling code back into Samba3.
Gets rid of "kludge-gmt" and removes the effectiveness
of the parameter "time offset" (I can add this back
in very easily if needed) - it's no longer being
looked at. I'm hoping this will fix the problems people
have been having with DST transitions. I'll start comprehensive
testing tomorrow, but for now all modifications are done.
Splits time get/set functions into srv_XXX and cli_XXX
as they need to look at different timezone offsets.
Get rid of much of the "efficiency" cruft that was
added to Samba back in the day when the C library
timezone handling functions were slow.
Jeremy.
(This used to be commit 414303bc02)
2007-10-10 11:05:19 -05:00
Jeremy Allison
c9effb004c r11451: Fix -O1 "might be using uninitialized" errors.
Jeremy.
(This used to be commit cab76c3c33)
2007-10-10 11:05:16 -05:00
Jeremy Allison
a656626d0f r11433: Fix for bug #3223 - ensure we're root before doing
any potential lib/smbldap.c calls.
Jeremy.
(This used to be commit 915cfb48f0)
2007-10-10 11:05:16 -05:00
Gerald Carter
e1ffd2d612 r11332: eventlog API uses NTSTATUS, not WERROR for return codes
(This used to be commit f5f40633bc)
2007-10-10 11:05:13 -05:00
Gerald Carter
90b1ca2597 r11292: Missed merge from Samba 2.2 many years ago....
Don't count open pipes in the num_files_open on a connection.
conn_idle_all() handles this by looking for open rpc handles
If there are no open handles, we can close the IPC$ share.
(This used to be commit 747fba4dbf)
2007-10-10 11:05:10 -05:00
Gerald Carter
cd310c19ce r11240: * fix invalid read reported by valgrind in the
spoolss backchannel connection by rewriting
  spoolss_connect_to_client().  Ensure that we
  save the cli_state* in the rpc_pipe_client struct.

* fix typo in debug message in cli_start_connection"
(This used to be commit 18400f9662)
2007-10-10 11:05:09 -05:00
Jim McDonough
1113cad9c0 r11236: Implement user rename for smbpasswd and ldap backends. Some cleanup on
tdb as well to make naming consistent.
(This used to be commit ee91eb9a39)
2007-10-10 11:05:08 -05:00
Gerald Carter
6fc9098dcc r11235: fix segfault in addprinter due to mixing talloc() and malloc()'d memory
(This used to be commit f6f78877b4)
2007-10-10 11:05:08 -05:00
Gerald Carter
39be2680e0 r11170: root free pass on eventlog open access check
(This used to be commit 4e3ff41e1e)
2007-10-10 11:05:05 -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
Gerald Carter
6f72169c7c r11135: should fix seg fault in addprinter code reported by Marcin. Allocate memory in convert_printer_info() if necessary
(This used to be commit 7ada5da8e9)
2007-10-10 11:05:02 -05:00
Gerald Carter
5b52e4a0eb r11072: add routines for converting REG_MULTI_SZ to and from char**
(This used to be commit e858eed813)
2007-10-10 11:05:00 -05:00
Gerald Carter
1b91229435 r11069: make sure to zero memory when allocating a a REGVAL_CTR struct
(This used to be commit bfdcbb7572)
2007-10-10 11:05:00 -05:00
Gerald Carter
bb68761a50 r11060: merging new eventlog code from trunk
(This used to be commit 1bcf7e82ed)
2007-10-10 11:04:59 -05:00
Gerald Carter
b9ae4455fd r11054: patch from Brian Moran; fix error code return in _srv_net_name_validate()
(This used to be commit b4e78520cc)
2007-10-10 11:04:59 -05:00
Jim McDonough
254938c636 r10911: part of #2861: add rename support for usrmgr.exe when using tdbsam
This gets it working before replacing tdb with the samba4 version.
(This used to be commit 8210b0503a)
2007-10-10 11:04:56 -05:00
Gerald Carter
01a1e5cdb0 r10819: merging a couple of fixes from trunk
* only keep the registry,tdb file open when we have an open key handle
* tpot's setup.py fix
* removing files that no longer exist in trunk and copying some
  that were missing in 3.0
(This used to be commit 6c6bf6ca5f)
2007-10-10 11:04:54 -05:00
Jeremy Allison
c226b7d4be r10795: Fix code before decl error.
Jeremy.
(This used to be commit 30bd894ee6)
2007-10-10 11:04:54 -05:00
Jeremy Allison
e127501d45 r10792: Fix the "schannel not stored across client disconnects" problem.
Based on the Samba4 solution - stores data in
$samba/private/schannel_store.tdb.
This tdb is not left open but open and closed on demand.
Jeremy.
(This used to be commit a6d8a4b1ff)
2007-10-10 11:04:54 -05:00
Gerald Carter
0bf72b6e33 r10781: merging eventlog and svcctl code from trunk
(This used to be commit f10aa9fb84)
2007-10-10 11:04:53 -05:00
Jeremy Allison
2237bc6a42 r10724: Got a little ahead of myself...
Jeremy.
(This used to be commit 86ffef8162)
2007-10-10 11:04:51 -05:00
Jeremy Allison
ac34076306 r10722: Remove unused BOOL in struct dcinfo.
Ensure that the mach_acct and remote machine entries are
set correctly in struct dcinfo - we'll need this as a key
for a persistent schannel state later.
Jeremy.
(This used to be commit 47269b5c71)
2007-10-10 11:04:51 -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
1896d77fe5 r10585: variation of fix in trunk for root-free-pass in registry access checks
(This used to be commit b41f997a2a)
2007-10-10 11:04:47 -05:00
Jeremy Allison
c2e5ce1501 r10269: Server-side fix for creds change - revert jcmd's change.
Jeremy.
(This used to be commit e1c9813d63)
2007-10-10 11:03:40 -05:00
Gerald Carter
fbcaef3bf6 r10264: reverse order of 'root free pass' checks in service and registry access_checks()
(This used to be commit 35b338a4fc)
2007-10-10 11:03:39 -05:00