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

5894 Commits

Author SHA1 Message Date
Andrew Tridgell
15e84a9a09 charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*()
we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104
2011-03-24 01:47:26 +01:00
Günther Deschner
6c8b820b9b s3-globals: silence build warning in smbd_messaging_context().
Guenther
2011-03-23 19:24:35 +01:00
Andrew Bartlett
d73db405f7 s3-safe_string: Add checked_strlcpy()
This is strlcpy, just with an extra check of the parameters with
sizeof(), use only where that works.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Mar 23 03:39:35 CET 2011 on sn-devel-104
2011-03-23 03:39:35 +01:00
Andrew Bartlett
1923b78209 s3-lib Remove the clobber_region() code.
This code wrote to the full buffer in fstrcpy(), pstrcpy() and other
fixed-length string manipulation functions.

The hope of this code was to find out at run time if we were mixing up
pstring and fstring etc, and to record where this came from.  It has a
runtime performance impact (particularly if compiled with
--enable-developer).

It is being removed because of the complexity it adds, and the
distinct lack of bugs that this complexity has been credited in
finding.

The macro-based compile-time checking of string sizes remains.

Andrew Bartlett
2011-03-23 12:49:39 +11:00
Andrew Tridgell
7aef9c3fe0 s3-config: say which config file we failed to open
saves having to strace it to work that out
2011-03-23 12:19:29 +11:00
Andrew Tridgell
580997ede0 fault: get fault.c ready for use by s4
this moves the s3 specific dumpcore code into source3/lib/dumpcore.c,
and uses a function pointer to setup which smb_panic call to use
2011-03-23 11:03:57 +11:00
Andrew Tridgell
c8297073db s3-fault: removed the cont_fn from fault_setup()
cont_fn() was supposed to be a way to continue after a seg fault. It
could never be called however, as smb_panic() from fault_report()
could never return, as dump_core() never returns at the end of
smb_panic()

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Mar 22 05:07:58 CET 2011 on sn-devel-104
2011-03-22 05:07:58 +01:00
Stefan Metzmacher
f0ec69b535 s3:smbd: access checks should not depend on share mode flags
metze
2011-03-21 22:35:19 +01:00
Stefan Metzmacher
daddccb514 s3:smbd: remove uses of "./" in unlink_internals()
Commit 78b931ce6c tried to do that,
but didn't have any effect.

metze
2011-03-19 10:10:25 +01:00
Jeremy Allison
89b6af0982 SMB2 renames return SHARING_VIOLATION if there is any existing oplock on a file.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Mar 18 23:39:49 CET 2011 on sn-devel-104
2011-03-18 23:39:49 +01:00
Jeremy Allison
066fecd315 The searches struct is still being used and idled in SMB2 - move it to the global
section until we decide if we want to idle SMB2 directory handles.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Mar 18 01:13:53 CET 2011 on sn-devel-104
2011-03-18 01:13:53 +01:00
Jeremy Allison
4c77d620e6 Fix crash bug on smbd shutdown when using FOPENDIR() found by Volker.
The key was allowing the dptr_idle code to be triggered. We were
closing the dirp->dir handle without updating the underlying fd
in the open fsp.

Jeremy.
2011-03-17 15:55:15 -07:00
Volker Lendecke
9bc10bde14 s3: Expose num_opens via api_RNetSessionEnum
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Mar 17 22:05:10 CET 2011 on sn-devel-104
2011-03-17 22:05:10 +01:00
Günther Deschner
3aa9d3005a s3-build: only include asn1 headers where actually needed.
Guenther
2011-03-16 23:46:18 +01:00
Volker Lendecke
fb47b7fd67 s3: Fix Coverity ID 2140, DEADCODE
This routine was never executed after f0dcc90f because "netname" was always
NULL.

Jeremy, please check!
2011-03-16 22:07:24 +01:00
Günther Deschner
1ce4d2d83a s3-msdfs: avoid global inclusion of msdfs.h.
Guenther
2011-03-16 16:56:46 +01:00
Günther Deschner
6c8d802391 s3-libsmb: move smb encryption structs into own header.
Guenther
2011-03-16 10:11:16 +01:00
Andreas Schneider
b181cd8465 s3-smbd: Increase debug level von context messages. 2011-03-09 09:28:42 +01:00
Andreas Schneider
bd66fc81b6 s3-rpc_server: Start the Endpoint Mapper Dameon if enabled.
Endpoint Mapper is still disabled by default!

Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-08 11:41:29 +01:00
David Disseldorp
61bf4699f0 s3-printing: follow force user/group for driver IO
Configuring force user/group settings for the print$ share currently has
unexpected results, this is explained by how the driver upload/add
process takes place. Consider the following example:

