1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

31182 Commits

Author SHA1 Message Date
Jeremy Allison
df13b1303a Fix bug #7154 - mangling method = hash can crash storing a name not containing a '.'
Fix use of uninitialized variable. This can lead to crashes if
mangling = hash processes names with no '.'.

Jeremy.
2010-02-18 11:22:44 -08:00
Günther Deschner
b3c2b2260a s3-spoolss: Fix _spoolss_EnumPrinters servername handling.
Guenther
2010-02-18 12:40:36 +01:00
Günther Deschner
b6f58e25b5 s3-selftest: fix return code for modprinter.pl -a.
Background is: the SetPrinter level 2 calls "addprinter command" an fails if a
share already existed (and the addprinter command returned a non-0 return code).
Removing the non-0 return code is fine, as in AddPrinter{Ex}, we have checks to
see if a share already exists before calling out the addprinter command.

Maybe one day, we need to have a "changeprinter command"...

Guenther
2010-02-18 11:23:59 +01:00
Günther Deschner
867daf6e0a s3-selftest: finally enable RPC-SPOOLSS-PRINTER against Samba 3.
Guenther
2010-02-18 02:27:08 +01:00
Günther Deschner
34ad5da5cd s3-selftest: include addprinter/deleteprinter command.
Guenther
2010-02-18 02:27:04 +01:00
Günther Deschner
43e3d8f51d s3-spoolss: fix return code of spoolss_DeletePrinter.
When the printer has been removed by the "deleteprinter command", we need to
check if it is still there and then fail, not fail if we successfully removed
it (found by RPC-SPOOLSS-PRINTER).

Guenther
2010-02-18 02:19:59 +01:00
Günther Deschner
8ce66fba03 s3-spoolss: in spoolss_EnumPrinters r->in.server is a *unique* pointer!
Guenther
2010-02-18 02:19:50 +01:00
Günther Deschner
2d2db2a822 s3-spoolss: more AddPrinter{Ex} checks.
Windows will allow to add a non-shared printer that is returned by EnumPrinters.
Samba has no notion of non-shared local printers yet, so just make sure to
behave like we do elsewhere: a printer autoloaded by samba or added to samba is
shared.

Guenther
2010-02-18 02:19:42 +01:00
Günther Deschner
5cff7e1692 s3-spoolss: add some printer info validation for AddPrinter calls.
Guenther
2010-02-18 02:19:33 +01:00
Günther Deschner
6cf10cc102 s3-modules: fix get_acl_blob in the acl_tdb VFS module.
Shuttle-reviewed by jra :)

Guenther
2010-02-18 02:17:50 +01:00
Günther Deschner
d5e30dec8b s3-rpcclient: fix uninitialized variable in wkssvc_enumerateusers.
Guenther
2010-02-18 01:47:57 +01:00
Jeremy Allison
7b4387f765 Fix bug #7146 - Samba miss-parses authenticated RPC packets.
Parts of the Samba RPC client and server code misinterpret authenticated
packets.

DCE authenticated packets actually look like this :

+--------------------------+
|header                    |
| ... frag_len (packet len)|
| ... auth_len             |
+--------------------------+
|                          |
| Data payload             |
...                     ....
|                          |
+--------------------------+
|                          |
| auth_pad_len bytes       |
+--------------------------+
|                          |
| Auth footer              |
| auth_pad_len value       |
+--------------------------+
|                          |
| Auth payload             |
| (auth_len bytes long)    |
+--------------------------+

That's right. The pad bytes come *before* the footer specifying how many pad
bytes there are. In order to read this you must seek to the end of the packet
and subtract the auth_len (in the packet header) and the auth footer length (a
known value).

The client and server code gets this right (mostly) in 3.0.x -> 3.4.x so long
as the pad alignment is on an 8 byte boundary (there are some special cases in
the code for this).

Tridge discovered there are some (DRS replication) cases where on 64-bit
machines where the pad alignment is on a 16-byte boundary. This breaks the
existing S3 hand-optimized rpc code.

This patch removes all the special cases in client and server code, and allows
the pad alignment for generated packets to be specified by changing a constant
in include/local.h (this doesn't affect received packets, the new code always
handles them correctly whatever pad alignment is used).

