summaryrefslogtreecommitdiff
path: root/source3/smbd
AgeCommit message (Collapse)AuthorFilesLines
2011-06-24Fix bug #8254 - "acl check permissions = no" does not work in all casesJeremy Allison2-2/+16
Move lp_acl_check_permissions() into can_delete_file_in_directory() where it makes sense. Remove ACL check when requesting DELETE_ACCESS when lp_acl_check_permissions is false. Thanks to John Janosik @ IBM for noticing this. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Jun 24 01:18:11 CEST 2011 on sn-devel-104
2011-06-23s3-param Remove 'announce version' parameterAndrew Bartlett1-2/+2
The only users I can find of this on the internet involve confused users, and our own documentation recommends never setting this. Don't confuse our users any longer. Andrew Bartlett
2011-06-21s3-build: Provide a run-time shim to work around duplicate symbolsAndrew Bartlett7-12/+42
The become_root() and similar 'smbd' functions that are used widely in Samba libraries had 'dummy' copies in dummysmbd.c and dummyroot.c. These have been replaced by a runtime plugin mechanim, which ensures that standlone binaries still do nothing, while in smbd the correct function is used. This avoids having these as duplicate symbols in the smbd binary, which can cause unpredictable behaviour. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-20tdb_compat: Higher level API fixes.Rusty Russell1-1/+1
My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_compat: use tdb_open_compat.Rusty Russell1-0/+5
This is a helper for the common case of opening a tdb with a logging function, but it doesn't do all the work, since TDB1 and TDB2's log functions are different types. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20ldb: replace 'struct TDB_DATA' with 'TDB_DATA'Rusty Russell2-1/+6
The typedef is TDB2 compatible, the struct isn't. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_traverse/tdb_traverse_read: check returns for negative, not -1.Rusty Russell2-2/+2
TDB2 returns a negative error number on failure. This is compatible if we always check for < 0 instead of == -1. Also, there's no tdb_traverse_read in TDB2: we don't try to make traverse reliable any more, so there are no write locks anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20tdb_compat.h: divert every tdb build and includes to tdb_compatRusty Russell2-2/+2
We change all the headers and wscript files to use tdb_compat; this means we have one place to decide whether to use TDB1 or TDB2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20source3/smdb/files.c: file_name_hash to use Jenkins hash from CCAN.Rusty Russell1-3/+2
Rather than tdb's internal one.
2011-06-19s3: Fix Coverity ID 2582: FORWARD_NULLVolker Lendecke1-0/+5
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Jun 19 20:46:43 CEST 2011 on sn-devel-104
2011-06-14s3: Fix connecting to ctdb as non-rootVolker Lendecke1-0/+7
This is at least one instance which I could identify Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Jun 14 19:06:39 CEST 2011 on sn-devel-104
2011-06-14s3: Fix count_current_connectionsVolker Lendecke1-2/+4
"False" is not really a valid return value for "int"..
2011-06-14s3:smbd/quotas: add #include "system/filesys.h" (bug #8224)Stefan Metzmacher1-0/+1
This should fix the build on FreeBSD metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Jun 14 09:38:49 CEST 2011 on sn-devel-104
2011-06-09s3-param Remove special case for global_myname(), rename to lp_netbios_name()Andrew Bartlett7-13/+13
There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett
2011-06-09lib/util Bring procid_str() into lib/util as server_id_string()Andrew Bartlett2-6/+6
This is needed for OpenChange, which prints Samba struct server_id values in debug messages. Andrew Bartlett
2011-06-09s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()Andrew Bartlett2-2/+2
Using the standard macro makes it easier to move code into common, as TALLOC_MEMDUP isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()Andrew Bartlett3-3/+3
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett14-25/+25
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_P() to talloc()Andrew Bartlett10-14/+14
Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett7-15/+15
Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
2011-06-09s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()Andrew Bartlett9-14/+14
Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett
2011-06-09Ensure when creating a directory, if we make any changes due to inheritance ↵Jeremy Allison1-0/+12
parameters, we update the stat returned. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Jun 9 00:46:39 CEST 2011 on sn-devel-104
2011-06-08Part 4 of bugfix for #8211 - "inherit owner = yes" doesn't interact ↵Jeremy Allison1-3/+2
correctly with "inherit permissions = yes" and POSIX ACLs We don't need to check mode bits as well as dev/ino to ensure we're in the same place.
2011-06-08Part 3 of bugfix for #8211 - "inherit owner = yes" doesn't interact ↵Jeremy Allison1-17/+43
correctly with "inherit permissions = yes" and POSIX ACLs When changing ownership on a new file make sure we must have a valid stat struct before making the inheritance calls (as they may look at it), and if we make changes we must have a valid stat struct after them. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Jun 8 03:07:04 CEST 2011 on sn-devel-104
2011-06-07Part 2 of bugfix for #8211 - "inherit owner = yes" doesn't interact ↵Jeremy Allison1-0/+2
correctly with "inherit permissions = yes" and POSIX ACLs When changing ownership on a new file make sure we also change the returned stat struct to have the correct uid.
2011-06-07Part 1 of bugfix for #8211 - "inherit owner = yes" doesn't interact ↵Jeremy Allison1-0/+2
correctly with "inherit permissions = yes" and POSIX ACLs When changing ownership on a new directory make sure we also change the returned stat struct to have the correct uid.
2011-06-06lib/util use modules_path(), data_path() and shlib_ext() from source3Andrew Bartlett1-1/+1
This brings these helpful utility functions in common, as they are not based on either loadparm system. (The 'modules dir' parameter from Samba4 will shortly be removed, so there is no loss in functionality) Andrew Bartlett
2011-06-01release_ip() is only used with CLUSTER_SUPPORT.Jeremy Allison1-1/+1
2011-06-01Move fd_close on error path to be identical to all other error paths.Jeremy Allison1-2/+1
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Jun 1 22:30:03 CEST 2011 on sn-devel-104
2011-06-01TALLOC_FREE already checks for null.Jeremy Allison1-3/+1
2011-06-01Fix bug #8175 - smbd deadlock.Jeremy Allison1-27/+71
Force the open operation (which is the expensive one anyway) to acquire and release locks in a way compatible with the more common do_lock check. Jeremy.
2011-06-01lib/util/time.c: timeval_current_ofs_usecRusty Russell1-1/+1
Several places want "microseconds from current time", and several were simply handing "usecs" values which could be over a million. Using a helper to do this is safer and more readable. I didn't replace any obviously correct callers (ie. constants). I also renamed wait_nsec in source3/lib/util_sock.c; it's actually microseconds not nanoseconds (introduced with this code in Volker's 19b783cc Async wrapper for open_socket_out_send/recv). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01lib/util/time.c: timeval_current_ofs_msecRusty Russell2-5/+2
Several places want "milliseconds from current time", and several were simply doing "msec * 1000" which can (and does in one place) result in a usec value over 1 a million. Using a helper to do this is safer and more readable. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01s3-param prepare for some lp_ functions to return constAndrew Bartlett1-1/+1
2011-06-01Remove the char * argument from the SMB_VFS_GETWD() call. Now alwaysJeremy Allison1-8/+9
returns malloc'ed memory. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Jun 1 04:06:12 CEST 2011 on sn-devel-104
2011-05-31struct make "struct shadow_copy_data" its own talloc contextVolker Lendecke1-16/+5
2011-05-31s3: Remove SHADOW_COPY_DATA typedefVolker Lendecke2-3/+4
2011-05-31s3: Support shadow copy display over SMB2Volker Lendecke1-0/+121
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue May 31 12:53:10 CEST 2011 on sn-devel-104
2011-05-31s3-smbd Fix conn_msg.c: Cannot return in a void functionAndrew Bartlett1-1/+1
2011-05-31s3:smbd/proto.h: add _SMBD_PROTO_H_ guardMichael Adam1-0/+5
2011-05-31s3:smbd/proto.h: add GPL/Copyright headerMichael Adam1-0/+44
2011-05-31s3-globals Remove smbd_event_context() (use server_event_context())Andrew Bartlett19-61/+56
This has been a wrapper around server_event_context() for some time now, and removing this from dummmysmbd.c assists with library dependencies. Andrew Bartlett
2011-05-31s3-param split service.c into param and smbd componentsAndrew Bartlett1-226/+0
The dependency chain of find_service can't be satisfied sensibly outside smbd, so don't include this in the main 'param' subsystem. Also remove the duplicate find_service() and conn_snum_used() from dummysmbd.c: The WAF build does not need these dummies any more, but file. Andrew Bartlett
2011-05-31s3-smbd Split conn.c into 3 filesAndrew Bartlett5-232/+292
The idea with this split is to make it easier to handle dependencies, avoiding having the loadparm code depend on the global server variables, without resorting to dummy functions and linker tricks. conn_clear_vuid_cache() is brought in from uid.c to make it static Andrew Bartlett
2011-05-31s3-smbd provide struct smbd_server_connection * to conn_snum_usedAndrew Bartlett6-10/+15
This provides the 'sconn' parameter to this key functions, that is currently duplicated in dummysmbd.c, which causes duplicate symbol issues in the waf build. This has natrually caused a number of consequential changes across the codebase, includning not passing a messaging context into initial reload_services(): This causes problems because the global smbd_server_connection isn't yet set up, as there isn't a connection here, just the initial process. Andrew Bartlett
2011-05-30s3: Safely mark our sconn as smb2 if we have that protocolVolker Lendecke1-0/+2
Otherwise smbd will crash at an unclean exit. Without this conn_close_all will do a close_cnum() on all connection_struct's. In smb2, those are talloc children of the smbd_smb2_tcon's. sconn is talloc_free'ed after the conn_close_all, but the smbd_smb2_tcon destructor will still reference tcon->compat_conn, referencing then free'ed (and null'ed out) memory. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon May 30 22:49:53 CEST 2011 on sn-devel-104
2011-05-30s3: Add ioctl code to smbd_smb2_ioctl_send debugVolker Lendecke1-2/+3
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon May 30 12:47:27 CEST 2011 on sn-devel-104
2011-05-29s3: Reply correctly to a bad nbt session requestVolker Lendecke1-1/+15
2011-05-27Fix bug #6911 - Kerberos authentication from vista to samba fails when ↵Jeremy Allison1-3/+25
security blob size is greater than 16 kB We were not correctly checking the output of asn1_start_tag(). asn1_start_tag() returns -1 and sets data->has_error if the remaining blob size is too short to contain the tag length. We were checking data->has_error and returning NT_STATUS_OK (to allow the second asn.1 parse to fail in that case). We should not be checking data->has_error in this case, but falling through to the code that already checks the length. Thanks to Jim for reproducing this for me. We don't get bitten by this as we announce a max buffer size of 16k, greater than Windows's 4k, which means that most krb5 spnego packets already fit. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri May 27 02:57:27 CEST 2011 on sn-devel-104
2011-05-20Fix bug 8133 - strange behavior for the file (whose filename first character ↵Jeremy Allison1-2/+3
is period ) in SMB2 case. When doing SMB2 renames, we need to match all filetypes (no attributes field in the SMB2 call). By default a file starting with a period is returned as FILE_ATTRIBUTE_HIDDEN in Samba. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri May 20 19:26:04 CEST 2011 on sn-devel-104