[print$]
        path = /print-drv
        write list = $DRIVER_UPLOAD_USER
        force group = ntadmin

- the client connects to the [print$] share and uploads all driver
  files to the /print-drv/W32X86 directory.

- This is permitted, as /print-drv/W32X86 is owned by group ntadmin, and
  the "force group = ntadmin" takes effect for the [print$] session.

- Once all files are uploaded, the client connects to the [ipc$]
  share and issues an AddPrinterDriverEx spoolss request.

- In handling this request move_driver_to_download_area() is called,
  which attempts to create the directory /print-drv/W32X86/3

- The create directory fails, as it is done as the user connected to
  the [ipc$] share which does not have permission to write to the driver
  directory. The [print$] "force group = ntadmin" has no effect.

This is a regression from previous behaviour prior to the commit:
783ab04 Convert move_driver_to_download_area to use create_conn_struct.

https://bugzilla.samba.org/show_bug.cgi?id=7921
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-04 15:46:14 +01:00
Volker Lendecke
cf7dac6fbc s3: Pass smb_filename through the set_offline vfs op 2011-03-02 18:39:21 +01:00
Volker Lendecke
c9d1e16c2c s3: Pass smb_filename through the is_offline vfs op 2011-03-02 18:39:21 +01:00
Günther Deschner
ea29261186 s3-sessionid: avoid global include of sessionid.h
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar  2 12:58:12 CET 2011 on sn-devel-104
2011-03-02 12:58:12 +01:00
Günther Deschner
28acf360be s3-lanman: talk to srvsvc dcerpc server in api_RNetSessionEnum().
Guenther
2011-03-02 12:12:32 +01:00
Günther Deschner
8643683dd8 s3-server_id: only include server_id where needed.
Guenther
2011-03-02 12:12:31 +01:00
David Disseldorp
016a8d214a s3-printing: vfs_connect prior to driver/dfs IO
samba3.posix_s3.rpc.spoolss.driver fails with the xattr_tdb vfs module
loaded as a part of make test. The (now checked) create_directory() call
in move_driver_to_download_area() fails, uncovering another bug in the
printer driver upload code path.

move_driver_to_download_area() creates a new conn_struct for
manipulating files in [print$]. The VFS layer is plumbed through with
the call to create_conn_struct(), however SMB_VFS_CONNECT() is never
called. Many vfs modules expect state stored at connect time with
SMB_VFS_HANDLE_SET_DATA() to be available on any IO operation and fail
if this is not the case.

This fix adds a call to SMB_VFS_CONNECT() in create_conn_struct() prior
to IO.

https://bugzilla.samba.org/show_bug.cgi?id=7976

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Mar  2 01:16:30 CET 2011 on sn-devel-104
2011-03-02 01:16:30 +01:00
Gregor Beck
9f6193724e s3: remove superfluous debug messages from msg_idmap
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Mar  2 00:30:41 CET 2011 on sn-devel-104
2011-03-02 00:30:40 +01:00
Andrew Bartlett
04f5ef83b9 s3-auth struct security_unix_token replaces UNIX_USER_TOKEN 2011-03-01 06:29:04 +01:00
Jeremy Allison
8238357ac7 Fix warning introduced by changing the size of UNIX_USER_TOKEN->ngroups from size_t to uint32_t. 2011-02-28 21:58:20 +01:00
Andreas Schneider
eece80e62c s3-smbd: Pass tevent context to messaging functions.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Feb 28 19:00:08 CET 2011 on sn-devel-104
2011-02-28 19:00:08 +01:00
Volker Lendecke
0f082de561 s3: Eliminate sys_select from fd_is_readable 2011-02-28 16:40:19 +01:00
Volker Lendecke
9758afd47e s3: Use poll in smbd 2011-02-28 16:40:19 +01:00
Michael Adam
9bfbf652b0 s3:msg_idmap: The solaris cc compiler does not like unnamed unions as struct members - fix the build
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Feb 28 16:39:15 CET 2011 on sn-devel-104
2011-02-28 16:39:15 +01:00
Gregor Beck
58081884f7 s3: smbcontrol to notify smbd about idmap changes
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Feb 28 14:07:23 CET 2011 on sn-devel-104
2011-02-28 14:07:23 +01:00
Volker Lendecke
32731db56f s3: Fix some nonempty blank lines 2011-02-27 19:27:44 +01:00
Jeremy Allison
c8a242d9fc dirfd doesn't exist in some platforms.
Hack that should get the buildfarm back to green.
Ensure dirfd() needs to be defined before we properly return fdopendir.
This will do until we get a proper dirfd() defined in libreplace.