This patch also works correctly with rpcclient using sign+seal from
the 3.4.x and 3.3.x builds (testing with 3.0.x and 3.2.x to follow)
so even as a server it should still work with older libsmbclient and
winbindd code.

Jeremy
2010-02-17 15:27:59 -08:00
Jeremy Allison
5564e7147f Fix bug #6557 - Do not work VFS full_audit
Re-arrange the operations order so SMB_VFS_CONNECT is done
first as root (to allow modules to correctly initialize themselves).

Reviewed modules to check if they needed CONNECT invoked as
a user (which we previously did) and it turns out any of them
that cared needed root permissions anyway.

Jeremy.
2010-02-17 11:13:35 -08:00
Lars Müller
94074eb2e6 s3: go straight to winbindd_dual_pam_auth() in case of !NT_STATUS_OK
At the formerly used process_result statement we have alone one
NT_STATUS_IS_OK() which never could be hit in our case as we only go here
if NT_STATUS_EQUAL is not ok.
2010-02-17 19:00:01 +01:00
Lars Müller
bc0b152889 s3: let the pam_winbind po files reference the correct location 2010-02-17 18:46:35 +01:00
Volker Lendecke
8aef63d243 s3: Fix bug 7139
To provide the user with the same SID when doing Kerberos logins, attempt to do
a make_server_info_sam instead of a make_server_info_pw.
2010-02-17 11:32:30 +01:00
Simo Sorce
d14c3756e8 s3:rpc streamline memory handling 2010-02-16 19:15:56 -05:00
Volker Lendecke
f8b246e44c s3: Fix timeout calculation if g_lock_lock is given a timeout < 60s
Detected while showing this code to obnox :-)
2010-02-16 15:28:42 +01:00
Volker Lendecke
83542d973c s3: Slightly increase parallelism in g_lock
There's no need to still hold the g_lock tdb-level lock while telling the
waiters to retry
2010-02-16 13:21:10 +01:00
Volker Lendecke
be919d6fae s3: Avoid starving locks when many processes die at the same time
In g_lock_unlock we have a little race between the process_exists and
messaging_send call: We only send to 5 waiters now, they all might have died
between us checking their existence and sending the message. This change makes
g_lock_lock retry at least once every minute.
2010-02-16 13:21:10 +01:00
Volker Lendecke
725b3654f8 s3: Avoid a thundering herd in g_lock_unlock
Only notify the first 5 pending lock waiters. This avoids a thundering herd
problem that is really nasty in a cluster. It also makes acquiring a lock a bit
more FIFO, lock waiters are added to the end of the array.
2010-02-16 13:21:10 +01:00
Volker Lendecke
07978bd175 s3: Optimize g_lock_lock for a heavily contended case
Only check the existence of the lock owner in g_lock_parse, check the rest of
the records only when we got the lock successfully. This reduces the load on
process_exists which can involve a network roundtrip in the clustered case.
2010-02-16 13:21:10 +01:00
Volker Lendecke
f3bdb163f4 s3: Fix handling of processes that died in g_lock
g_lock_parse might have thrown away entries from the locks array because the
processes were not around anymore. Don't store the orphaned entries.
2010-02-16 13:21:10 +01:00
Volker Lendecke
bac235dd30 s3: Fix a typo 2010-02-15 16:36:20 +01:00
Günther Deschner
ddbda92f87 spoolss: disable GetPrinterDriver level 101 (as called by XP).
We still dont get the marshalling right, disable and XP will just fall back to
level 6.