From http://www.gnu.org/software/hello/manual/gnulib/dirfd.html

This function is missing on some platforms: AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 10, mingw.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 26 04:19:55 CET 2011 on sn-devel-104
2011-02-26 04:19:55 +01:00
Justin Maggard
6141b6a49f Detect Mac OS X as a separate client type. 2011-02-25 01:57:04 +01:00
Jeremy Allison
f92fad101a Ensure we don't return an incorrect access mask.
From the Microsoft test suite @ Connectathon:

Test Case: TestSuite_ScenarioNo009GrantedAccessTestS0
    File created with access = 0x7 (Read, Write, Delete)
    Query Info on file returns 0x87 (Read, Write, Delete, Read Attributes)

Jeremy.
2011-02-25 01:57:04 +01:00
Jeremy Allison
ed3ae87830 Implement the SMB2 close flag SMB2_CLOSE_FLAGS_FULL_INFORMATION (and move definition to correct place).
Thanks to Nick Meier @ Microsoft for finding this @ Connectathon.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Feb 25 00:40:52 CET 2011 on sn-devel-104
2011-02-25 00:40:52 +01:00
Jeremy Allison
2d0727bc49 Batch oplocks conflict with exclusive as well as themselves.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Feb 24 21:44:50 CET 2011 on sn-devel-104
2011-02-24 21:44:50 +01:00
Jeremy Allison
9e93dacfc6 Remember to free the second temporary string.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Feb 24 04:17:49 CET 2011 on sn-devel-104
2011-02-24 04:17:49 +01:00
Jeremy Allison
916e82823b Fix bug 7950 - Samba 3.5.x fails BASE-CREATEX_SHAREMODES_DIR smbtorture4 test
We need to revalidate the pathname once re-constructed from a root fsp.

Jeremy.
2011-02-23 18:24:41 -08:00
Jeremy Allison
7464793c9d Fix bug found against the new Mac client @ Connectathon. Mac clients
don't open with FILE_WRITE_ATTRIBUTES when just doing a write, so updating
the write time on close fails as smb_set_file_time() now (correctly) checks
for FILE_WRITE_ATTRIBUTES in the access_mask before allowing client time
update. This is an internal time update being done on a close, not a handle-based
client request.
2011-02-23 02:17:21 +01:00
Günther Deschner
8225c0ad6c s3-printing: only include printing where really needed.
Guenther
2011-02-22 21:52:18 +01:00
Günther Deschner
5a0cf0c77e s3-printing: fix pcacp prototypes and includes.
Guenther
2011-02-22 21:52:18 +01:00
Günther Deschner
66e040ee0a s3-printing: isolate print notification prototypes better.
Guenther
2011-02-22 21:52:18 +01:00
Andrew Bartlett
2e69e89456 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly
named when added into 2001, and in good consistant practice, this has
extended all over the codebase in the years since.

The structure is also not ideal for it's current purpose.  Originally
intended to convey the results of the authentication modules, it
really describes all the essential attributes of a session.  This
rename will reduce the volume of a future patch to replaced these with
a struct auth_session_info, with auth_serversupplied_info confined to
the lower levels of the auth subsystem, and then eliminated.

(The new structure will be the output of create_local_token(), and the
change in struct definition will ensure that this is always run, populating
local groups and privileges).

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-02-22 16:20:10 +11:00
Andreas Schneider
fc46ea981f s3-rpc_server: Rename srv_rpc_register.c. 2011-02-21 23:00:02 +01:00
Andreas Schneider
116144a4d0 s3-rpc_server: Rename srv_rpc_register. 2011-02-21 23:00:02 +01:00
Andreas Schneider
184702a43d s3-rpc_server: Pass tevent_context to dcerpc endpoints. 2011-02-21 23:00:02 +01:00