Guenther
2010-02-15 11:17:29 +01:00
Holger Hetterich
6ec6fa0ac4 s3: eventlogadm.c: add -s option to use alternative config file.
Update the manpage accordingly.
2010-02-15 08:31:44 +01:00
Peter Watkins
d3a42946cc s3: Fix initgroups return check
A return code of 1 from initgroups() is OK since apparently it means
the gid has already been set. The man page doesn't mention this.
2010-02-14 12:45:04 +01:00
Andrew Tridgell
862a17e9ba s3: last part of TYPESAFE_QSORT() conversion
convert smbcacls, sharesec and web/
2010-02-14 18:44:21 +11:00
Andrew Tridgell
3f0898a9f5 s3-smbd: convert lanman and notify code to TYPESAFE_QSORT() 2010-02-14 18:44:21 +11:00
Andrew Tridgell
bc5d203eeb s3-rpc: convert wkssvc to use TYPESAFE_QSORT() 2010-02-14 18:44:21 +11:00
Andrew Tridgell
93a3359729 s3-locking: convert brlock to TYPESAFE_QSORT() 2010-02-14 18:44:21 +11:00
Andrew Tridgell
7cff685c7e s3: convert registry and printing code to TYPESAFE_QSORT() 2010-02-14 18:44:21 +11:00
Andrew Tridgell
c804102d0f s3-nmbd: note TODO item for qsort
This uses another char* cast hack. Left alone for now.
2010-02-14 18:44:21 +11:00
Andrew Tridgell
95e26884a8 s3-vfs: use TYPESAFE_QSORT() in s3 VFS modules 2010-02-14 18:44:20 +11:00
Andrew Tridgell
8120bc2ba9 s3-lib: use TYPESAFE_QSORT() in remaining s3 library code
the sort_query_replies() in nmblib.c is a TODO. It uses a hack that
treats a char* as a structure. I've left that one alone for now.
2010-02-14 18:44:20 +11:00
Andrew Tridgell
7347ca359d s3-libsmb: use TYPESAFE_QSORT() in namequery code
This one was a bit trickier. I'd appreciate it if someone else can
look over this.
2010-02-14 18:44:20 +11:00
Andrew Tridgell
007f24f29d s3-lib: use TYPESAFE_QSORT() in s3 interfaces code 2010-02-14 18:44:20 +11:00
Andrew Tridgell
cebbc9a6f1 s3-includes: enable TYPESAFE_QSORT() in s3 2010-02-14 18:44:20 +11:00
Volker Lendecke
b00d223f87 s3: Fix Coverity ID 629: DEADCODE
We have already returned if (argc < 1) above
2010-02-13 17:47:43 +01:00
Volker Lendecke
2ea2d2a81e s3: Fix bug 5198 -- parse chfn(1)-change gecos field 2010-02-13 17:23:43 +01:00
Volker Lendecke
271a4c60db s3: Fix typo found by jhell <jhell@DataIX.net> 2010-02-13 16:39:08 +01:00
Kai Blin
b99d9f86e4 libwbclient: Separate out the async functions 2010-02-13 14:30:36 +01:00
Volker Lendecke
613777e6dc s3: Remove unused comparison fn from "struct sorted_tree" 2010-02-13 13:26:11 +01:00
Volker Lendecke
3ab78e31f0 s3: Make adt_tree data definitions private to adt_tree.c 2010-02-13 13:26:11 +01:00
Volker Lendecke
2260732084 s3: SORTED_TREE -> struct sorted_tree 2010-02-13 13:26:11 +01:00
Volker Lendecke
ceebed6ce1 s3: TREE_NODE -> struct tree_node 2010-02-13 13:26:10 +01:00
Volker Lendecke
65b26ba985 s3: Fix some nonempty blank lines 2010-02-13 13:26:10 +01:00
Volker Lendecke
ece99c763a s3: Fix a C++ warning 2010-02-13 13:24:59 +01:00
Jeremy Allison
9252df53d9 Use sec_initial_uid() in the places where being root doesn't matter,
and 0 in the places where it does.

Jeremy
2010-02-12 23:18:53 -08:00
Jeremy Allison
d46d7717c7 Simplify the logic in make_connection_snum(), and make it match Windows behavior.
Cause all exit paths to go through one place, where all cleanup is
done. change_to_root_user() for pathname operations that should succeed if
the path exists, even if the connecting user has no access.

For example, a share can now be defined with a path of /root/only/access
(where /root/only/access is a directory path with all components only
accessible to root e.g. root owned, permissions 700 on every component).
Non-root users will now correctly connect, but get ACCESS_DENIED on
all activities (which matches Windows behavior). Previously, non-root
users would get NT_STATUS_BAD_NETWORK_NAME on doing a TConX to this
share, even though it's a perfectly valid share path (just not accessible
to them).

This change was inspired by the research I did for bug #7126, which
was reported by bepi@adria.it.

As this is a change in a core function, I'm proposing to leave
this only in master for 3.6.0, not back-port to any existing releases.
This should give us enough time to decide if this is the way we want this to
behave (as Windows) or if we prefer the previous behavior.

Jeremy.
2010-02-12 22:45:37 -08:00