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

443 Commits

Author SHA1 Message Date
Stefan Metzmacher
c50a03e4e2 s3:smbd: remove dirptr and dirpath from connection_struct
They're both only used in the context of a function,
so we can make them stack variables.

metze
2009-08-07 14:18:17 +02:00
Stefan Metzmacher
c54e6b19e3 s3:smbd: add a smbd_server_connection pointer to connection_struct
This can be NULL for faked connection structs used in the rpc server
or printing code.

metze
2009-08-07 14:18:14 +02:00
Christian Ambach
8b6ec5b82c do not log chdir with level 0 if reason is access denied
this changes the level of logs caused by users trying to access shares
or subdirectories for which they do not have access to in the ACL

this can fill up the samba log even with log level 0 and is more an
expected kind of logs that IMHO should not be logged with such a high
level.

All other errors while chdir() will still be logged with level 0

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2009-07-21 10:05:21 -07:00
Jeremy Allison
d57e67f9eb Revert this commit :
s3: Make smbd aware of permission change of usershare. Since usershare are relatively volatile and
non-previledge users must disconnect from smbd and reconnect to it to make share permission in effect.

For now. This is a feature request and I think we need
to design it a little differently so as not to touch
core change_to_user() code.

Jeremy.
2009-07-14 11:25:45 -07:00
Bo Yang
9ef6af73b3 s3: Make smbd aware of permission change of usershare. Since usershare are relatively volatile and non-previledge users must disconnect from smbd and reconnect to it to make share permission in effect. 2009-07-15 17:05:45 +08:00
Tim Prouty
e129384d7c s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTAT
This patch introduces two new temporary helper functions
vfs_stat_smb_fname and vfs_lstat_smb_fname.  They basically allowed me
to call the new smb_filename version of stat, while avoiding plumbing
it through callers that are still too inconvenient.  As the conversion
moves along, I will be able to remove callers of this, with the goal
being to remove all callers.

There was also a bug in create_synthetic_smb_fname_split (also a
temporary utility function) that caused it to incorrectly handle
filenames with ':'s in them when in posix mode.  This is now fixed.
2009-06-24 21:15:25 -07:00
Stefan Metzmacher
a02265cdc4 s3:smbd: make make_connection_snum() non static
metze
2009-06-03 17:54:38 +02:00
Stefan Metzmacher
c862018008 s3:smbd: move tcon specific globals to struct smbd_server_connection
metze
2009-06-03 17:54:38 +02:00
Stefan Metzmacher
75d03970b7 s3:smbd: move more session specific globals to struct smbd_server_connection
metze
2009-06-03 17:54:37 +02:00
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
This patch introduces

struct stat_ex {
        dev_t           st_ex_dev;
        ino_t           st_ex_ino;
        mode_t          st_ex_mode;
        nlink_t         st_ex_nlink;
        uid_t           st_ex_uid;
        gid_t           st_ex_gid;
        dev_t           st_ex_rdev;
        off_t           st_ex_size;
        struct timespec st_ex_atime;
        struct timespec st_ex_mtime;
        struct timespec st_ex_ctime;
        struct timespec st_ex_btime; /* birthtime */
        blksize_t       st_ex_blksize;
        blkcnt_t        st_ex_blocks;
};
typedef struct stat_ex SMB_STRUCT_STAT;

It is really large because due to the friendly libc headers playing macro
tricks with fields like st_ino, so I renamed them to st_ex_xxx.

Why this change? To support birthtime, we already have quite a few #ifdef's at
places where it does not really belong. With a stat struct that we control, we
can consolidate the nanosecond timestamps and the birthtime deep in the VFS
stat calls.

At this moment it is triggered by a request to support the birthtime field for
GPFS. GPFS does not extend the system level struct stat, but instead has a
separate call that gets us the additional information beyond posix. Without
being able to do that within the VFS stat calls, that support would have to be
scattered around the main smbd code.

It will very likely break all the onefs modules, but I think the changes will
be reasonably easy to do.
2009-05-26 17:48:23 +02:00
Volker Lendecke
796764d92b Increase debug level of "create_connection_server_info failed" message
I don't think we should unconditionally send every refused connection attempt
to a share to syslog, that's where all debug level 0 messages end up.
2009-05-04 12:41:54 +02:00
Michael Adam
077bcc1125 s3:smbd/service: switch load_registry_service/shares to use loadparm routines
instead of reading the registry directly with tdb and activating the
configure options by hand.

This eliminates the need for repeating checks done in loadparm.
For instance it disables registry shares without path in the server
as is the case with text based shares.

Michael
2009-04-29 02:20:19 +02:00
Stefan Metzmacher
c16c90a1cb s3:smbd: use new simplified snb_signing code in the server
We keep the seqnum/mid mapping in the smb_request structure.

This also moves one global variable into the
smbd_server_connection struct.

metze
2009-03-23 12:21:13 +01:00
Jeremy Allison
35f4ea221e Fix bug #6155 - "force group" is no longer working as expected.
We need to store the "force group" uid separately from the
conn->server_info token as we need to apply it separately also.
Volker PLEASE CHECK !
Jeremy.
2009-03-03 16:08:56 -08:00
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
Michael Adam
5318e73e93 smbd: prevent access to root filesystem when connecting with empty service name
This only applies to a setup with "registry shares = yes"

Michael
(cherry picked from commit 288fa94ac7)
(cherry picked from commit e85526b184)
2009-01-05 11:07:59 +01:00
Volker Lendecke
6f840dd678 Remove unused make_connection_with_chdir() 2008-11-24 11:39:03 +01:00
Volker Lendecke
a781b78417 Remove smb_np_struct 2008-10-13 20:59:33 +02:00
Volker Lendecke
3c516937e8 Fix a debug message
(This used to be commit 8dd94d448b)
2008-06-26 13:32:11 +02:00
Volker Lendecke
40f5eab5eb Wrap the unix token info in a unix_user_token in auth_serversupplied_info
No functional change, this is a preparation for more current_user ref removal
(This used to be commit dcaedf345e)
2008-06-19 18:51:37 +02:00
Jeremy Allison
ae51353107 Re-enable the evil "aio write behind" parameter.
Jeremy.
(This used to be commit 5d22ca00bc)
2008-05-26 21:13:05 -07:00
Volker Lendecke
50ab871813 Remove some references to get_current_username() and current_user_info
(This used to be commit 344d69f95e)
2008-05-25 11:43:57 +02:00
Volker Lendecke
320fadd8fc Remove the reference to current_user_info from share_access.c
This required to pass around the domain a bit
(This used to be commit 17b0db20d2)
2008-05-25 11:43:57 +02:00
Volker Lendecke
5bda9a8af0 Remove "user" from connection_struct
(This used to be commit 368454a27c)
2008-05-10 11:17:01 +02:00
Volker Lendecke
53a623d8a6 Remove the unix token info from connection_struct
(This used to be commit 2834dacc8d)
2008-05-10 11:17:01 +02:00
Volker Lendecke
776caa081b Replace nt_user_token with server_info in connection_struct
(This used to be commit a3738aef59)
2008-05-10 11:17:01 +02:00
Volker Lendecke
322896f8dd find_forced_group can directly change the token in server_info
Now that we have a token that is correctly set up with gids already, this saves
manual translation of the SIDs to GIDs.
(This used to be commit 6136a6d9d7)
2008-05-10 11:17:00 +02:00
Volker Lendecke
d2157f1342 Add an error return in find_forced_group()
(This used to be commit 93ce0705c1)
2008-05-10 11:17:00 +02:00
Volker Lendecke
39bd6a9595 Do not unnecessarily mess with the results in find_forced_group()
(This used to be commit 6d9860d09b)
2008-05-10 11:17:00 +02:00
Volker Lendecke
ddcea20947 Replace find_forced_user by a direct call to make_serverinfo_from_username
(This used to be commit 7991e6764b)
2008-05-10 11:17:00 +02:00
Volker Lendecke
ca25800287 Simplify make_connection_snum: Copy connection_struct info from server_info
(This used to be commit 5aa3cdf355)
2008-05-10 11:17:00 +02:00
Volker Lendecke
90995202c0 Add "server_info" to connection_struct
This will replace all the user identity stuff in connection_struct, for now it
is just a source where the other fields in connection_struct are filled from.
(This used to be commit 0f53f9e7db)
2008-05-10 11:17:00 +02:00
Volker Lendecke
f93e232535 Remove unused "force_group" from connection_struct
(This used to be commit 03944f8d89)
2008-05-10 11:17:00 +02:00
Volker Lendecke
39a318aee4 "status" -> "pstatus" in make_connection_snum
(This used to be commit 3ce395e61e)
2008-05-10 11:17:00 +02:00
Volker Lendecke
270a3f2a6f Add create_connection_server_info() -- not used yet
(This used to be commit 50bf075f75)
2008-05-10 11:17:00 +02:00
Volker Lendecke
4f731150bd Use talloc_tos() for a temporary getpwnam_alloc in make_connection_snum
(This used to be commit 1843ea64ab)
2008-05-07 14:47:29 +02:00
Volker Lendecke
193b63f326 Use talloc_stackframe() in find_forced_group
(This used to be commit 27a9bbc645)
2008-05-07 14:47:29 +02:00
Volker Lendecke
bec1dfab27 Remove "userdom_struct user" from "struct user_struct"
(This used to be commit 420de03523)
2008-05-05 18:28:59 +02:00
Volker Lendecke
71ff1ba2de Remove "guest" from "struct user_struct"
(This used to be commit 570a6b80fe)
2008-05-05 18:28:59 +02:00
Volker Lendecke
c6d209f834 Remove the unix token info from "struct user_struct"
(This used to be commit aa2299d42a)
2008-05-05 18:28:58 +02:00
Volker Lendecke
bb3755968f Remove "nt_user_token" from "struct user_struct"
(This used to be commit 51d5d512f2)
2008-05-05 18:28:58 +02:00
Volker Lendecke
d62563342e Remove connection_struct->mem_ctx, connection_struct is its own parent
(This used to be commit 559180f7d3)
2008-05-05 11:23:13 +02:00
Michael Adam
6476313b6d Add a debug message.
Michael
(This used to be commit a398070448)
2008-03-12 02:12:34 +01:00
Michael Adam
67536eddc3 registry shares: prevent creating regular share called "global".
This is a first quick fix.
Registry shares should be rewritten to use libnet_conf.

Michael
(This used to be commit 71bd0bd0ea)
2008-03-11 11:15:50 +01:00
Volker Lendecke
9a22653222 Add SMB_VFS_FS_CAPABILITIES
It turns out that this is a necessary operation, separate from statvfs. statvfs
can fail during tcon, so conn->fs_capabilities would never see that we support
streams on a particular share.

James, can you check that I got the darwin variant right? Thanks!
(This used to be commit 3ad798d803)
2008-01-21 16:14:27 +01:00
Michael Adam
b92c3e281c Add handling of [homes] and [printers] via registry shares.
Now homes and printers shares can be accessed through the
registry meachanism on demand in pure registry configurations
with "config backend = registry" without the need to
have a special handler for these two.

Michael
(This used to be commit eec3248ef9)
2008-01-16 17:10:02 +01:00
Jeremy Allison
253fbf1a6e Make use of talloc_pool in the main codepaths. Remove the sub-contexts.
Jeremy.
(This used to be commit bc932b8ad4)
2008-01-09 17:11:04 -08:00
Jeremy Allison
afce2b245a Add the capability to set "smb encrypt = required"
on a share (or global) and have the server reply with
ACCESS_DENIED for all non-encrypted traffic (except
that used to query encryption requirements and set
encryption state).
Jeremy.
(This used to be commit d241bfa577)
2007-12-27 23:51:03 -08:00
James Peach
1176e04c76 Cache the underlying filesystem capabilities at connection time.
This change alters the Samba connection code to cache the filesystem
capabilities when a new client connects. This can be used to enable
filesystem specific optimisations is a general manner.
(This used to be commit de3c5b808a)
2007-12-22 14:01:25 -08:00
Volker Lendecke
e518e19bc0 Remove Get_Pwnam and its associated static variable
All callers are replaced by Get_Pwnam_alloc
(This used to be commit 735f593154)
2007-12-19 21:09:10 +01:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Jeremy Allison
2b3c44e4fb Always define PATH_MAX. Makes code simpler (removes
a bunch of #defines). Remove pstring from msdfs.c.
Jeremy.
(This used to be commit e203ba2227)
2007-11-10 22:31:34 -08:00
Jeremy Allison
54d65bfb9a Fix the build when realpath doesn't take null
as a last arg.
Jeremy.
(This used to be commit 6312522538)
2007-11-10 15:02:08 -08:00
Jeremy Allison
acc0218f13 Remove pstring from service.c.
Jeremy.
(This used to be commit cdd9e5cc83)
2007-11-10 14:43:39 -08:00
Volker Lendecke
ec1ecd92c9 Make load_registry_service return the share number
(This used to be commit 934964c90f)
2007-11-05 02:45:14 +01:00
Jeremy Allison
5b0b4f23ef Remove most of the remaining globals out of lib/util_sock.c.
I have a plan for dealing with the remaining..... Watch
this space.
Jeremy.
(This used to be commit 963fc76852)
2007-11-03 23:20:10 -07:00
Jeremy Allison
25074433f4 I can't get away without a 'length' arg. :-).
Jeremy.
(This used to be commit 95d01279a5)
2007-11-03 18:41:26 -07:00
Jeremy Allison
6658165d5e Stop get_peer_addr() and client_addr() from using global
statics. Part of my library cleanups.
Jeremy.
(This used to be commit e848506c85)
2007-11-03 18:15:45 -07:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Jeremy Allison
12f61e09d9 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
(This used to be commit 7f0db75fb0)
2007-10-10 12:30:41 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
14e25f10d6 r23168: Move the lp_max_connections() into service.c.
(This used to be commit 4afe37d431)
2007-10-10 12:22:51 -05:00
Volker Lendecke
f3c477c631 r23167: Remove an unused parameter
(This used to be commit 3452a870d5)
2007-10-10 12:22:51 -05:00
Volker Lendecke
b4a7b7a888 r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; and
replace all data_blob(NULL, 0) calls.
(This used to be commit 3d3d61687e)
2007-10-10 12:22:01 -05:00
Jeremy Allison
b93126ea12 r21953: One format fix, clarify a condition that the IBM
checker was worried about.
Jeremy.
(This used to be commit 70eec7b8ae)
2007-10-10 12:18:52 -05:00
Volker Lendecke
28e2069d1f r21547: Fix from Michael Adam <ma@sernet.de>: Refuse registry shares without path.
Thanks,

Volker
(This used to be commit e795865d58)
2007-10-10 12:18:11 -05:00
Jeremy Allison
2afcdc8732 r21482: Use IPC$ not ipc$ for consistency.
Jeremy.
(This used to be commit 42a846b3df)
2007-10-10 12:18:07 -05:00
Jeremy Allison
01ecda0534 r21481: No one said anything, so I'm disallowing anything
but explicit shares in "default service" :-).
Jeremy.
(This used to be commit 90bdcce765)
2007-10-10 12:18:07 -05:00
Volker Lendecke
d9a29aade0 r21279: Get rid of 'aio write behind', this is broken.
It should probably better be integrated with our write cache.

Volker
(This used to be commit 58bfd168b0)
2007-10-10 12:17:53 -05:00
Volker Lendecke
240a3fd644 r21108: Send sys_notify_watch through the VFS, FAM is next
(This used to be commit 603a967613)
2007-10-10 12:17:38 -05:00
Volker Lendecke
2852ecc67e r21092: Ok, that's the one that activates the Samba4 notify backend.
Now to clean up / fix lots of stuff.

Volker
(This used to be commit 9e7443fa14)
2007-10-10 12:17:36 -05:00
Volker Lendecke
b9af964680 r21083: Actually make it static... :-)
(This used to be commit 65f473d22b)
2007-10-10 12:17:34 -05:00
Volker Lendecke
37a3339a18 r21082: Make canonicalize_path static to service.c -- we do have conn->connectpath
(This used to be commit 06f58096e3)
2007-10-10 12:17:34 -05:00
Volker Lendecke
d5206610cd r20931: This changes the notify infrastructure from a polling-based to an event-driven
based approach. The only remaining hook into the backend is now

	void *(*notify_add)(TALLOC_CTX *mem_ctx,
			    struct event_context *event_ctx,
			    files_struct *fsp, uint32 *filter);

(Should we put this through the VFS, so that others can more easily plug in?)

The trick here is that the backend can pick filter bits that the main smbd
should not handle anymore. Thanks to tridge for this idea.

The backend can notify the main smbd process via

void notify_fsp(files_struct *fsp, uint32 action, char *name);

The core patch is not big, what makes this more than 1800 lines are the
individual backends that are considerably changed but can be reviewed
one by one.

Based on this I'll continue with inotify now.

Volker
(This used to be commit 9cd6a8a827)
2007-10-10 12:17:21 -05:00
Jeremy Allison
25d6eaae8d r20098: Properly fix issues with create_token_from_username()
reported by James. Ensure that this function allocates
everything on the temporary context except the return
memory. Never call this with a null mem context, and
now use conn->mem_ctx instead in smbd/service.c.
Remove separate free functions for conn->ngroups
and conn->nt_user_token as they are now always
talloc'ed off the conn->mem_ctx. Future optimization
will be to remove conn->mem_ctx and make all objects
pointed to in the conn struct talloc'ed off conn itself.
Easy to free then :-).
Jeremy.
(This used to be commit f83b6de44f)
2007-10-10 12:16:24 -05:00
Jeremy Allison
af0f14e3a7 r20097: Ensure found_username is freed correctly when
talloced on the null context.
Jeremy.
(This used to be commit 2c59c4dddc)
2007-10-10 12:16:24 -05:00
Jeremy Allison
63609fbb04 r20090: Fix a class of bugs found by James Peach. Ensure
we never mix malloc and talloc'ed contexts in the
add_XX_to_array() and add_XX_to_array_unique()
calls. Ensure that these calls always return
False on out of memory, True otherwise and always
check them. Ensure that the relevent parts of
the conn struct and the nt_user_tokens are
TALLOC_DESTROYED not SAFE_FREE'd.
James - this should fix your crash bug in both
branches.
Jeremy.
(This used to be commit 0ffca7559e)
2007-10-10 12:16:24 -05:00
Volker Lendecke
7299dc8b54 r20014: Ouch.... "res" is not a flag here, it is the service number...
(This used to be commit a4862f48d0)
2007-10-10 12:16:20 -05:00
Volker Lendecke
fc030c313f r20006: Convert the registry shares to use the new API
(This used to be commit 66e889bbab)
2007-10-10 12:16:19 -05:00
Volker Lendecke
ecf90c495e r19991: Sorry for this 2000-liner...
The main thing here is a rewrite of srv_winreg_nt.c. The core functionality
has moved to registry/reg_api.c which is then usable by the rest of Samba as
well.

On that way it fixes creating keys with more than one element in the
path. This did not work before.

Two things that sneaked in (sorry :-) is the change of some routines from
NTSTATUS to WERROR the removed "parent" argument to regkey_open_internal.

Volker
(This used to be commit fea52801de)
2007-10-10 12:16:18 -05:00
Volker Lendecke
575845ccbe r19963: Add 'registry shares = yes' and registry key security descriptors.
(This used to be commit 6cab254c49)
2007-10-10 12:16:16 -05:00
Jeremy Allison
d988af921d r19705: Fix blocker bug for 3.0.23d - find_forced_group could
return an uninitialized sid.
Jeremy.
(This used to be commit 57c60103e7)
2007-10-10 12:15:48 -05:00
Volker Lendecke
81014d255e r19000: Merge the max tcon check from 3_0_23. Thanks to James Peach that this was not
done in the 3_0 tree.

Volker
(This used to be commit b2fbf5ac0c)
2007-10-10 12:14:55 -05:00
Jeremy Allison
f18c9365ca r18787: Fix the strlen_m and strlen_m_term code by merging
in (and using elsewhere) next_codepoint from Samba4.
Jerry please test.
Jeremy.
(This used to be commit ece00b70a4)
2007-10-10 12:00:57 -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
Jeremy Allison
f8aa1c75f4 r17402: Added lookup_name_smbconf() to be called when looking
up names from smb.conf. If the name is unqualified it
causes the lookup to be done in WORKGROUP\name, then
"Unix [users|groups]"\name rather than searching the
domain. Should fix the problems with "force user"
selecting a domain user by preference.
Jeremy.
(This used to be commit 1e1fcb5eb2)
2007-10-10 11:38:31 -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
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
Volker Lendecke
75d2304643 r15601: Fix segfaults with 'security=share' and 'guest only = yes'
Volker
(This used to be commit ea7cced6bc)
2007-10-10 11:17:03 -05:00
Jeremy Allison
2602e5fab1 r15555: Make "change notify timeout" a per-share parameter - used
when there's no kernel or FAM change notify. If set to zero
this will turn off change notify for the share except when
we ourselves change something (renames / deletes etc. ).
Designed to help on large directory shares where a new
changenotify is issued between each delete. This will
be fixed correctly when we move to internal change notify
(eg. back-port Samba4 changenotify).
Jeremy.
(This used to be commit 5a17bffbcd)
2007-10-10 11:16:59 -05:00
Jeremy Allison
010c725b36 r15088: Remove all time() and gettimeofday() calls out of the mainline
packet processing code. Only do these when needed (ie. in the
idle timeout code). We drop an unneccessary global here too.
Jeremy.
(This used to be commit 8272a5ab06)
2007-10-10 11:16:22 -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
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
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
b3109006c5 r13095: Fix warnings assigning int to a size_t.
Jeremy.
(This used to be commit 1ca4abffd0)
2007-10-10 11:06:13 -05:00
Volker Lendecke
f2c8291791 r12308: Reformatting
(This used to be commit 97acfa12e5)
2007-10-10 11:05:53 -05:00
Volker Lendecke
862e4a11c1 r12307: Reformatting plus a trivial if/else simplification. There's no point in doing
an else branch that only returns NULL.

Volker
(This used to be commit ef4d9d96de)
2007-10-10 11:05:53 -05:00
Jeremy Allison
ab7a4f7e8e r12213: Final fix for #3303 - send rename messages to smbd's
that have open file handles to allow them to correctly
implement delete on close. There is a further correctness
fix I'm intending to add to this to cope with different share
paths, but not right now...
Jeremy.
(This used to be commit 932e337db8)
2007-10-10 11:05:49 -05:00
Jeremy Allison
fa4df827d0 r12194: Ensure that when we set a connection path we've canonicalized
the name (must be abolute - start with /, must not end in /,
must have ./ and ../ removed). Of course for realpath resolved
paths this won't be the case but for others we need this name
to be canonicalized. This name is going into the sharemode db
for #3303 so needs to be in a normalized format.
Jeremy.
(This used to be commit 22e3300911)
2007-10-10 11:05:48 -05:00
Jeremy Allison
775056f8e4 r10693: Fix bug #3129, reported by Adam Porter <sambabugzilla@alphapapa.net>.
Rotten error message caused hours of wasted time.
Jeremy.
(This used to be commit f391f065b2)
2007-10-10 11:04:50 -05:00
Jeremy Allison
f2f55d703d r7963: Add aio support to 3.0.
Jeremy.
(This used to be commit 1de27da470)
2007-10-10 10:58:05 -05:00
Jeremy Allison
afc7af3fdf r7948: Ensure we call the vfs connection hook before doing a vfs stat.
Allows database vfs backends to initialise with a working connection.
Bugid #2827
Jeremy.
(This used to be commit 7ef6850056)
2007-10-10 10:58:03 -05:00
Jeremy Allison
0deab47cc6 r7210: Fix my own mistakes up, sorry.
Jeremy.
(This used to be commit 53c3a954ee)
2007-10-10 10:57:05 -05:00
Jeremy Allison
ed5e7ff9f1 r7200: Don't use memset, use SET_STAT_INVALID (has the same effect).
Jeremy.
(This used to be commit 0b6f87d5e1)
2007-10-10 10:57:05 -05:00
Gerald Carter
f24d88cf9d r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1
(This used to be commit 9727d05241)
2007-10-10 10:57:02 -05:00
Jeremy Allison
02e3717ee9 r6625: Remove another global variable left over from a long time ago (magic char).
Jeremy.
(This used to be commit b1bfa9cb37)
2007-10-10 10:56:47 -05:00
Jeremy Allison
595183b916 r6497: Ensure yield_connection() is called on all appropriate error conditions.
Jeremy.
(This used to be commit f895f087ad)
2007-10-10 10:56:43 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Volker Lendecke
4b122ce2da r5905: Fix two warnings found by AIX. They might actually be bugs on 64-bit
platforms.

Volker
(This used to be commit f7218d1c66)
2007-10-10 10:56:07 -05:00
Gerald Carter
a5e671e867 r5608: BUG 2399 - removing dead code (not finished with bug yet).
(This used to be commit 48353c199c)
2007-10-10 10:55:50 -05:00
Jeremy Allison
09f5aa4269 r5607: Fix for bug #2399 - ensure we use SMB_VFS_STAT instead of stat
when checking for existance of a pathname.
Jeremy.
(This used to be commit 08aac40e3a)
2007-10-10 10:55:50 -05:00
Jeremy Allison
91ef89daa0 r5183: Ensure we correctly set the per-connection "case_sensitive" setting.
Rename dptrs_open to the more correct dirhandles_open.
Remove old #if 1.
Jeremy.
(This used to be commit c43bae306a)
2007-10-10 10:55:32 -05:00
Gerald Carter
d097ea4905 r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads
(This used to be commit 1cad525093)
2007-10-10 10:53:46 -05:00
Gerald Carter
57c468bbf1 r4043: BUG 2091: don't remove statically defined printers in remove_stale_printers()
(This used to be commit c24a3c49ce)
2007-10-10 10:53:31 -05:00
Günther Deschner
3de9b11601 r2475: A more helpful debug-message when a connection to a dfs-proxy-share is
failing.

Guenther
(This used to be commit 486bcff17f)
2007-10-10 10:52:44 -05:00
Jeremy Allison
db2ffe10f9 r2076: Removed old dir caching code - not being used now we have the
statcache anyway. New dir caching will be done on nanosecond
timestamps.
Jeremy.
(This used to be commit ba473a5802)
2007-10-10 10:52:30 -05:00
Jeremy Allison
cd87b3b972 r1414: Memory leak fixes found by valgrind whilst checking the password history code.
Error code paths were not freeing up some memory.
Jeremy.
(This used to be commit 7c4666e56c)
2007-10-10 10:52:11 -05:00
Jeremy Allison
2acd084866 r1154: Change default setting for case sensitivity to "auto". If set to auto
then is the client supports it (current clients supported are Samba and
CIFSVFS - detected by the negprot strings "Samba", "POSIX 2" and a bare
"NT LM 0.12" string) then the setting of the per packet flag smb_flag
FLAG_CASELESS_PATHNAMES is taken into account per packet. This allows
the linux CIFS client to use Samba in a case sensitive manner.
Additional command in smbclient "case_sensitive", toggles the
flag in subsequent packets.
Docs to follow.
Jeremy.
(This used to be commit cf84c0fe1a)
2007-10-10 10:51:57 -05:00
Jeremy Allison
cb03592c06 r933: When using widelinks = no, use realpath to canonicalize the
connection path on connection create for the user. We'll be
checking all symlinked paths are below this directory.
Jeremy.
(This used to be commit b562fe9fbc)
2007-10-10 10:51:50 -05:00
Gerald Carter
67d474861d r799: BUG 1259 -- add 'printcap cache time' patch from Lars
(This used to be commit fac9074113)
2007-10-10 10:51:46 -05:00
Jeremy Allison
89db7e1001 r656: Make widelinks use realpath(). Tidy up cases where we need to become a service.
Jeremy.
(This used to be commit a03b6a05e0)
2007-10-10 10:51:33 -05:00
Jeremy Allison
e0da56a848 r570: Remove lots of globals to handle case issues - move them
to connection struct entries (as they should have been from
the start). Jerry, once you've cut over to 3.0.4 release
branch I'll add this to 3.0 also.
- Jerry cut over :-).
Jeremy.
(This used to be commit 578a508509)
2007-10-10 10:51:30 -05:00
Jeremy Allison
c9b7cbbfa5 Added strstr_m() function. Use in all places where we might run into mb
(should fix the mb service name problem, can't remember the bugid).
Jeremy.
(This used to be commit 94a272b9a8)
2004-03-09 00:17:14 +00:00
Jeremy Allison
48eb635f31 Several mb tidyups - getting ready to address the XXX_sub function.
Jeremy.
(This used to be commit 92c3ae3458)
2004-03-05 22:32:45 +00:00
Jeremy Allison
b545a8de0a Fixup the 'multiple-vuids' bugs.
Jeremy.
(This used to be commit f0f7a48327)
2004-02-13 19:05:25 +00:00
Gerald Carter
cd141e33fa cleaning out patch list; patch from Steve L. to change the cwd before the postexec script
(This used to be commit 497e14ba19)
2003-10-03 15:11:24 +00:00
Jeremy Allison
05b178ab82 Ensure %S gets expanded in read/write lists.
Jeremy.
(This used to be commit 7d7096fc3a)
2003-09-26 21:03:32 +00:00
Volker Lendecke
c716385220 This only touches the fake kaserver support. It adds two parameters:
afs share -- this is an AFS share, do AFS magic things
afs username map -- We need a way to specify the cell and possibly
		    weird username codings for several windows domains
		    in the afs cell

Volker
(This used to be commit 4a3f7a9356)
2003-09-23 14:52:21 +00:00
Gerald Carter
e56192d0cf make sure we substitute basic variables in read/write list
(This used to be commit 52bea54d35)
2003-09-08 15:24:01 +00:00
Volker Lendecke
1c38391c70 Nobody complained on the team-list, so commit it ...
This implements some kind of improved AFS support for Samba on Linux with
OpenAFS 1.2.10. ./configure --with-fake-kaserver assumes that you have
OpenAFS on your machine. To use this, you have to put the AFS server's KeyFile
into secrets.tdb with 'net afskey'. If this is done, on each tree connect
smbd creates a Kerberos V4 ticket suitable for use by the AFS client and
gives it to the kernel via the AFS syscall. This is meant to be very
light-weight, so I did not link in a whole lot of libraries to be more
platform-independent using the ka_SetToken function call.

Volker
(This used to be commit 5775690ee8)
2003-09-07 16:36:13 +00:00
Jeremy Allison
8d992a7102 Output message saying "signed connect" instead of just connect when signing
is active.
Jeremy.
(This used to be commit c6674fa628)
2003-08-03 07:20:05 +00:00
Richard Sharpe
f746a68030 Clarify a debug log a little. The path might not exist, so say so.
(This used to be commit 8409cf3e47)
2003-07-21 20:20:09 +00:00
Richard Sharpe
a7ef6aac3a Fix a small spelling mistake and push out the new version of aclocal.m4 to
properly handle iconv on FreeBSD ...

It works on Linux and FreeBSD ...
(This used to be commit 9302401f54)
2003-07-09 23:01:08 +00:00
Andrew Bartlett
b475d0b889 This changes our Unix primary GID behaviour back to what most people expect:
Samba will now use the user's UNIX primary group, as the primary group when
dealing with the filesystem.  The NT primary group is ignored in unix.

For the NT_TOKEN, the primary group is the NT priamry group, and the unix
primary group is added to the NT_TOKEN as a supplementary group.

This should fix bug #109, but will need to be revisited when we get a full
NT group database.

Also in this commit:
 - Fix debug statements in service.c
 - Make idmap_ldap show if it's adding, or modifying an existing DN
 - Make idmap_ldap show both the error message and error string
(This used to be commit 32e455a714)
2003-07-06 05:51:20 +00:00
Jeremy Allison
ce72beb2b5 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
(This used to be commit ff222716a0)
2003-07-03 19:11:31 +00:00
Andrew Bartlett
3f5dc14457 Always initialize.
(This used to be commit 75081860af)
2003-06-21 07:54:03 +00:00
Alexander Bokovoy
bc2a3748e9 Prefix VFS API macros with SMB_ for consistency and to avoid problems with VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out
(This used to be commit c2689ed118)
2003-05-14 10:59:01 +00:00
Tim Potter
402fbc518a spelling
(This used to be commit 865c112756)
2003-05-14 00:46:43 +00:00
Alexander Bokovoy
e7c8c15888 Fix VFS layer:
1. Finally work with cascaded modules with private data storage per module
2. Convert VFS API to macro calls to simplify cascading
3. Add quota support to VFS layer (prepare to NT quota support)

Patch by Stefan (metze) Metzemacher, with review of Jelmer and me
Tested in past few weeks. Documentation to new VFS API for third-party developers to follow
(This used to be commit 91984ef5ca)
2003-05-11 23:34:18 +00:00
Andrew Bartlett
2a3a9f0bf4 Merge the 'safe' parts of my StrnCpy patch - many of the users really wanted
a pstrcpy/fstrcpy or at most a safe_strcpy().

These have the advantage of being compiler-verifiable.

Get these out of the way, along with a rewrite of 'get_short_archi' in the
spoolss client and server.  (This pushes around const string pointers, rather
than copied strings).

Andrew Bartlett
(This used to be commit 32fb801ddc)
2003-04-23 13:27:35 +00:00
Tim Potter
bdb7a74419 Whitespace syncup.
(This used to be commit 8fe5bab565)
2003-04-14 03:48:26 +00:00
Gerald Carter
14e03aed29 cleanup lanman printing= for win98; device type is LPT1:; patch by Steve L.
(This used to be commit 36d62e5667)
2003-04-11 23:28:15 +00:00
Jeremy Allison
9bf3d3cb03 Fix from Steve Langasek <vorlon@netexpress.net> for non-RPC printing.
Jeremy.
(This used to be commit cfbd02b170)
2003-04-09 22:34:30 +00:00
Volker Lendecke
5fd03bffd3 This changes our handling of invalid service types that the
client requested on tconx. We now return the same error
code like NT4SP6 and W2kSP3 return.

TCONDEV is a little test for this.

Volker
(This used to be commit 6f94ab8ed5)
2003-03-30 16:37:10 +00:00
Jeremy Allison
7e958f092a Doin't pstrcpy into fstring.
Jeremy.
(This used to be commit e619c50834)
2003-03-19 02:01:11 +00:00
Jeremy Allison
4e8d7b3e8e Ensure dev in make_connection is const.
Jeremy.
(This used to be commit 1c6ea31b8f)
2003-03-18 23:49:03 +00:00
Andrew Bartlett
e72ecdc862 Merge of server-side authentication changes to 3.0:
- user_ok() and user_in_group() now take a list of groups, instead of
   looking for the user in the members of all groups.

 - The 'server_info' returned from the authentication is now kept around
  - in future we won't copy the sesion key, username etc, we will just
    referece them directly.

 - rhosts upgraded to use the SAM if possible, otherwise fake up based on
   getpwnam().

 - auth_util code to deal with groups upgraded to deal with non-winbind domain
   members again.

Andrew Bartlett
(This used to be commit 74b5436c75)
2003-02-24 02:35:54 +00:00
Gerald Carter
99cdb46208 *lots of small merges form HEAD
*sync up configure.in
*don't build torture tools in make all
*make sure to remove torture tools as part of make clean
(This used to be commit 0fb724b321)
2003-01-15 18:57:41 +00:00
Andrew Bartlett
0ba7c143b3 Merge from HEAD - handle VFS module load failures, change some error returns to
avoid sending NT_STATUS_UNSUCCESSFUL.

Andrew Bartlett
(This used to be commit 7b95151ddc)
2003-01-06 07:40:39 +00:00
Shirish Kalele
6b7f50594b Add check to prevent non-Dfs clients from connecting to an msdfs proxy.
(This used to be commit 2a665ab60a)
2002-12-27 23:03:22 +00:00
Andrew Tridgell
91b7ac9fb9 merged the %U changes to 3.0
(This used to be commit 58fa6bfee8)
2002-11-20 00:53:24 +00:00
Jeremy Allison
ae94f2eaa5 Samba janitor... Merging tridge's change to 3.0. Original commit
message :

the change in the way %U is handled to use current_user has broken
some basic usages like 'include = smb.conf.%U'

This changes fixes things again, by checking for reload after we setup
current_user in tconx.
(This used to be commit 64b2243ccd)
2002-11-18 06:12:47 +00:00
Jeremy Allison
2f194322d4 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit f755711df8)
2002-11-12 23:20:50 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
127e77e6e3 Sync 3.0 branch with head
(This used to be commit 42615b945e)
2002-08-17 15:27:10 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Andrew Bartlett
7b671e34f5 Some more 'winbind default domain' support patches from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

This patch is designed to remove the 'special cases' required for this support.

In particular this now kills off winbind_initgroups, as it appears no longer to
be required.

Andrew Bartlett
(This used to be commit f1d8d50976)
2002-01-27 12:12:22 +00:00
Andrew Bartlett
184cc84ada Yes, dev is an 'input/output' paramater...
Andrew Bartlett
(This used to be commit 8cac618174)
2002-01-27 12:06:27 +00:00
Jeremy Allison
08019e8a33 Separate out get_user_home_dir() from get_user_home_service_dir().
Jeremy.
(This used to be commit c1b97226db)
2002-01-16 23:53:10 +00:00
Martin Pool
fed604bfa3 Roll back PSTRING_SANCTIFY patch; just leave non-controversial type
and constness changes.
(This used to be commit cee0ec7274)
2002-01-16 02:42:07 +00:00
Jeremy Allison
9e007457e4 Removed MAXSTATUS which was set incorrectly - thus causing tdb traversal
of the connections db on smbd startup. This should fix the Solaris large
load bug.... (fingers crossed).
Jeremy.
(This used to be commit 5b2b9c25af)
2002-01-14 19:34:28 +00:00
Andrew Bartlett
b322fc3b26 Make this error match Win2k.
(This used to be commit 490d3aaf20)
2002-01-11 07:48:55 +00:00
Jeremy Allison
f8e2baf39e Added NT_USER_TOKEN into server_info to fix extra groups problem.
Got "medieval on our ass" about const warnings (as many as I could :-).
Jeremy.
(This used to be commit ee5e7ca547)
2001-11-03 23:34:24 +00:00
Andrew Bartlett
60f0627afb This is a farily large patch (3300 lines) and reworks most of the AuthRewrite
code.

In particular this assists tpot in some of his work, becouse it provides the
connection between the authenticaion and the vuid generation.

Major Changes:
	- Fully malloc'ed structures.
	  - Massive rework of the code so that all structures are made and destroyed
	    using malloc and free, rather than hanging around on the stack.
	- SAM_ACCOUNT unix uids and gids are now pointers to the same, to allow them
	   to be declared 'invalid' without the chance that people might get ROOT by
	   default.

	- kill off some of the "DOMAIN\user" lookups.  These can be readded at a more
	  appropriate place (probably domain_client_validate.c) in the future. They
	  don't belong in session setups.

	- Massive introduction of DATA_BLOB structures, particularly for passwords.

	- Use NTLMSSP flags to tell the backend what its getting, rather than magic
	  lenghths.

	- Fix winbind back up again, but tpot is redoing this soon anyway.

	- Abstract much of the work in srv_netlog_nt back into auth helper functions.

This is a LARGE change, and any assistance is testing it is appriciated.

Domain logons are still broken (as far as I can tell) but other functionality
seems
intact.

Needs testing with a wide variety of MS clients.

Andrew Bartlett
(This used to be commit f70fb819b2)
2001-10-31 10:46:25 +00:00
Andrew Bartlett
2038649e51 This commit is number 3 of 4.
In particular this commit focuses on:

Changing the Get_Pwnam code so that it can work in a const-enforced
environment.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes allow for 'const' in the Samba tree.

There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username
(This used to be commit e7634f81c5)
2001-10-29 07:28:32 +00:00
Andrew Tridgell
e82c34aab5 add non_root_mode() check
(This used to be commit 96f910bae5)
2001-10-20 06:29:52 +00:00
Jeremy Allison
c416ff851b Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.
Ensure make_conection() can only be called as root.
Jeremy.
(This used to be commit 8d23a7441b)
2001-10-18 20:15:12 +00:00
Tim Potter
f0e0dd6507 Renamed vfs_init() to smbd_vfs_init() to allow vfs modules to compile.
(This used to be commit 7c3542ba87)
2001-10-18 00:27:20 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Andrew Bartlett
8bb1479500 Rearrange the ordering of the checks in make_connection(). The new order has
some sainity, avoiding things like 'root preexec' when the connection would
otherwise already be denied (max connections).

This does change behaviour, but I think its for the best.

Andrew Bartlett
(This used to be commit 99e8a263ad)
2001-09-20 07:09:28 +00:00
Andrew Tridgell
56aa0a274d got rid of bogus write list substitution error messages
(This used to be commit 0deae6c407)
2001-09-19 04:11:23 +00:00
Andrew Bartlett
7892c494e7 Kill off the //server/share%user hack in share level security.
This should help make much of this code simpiler.

Andrew Bartlett
(This used to be commit fb0c3629c3)
2001-09-15 12:55:59 +00:00
Andrew Bartlett
1c8c7c558b Actually fill in the status for sainity checks
Andrew Bartlett
(This used to be commit d47016de52)
2001-09-15 01:59:44 +00:00
Andrew Tridgell
b031af348c converted another bunch of stuff to NTSTATUS
(This used to be commit 1d36250e33)
2001-08-27 19:46:22 +00:00
Andrew Bartlett
8db28234c5 OK, so not freeing these was a mistake. I'll try to be less exuberent next
time :-)
(This used to be commit 8c3cf2db95)
2001-08-17 08:57:58 +00:00
Andrew Bartlett
9ed5f60a5b Move the claim_connection stuff till a little later in the process.
(You don't have to clean up somthing you haven't done yet...)
(This used to be commit ba76564c2a)
2001-08-17 08:44:04 +00:00
Andrew Bartlett
327fda27ed Move admin user check into a helper function.
Formatting fixes.
(This used to be commit 6fd8eb08c1)
2001-08-17 08:12:33 +00:00
Andrew Bartlett
67967749a2 Move read only check into a helper funcion. Ensure conn->service is set
before we use it to find a share's details.
(This used to be commit 7dc716f174)
2001-08-17 07:48:25 +00:00
Andrew Bartlett
578a39d44f smbd/auth_server: Doco, we want to use cli_nt_error here soon
smbd/password.c: We don't use globals here anymore

smbd/reply.c: Tidyness, global_myworkgroup must die!

smbd/service.c:  Move some of the make_connection code into a helper
                 function.
(This used to be commit 15c87e404f)
2001-08-17 07:03:27 +00:00
Simo Sorce
b99e314cfb better debug messages + fix typo in debug message
(This used to be commit b377f06fd9)
2001-07-26 22:05:51 +00:00
Andrew Tridgell
9de7c5e521 - don't try to print pointers
- removed some unused mangling code
(This used to be commit 36af1c0dc4)
2001-07-25 06:29:26 +00:00
Simo Sorce
1cbae7315f Convert other parameters (read list, write list, valid users...) to the P_LIST format.
changed functions to use list instead of strings
addedd lp_list_substitute function
(This used to be commit 7257d07563)
2001-07-24 20:02:48 +00:00
Jeremy Allison
54068ae8f3 Tidied up calling yield_connection on connection allocation fail.
Restore debug message to level zero.
Jeremy.
(This used to be commit 0b13f495b3)
2001-07-17 22:04:46 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
e2ced932db Ensured all the system calls in msdfs.c go through the vfs layer.
Added vfs calls to symlink() and readlink() with appropriate configure
checks.
Jeremy.
(This used to be commit c24e6b41ea)
2001-06-29 22:32:24 +00:00
Andrew Tridgell
fcda2645f0 added a close-share smbcontrol message that forcibly closes a share in smbd (to allow unmount)
(This used to be commit 15b17a80db)
2001-06-20 03:05:09 +00:00
Jeremy Allison
8efe942751 Now we're doing the substituion in the lp_string code remove the erroneous
debug 0 warning.
Jeremy.
(This used to be commit be7e1d0f2c)
2001-05-12 00:31:59 +00:00
Jeremy Allison
2ef68c7e92 Merge of Andrew's changes in 2.2.
Jeremy.
(This used to be commit fc76681812)
2001-04-13 19:12:06 +00:00
Jeremy Allison
50e78a9ac8 As Andrew suggested, make smbrun return a fd for a deleted file which can then
be read.
Jeremy.
(This used to be commit e7d59d6de8)
2001-04-13 00:37:00 +00:00
Jeremy Allison
0ca9f5c023 Fix for core dump in security = share code with new share security db.
Jeremy.
(This used to be commit 20b13bafdf)
2001-04-11 21:19:25 +00:00
Jeremy Allison
9d6dd97624 Added set/get SD's on shares. Check before tcon.
Jeremy.
(This used to be commit 036b1a8b09)
2001-04-09 06:36:38 +00:00
Jeremy Allison
d4e8c87005 Fix from Ed Boraas for not core dumping when out of connection structs.
Jeremy.
(This used to be commit f50ea32dd0)
2001-04-06 20:32:36 +00:00
Jeremy Allison
7bdf197e62 Patch from Massimo Sivilotti <mass@tanner.com> to log remote machine/ip on
connection fail.
Jeremy.
(This used to be commit 07cee46d1d)
2001-03-26 23:21:29 +00:00
Jeremy Allison
d3ec09326b Added ADMIN$ share as alias for IPC$ except no guest connect. AS/U wants
to do RPC calls down this treeid.
Jeremy.
(This used to be commit 83133bab0e)
2001-03-13 00:31:07 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
24f8e973b2 smbd/process.c: & type with 0xff for paranioa sake...
smbd/reply.c smbd/service.c: cause all "add home service" calls to go through a
winbindd aware function.
Jeremy.
(This used to be commit a72d12e992)
2001-01-24 19:34:53 +00:00
Gerald Carter
42571a656f only add the service name and client machine name to list of users names
for a session when in share mode security


--jerry
(This used to be commit 22d6c2c163)
2001-01-23 22:13:41 +00:00
Jeremy Allison
2f7c1db093 include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added fchmod_acl and chmod_acl.
lib/substitute.c:
smbd/lanman.c:
smbd/open.c:
smbd/process.c:
smbd/reply.c:
smbd/service.c: Removed sessetup_user variable. Added current_user_info struct
which conatins domain info etc. Added '%D' for client domain parameter.
Jeremy.
(This used to be commit 2844ec3d51)
2001-01-23 01:52:30 +00:00
David O'Neill
792ca5d989 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - Unrolled construct_notify_jobs_info() loop to only fetch
          printer info_2 structure once rather than num_print_jobs times.
        - convert command to unix codepage.
        - remove lp_remove_service() call as it prevents lp_killservice()
          from working.
        - Modified some DEBUG and DEBUGADD statements.

    source/param/loadparm.c
    source/param/params.c
        - change printer, preload, auto services to FLAG_DOS_STRING,
          reverted earlier changes to szPrintername et al, add comments.

    source/printing/load.c
        - fix bug with lp_auto_services() and strtok()

    source/printing/nt_printing.c
    source/printing/printing.c
        - remove redundant test that used SERVICE(snum)

    source/printing/pcap.c
        - add unix_to_dos() calls, add notes wrt FIXMEs for
          xxx_printer_fn() functions.

    source/web/swat.c
        - added FIXME comment.

    source/smbd/service.c
        - added comment re: dos codepage
(This used to be commit 7b774b72c2)
2001-01-17 18:47:46 +00:00
David O'Neill
23807f2b30 Changes from APPLIANCE_HEAD:
source/Makefile.in
        - changes to ctags and etags rules that somehow got lost along the way.

    source/include/proto.h
        - make proto

    source/smbd/sec_ctx.c
    source/smbd/password.c
        - merge debugs for debugging user groups and NT token stuff.

    source/lib/util_str.c
        - capitalise domain name returned from parse_domain_user()

    source/nsswitch/wb_client.c
        - fix broken conditional in debug statement.

    source/include/rpc_secdes.h
    source/include/rpc_spoolss.h
    source/printing/nt_printing.c
    source/lib/util_seaccess.c
        - fix printer permission bugs related to ACE masks for printers.
          This adds mapping of generic access rights to object specific
          rights for NT printers.  Still need to work out whether or not to
          ignore ACEs with certain flags set, though. See comments in
          util_seaccess.c:check_ace() for details.

    source/printing/nt_printing.c
    source/printing/printing.c
        - use PRINTER_ACCESS_ADMINISTER instead of JOB_ACCESS_ADMINISTER
          until we sort out printer/printjob permission stuff.
(This used to be commit 1dba9c5cd1)
2001-01-04 19:27:08 +00:00
Tim Potter
90a7d7d3d7 Compile fix for new arg to create_nt_token()
(This used to be commit 806185ca8c)
2000-12-12 05:29:47 +00:00
Andrew Tridgell
5f8ff6056a we don't need the separate lp_status() connection records any more
(This used to be commit 209e20365e)
2000-11-17 03:31:03 +00:00
Andrew Tridgell
0de5569304 fixed the problem with messages not getting through
the problem had nothing to do with being your own pid, it was instead
a problem with IPC$ connections not being registered in the
connections database and an incorrect test for -1 in the messaging
code.

These changes also mean that IPC$ shares now show up in
smbstatus. That is probably a good thing.
(This used to be commit 3575ad1098)
2000-11-17 03:15:18 +00:00
Jeremy Allison
6d36edaf43 Added a VFS version return to init call. Allows smbd to fail an init if
versions don't match.
Jeremy.
(This used to be commit d0fbb4f5d9)
2000-11-06 21:44:33 +00:00
Jeremy Allison
330d678fba Fix to allow smbd to call winbindd if it is running for all group enumeration,
falling back to the UNIX calls on error. This should fix all problems with
smbd enumerating all users in all groups in all trusted domains via winbindd.
Also changed GETDC to query 1C name rather than 1b name as only the PDC
registers 1b.
Jeremy.
(This used to be commit 5b0038a2af)
2000-10-13 01:59:14 +00:00
Tim Potter
cbee552bdb Don't initialise groups twice.
(This used to be commit 15d7f16bdc)
2000-10-11 04:54:37 +00:00
Jeremy Allison
636f146abf Restructuring of vfs layer to include a "this" pointer - can be an fsp or
a conn struct depending on the call.
We need this to have a clean NT ACL call interface.
This will break any existing VFS libraries (that's why this is pre-release
code).
Andrew gets credit for this one :-) :-).

In addition - added Herb's WITH_PROFILE changes - Herb - please examine
the changes I've made to the smbd/reply.c code you added. The original
code was very ugly and I have replaced it with a
START_PROFILE(x)/END_PROFILE(x) pair using the preprocessor.
Please check this compiles ok with the --with-profile switch.
Jeremy.
(This used to be commit b07611f815)
2000-10-06 03:21:49 +00:00
Jeremy Allison
b43b2e4f8a Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector them
through the VFS. All file access/directory access code in smbd should now
go via the vfs. Added vfs_chown/vfs_chmod calls. Still looking at vfs_get_nt_acl()
vfs_set_nt_acl() call API design.
Jeremy.
(This used to be commit f96625ec12)
2000-09-27 19:09:59 +00:00
Andrew Tridgell
22fbda6c56 fixed "admin users" option with new security code
(This used to be commit b69c5de6ba)
2000-08-31 07:11:45 +00:00
Tim Potter
d12f3fea75 Merge from appliance branch.
(This used to be commit 567b0095b1)
2000-08-28 06:46:53 +00:00
Jeremy Allison
f87399915b Added an NT_USER_TOKEN structure that is copied/passed around associated
with the current user. This will allow se_access_check() to quickly do
a SD check without having to translate uid/gid's to SIDs.
Still needs work on pipe calls.
Jeremy.
(This used to be commit e28d01b744)
2000-08-03 22:38:43 +00:00
Jeremy Allison
17dcd9a834 Started to canonicalize our handling of uid -> sid code in order to
get ready and fix se_access_check().
Added cannonical lookup_name(), lookup_sid(), uid_to_sid(), gid_to_sid()
functions that look via winbind first the fall back on local lookup.

All Samba should use these rather than trying to call winbindd code
directly.

Added NT_USER_TOKEN struct in user_struct, contains list of NT sids
associated with this user.

se_access_check() should use this (cached) value rather than attempting
to do the same thing itself when given a uid/gid pair.

More work needs to be done to preserve these things accross security
context changes (especially with the tricky pipe problem) but I'm
beginning to see how this will be done..... probably by registering
a new vuid for an authenticated RPC pipe and not treating the
pipe calls specially.

More thoughts needed - but we're almost there...

Jeremy.
(This used to be commit 5e5cc6efe2)
2000-08-02 02:11:55 +00:00
Tim Potter
b40175936a Fix for mounting a printer as a share. Not that there's anything
specifically wrong with this, but Samba is fooled by the client into
thinking the printer is a file share.  Files copied to the share gather
dust in the spool directory and aren't printed.

This patch has the effect of not allowing printers to be mounted as file
shares.  Not sure whether this is the correct solution or not.
{Jeremy,JF,Tridge} please check!
(This used to be commit dcf3249bb9)
2000-07-25 06:10:59 +00:00
Jeremy Allison
3cbaf59726 Fixed bug where file access was allowed on IPC$ share.
Return correct error codes on invalid share name.
Jeremy.
(This used to be commit 420d6bc480)
2000-05-23 01:27:19 +00:00
Andrew Tridgell
0806cf75ff added spool_io_printer_driver_info_level_6()
thsi function and the associated header structure were autogenerated
using a little awk based code geerator I wroe ths evening. I'll commit
that next ...
(This used to be commit 974813f0d4)
2000-05-12 14:28:46 +00:00
Andrew Tridgell
43a3faab08 - changed smb_getpwnam() to use winbind style usernames
- finished ntdom -> winbind rename in head
(This used to be commit ada483cb56)
2000-05-10 14:48:33 +00:00
Andrew Tridgell
49a0e6d598 more merging voodoo
this adds "#define OLD_NTDOMAIN 1" in lots of places. Don't panic -
this isn't permanent, it should go after another few merge steps have
been done
(This used to be commit 92109d7b3c)
2000-05-10 10:41:59 +00:00
Andrew Tridgell
f6844e0b7e a minimal change to get appliance mode to work with winbindd
we needed to accept usernames of the form DOMAIN/user, which means we
needed to pass the domain to a getpwnam() like routine in certain
critical spots.

What I'd rather do is get rid of "char *user" everywhere and use the
new userdom_struct, but that will have to wait a few days.
(This used to be commit 8b7a10febe)
2000-05-04 16:01:47 +00:00
Jeremy Allison
693ffb8466 Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
(This used to be commit 148628b616)
2000-05-02 02:23:41 +00:00
Jeremy Allison
46d66938e7 Moved deletion of vfs handle into smbd/conn.c as it was being done too
soon in smbd/service.c (file operations were being done after the
handle was closed).

It looks cleaner in smbd/conn.c as it is part of the closing of a conn
struct anyway.

Jeremy.
(This used to be commit 858eb53dc5)
2000-04-28 21:09:26 +00:00
Andrew Tridgell
67239541cd don't copy a null groups list
(This used to be commit d0fc1675df)
2000-04-22 08:28:49 +00:00
Andrew Tridgell
612682354f - got rid of the "passive" option
- cleaned up the standard_sub_*() calls a lot
(This used to be commit 2c2d95d77d)
2000-04-19 04:01:16 +00:00
Andrew Tridgell
2fa922611b finally got sick of the "extern int Client" code and the stupid
assumption that we have one socket everywhere

while doing so I discovered a few bugs!

1) the clientgen session retarget code if used from smbd or nmbd would
cause a crash as it called close_sockets() which closed our main
socket! fixed by removing close_sockets() completely - it is unnecessary

2) the caching in client_addr() and client_name() was bogus - it could
easily get fooled and give the wrong result. fixed.

3) the retarget could could recurse, allowing an easy denial of
service attack on nmbd. fixed.
(This used to be commit 5937ab14d2)
2000-04-11 13:55:53 +00:00
Tim Potter
16bb009dbb Mega-VFS merge. Yeah baby!
Synopsis: change every disk access function to work through a vfs_ops
structure contained in the connection_struct.
(This used to be commit 3aad500c0f)
2000-02-03 05:17:25 +00:00
Andrew Tridgell
69d24d869b first cut at using the tdb code for the connections structure, the
SWAT status page and smbstatus. It made the code _much_ simpler, I
wish we'd done a database module a long time ago!
(This used to be commit 4951755413)
1999-12-21 04:54:30 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76)
1999-12-13 13:27:58 +00:00
Luke Leighton
f6276724ba changed function name of get_home_dir() to get_unixhome_dir(), to stop
clash with gnu readline library.

fixed issue with [homes] service not being there - call lp_add_home()
just before starting the msrpc processing.
(This used to be commit 054195df9b)
1999-12-12 21:00:35 +00:00
Tim Potter
331ab45321 Copy service name into vfs_connection_struct.
(This used to be commit 19242cd44e)
1999-07-22 04:47:14 +00:00
Luke Leighton
73891ca8e4 improving authentication code (tidyup).
(This used to be commit ab1a6aa42d)
1999-06-29 18:47:06 +00:00
Tim Potter
731c7f2ecf Moved code that changes the pw_passwd entry (i.e shadow password and
weird unixware stuff) into _Get_Pwnam() to fix a memory allocation bug.

Note that the Get_Pwnam() function now returns a const struct passwd *
as a hint to other developers not to change entries in the struct
passwd.
(This used to be commit 36d7cb4ccc)
1999-06-13 04:14:24 +00:00
Tim Potter
b7100673fe Changed the way a VFS is initialised. The vfs_init() function is
executed from the VFS object file and it returns a pointer to a
vfs_ops structure.  If any of the function pointers in vfs_ops are
NULL, then they are replaced with the standard disk functions.  This
should allow disk-related VFS modules to be easily added.  I've
written an auditing VFS module which logs various calls (connect,
disconnect, mkdir, rmdir, open and a few others) to syslog in a couple
of pages of code.

Thanks to tridge for various useful suggestions.
(This used to be commit 346c78d707)
1999-04-20 03:37:11 +00:00
Tim Potter
69ae7902bb Disable VFS routines if no libdl available.
(This used to be commit cbfd8a8990)
1999-04-05 05:18:07 +00:00
Tim Potter
afc00dbd6f Call VFS initialisation, share connect and share disconnect functions.
Initialise VFS function pointers with symbols from the 'vfs object'
file, use disk pointers otherwise.

Added a hook to check for a 'default' VFS share (like the [homes]
section).  Currently empty - I'm unsure whether this will be useful or
not.
(This used to be commit 15805164fe)
1999-04-04 06:22:22 +00:00
Luke Leighton
d4385df3e8 trying to track down issues in get_home_dir().
(This used to be commit 2cce78aa00)
1998-12-14 20:21:39 +00:00
Andrew Tridgell
6192feac17 don't allow ".." in service name when doing "default service"
processing.
(This used to be commit 702263bba5)
1998-11-29 06:23:16 +00:00
Jeremy Allison
bfc38ff872 Makefile.in: Added maintainer mode fixes.
aclocal.m4: Added AC_LIBTESTFUNC.
configure.in: Fixed -lsecurity -lsec problems.
client.c: dos_ fixes.
groupdb/aliasunix.c: Dead code removal.
include/includes.h: Added default PRINTCAP_NAME.
lib/genrand.c: dos_ fixes.
lib/replace.c: Added strtoul.
lib/system.c: dos_ fixes.
lib/util.c: dos_ fixes.
lib/util_sid.c: Signed/unsigned fixes.
lib/util_str.c: removed bad const.
locking/locking_slow.c: dos_ fixes.
printing/printing.c: dos_ fixes.
rpc_server/srv_samr.c: Dead code removal.
rpc_server/srv_sid.c: global_myworkgroup defined with wrong size AGAIN !
smbd/dir.c: dos_ fixes.
smbd/open.c: dos_ fixes.
smbd/oplock.c: dos_ fixes.
smbd/reply.c smbd/server.c smbd/service.c smbd/uid.c: dos_ fixes.

Jeremy.
(This used to be commit 6acb4b68f6)
1998-11-25 21:17:20 +00:00
Luke Leighton
74d539f557 - group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.

- interactive debug detection

- re-added mem_man (andrew's memory management, detects memory corruption)

- american spellings of "initialise" replaced with english spelling of
  "initialise".

- started on "lookup_name()" and "lookup_sid()" functions.  proper ones.

- moved lots of functions around.  created some modules of commonly used
  code.  e.g the password file locking code, which is used in groupfile.c
  and aliasfile.c and smbpass.c

- moved RID_TYPE_MASK up another bit.  this is really unfortunate, but
  there is no other "fast" way to identify users from groups from aliases.
  i do not believe that this code saves us anything (the multipliers)
  and puts us at a disadvantage (reduces the useable rid space).
  the designers of NT aren't silly: if they can get away with a user-
  interface-speed LsaLookupNames / LsaLookupSids, then so can we.  i
  spoke with isaac at the cifs conference, the only time for example that
  they do a security context check is on file create.  certainly not on
  individual file reads / writes, which would drastically hit their
  performance and ours, too.

- renamed myworkgroup to global_sam_name, amongst other things, when used
  in the rpc code.  there is also a global_member_name, as we are always
  responsible for a SAM database, the scope of which is limited by the role
  of the machine (e.g if a member of a workgroup, your SAM is for _local_
  logins only, and its name is the name of your server.  you even still
  have a SID.  see LsaQueryInfoPolicy, levels 3 and 5).

- updated functionality of groupname.c to be able to cope with names
  like DOMAIN\group and SERVER\alias.  used this code to be able to
  do aliases as well as groups.  this code may actually be better
  off being used in username mapping, too.

- created a connect to serverlist function in clientgen.c and used it
  in password.c

- initialisation in server.c depends on the role of the server.  well,
  it does now.

- rpctorture.  smbtorture.  EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e609)
1998-11-17 16:19:04 +00:00
Jeremy Allison
9066025a8a Got very strict about the differences and uses of
uid_t, gid_t and vuid. Added sys_getgroups() to get
around the int * return problem. Set correct datatypes
for all uid, gid and vuid variables.
Jeremy.
(This used to be commit e570db46fc)
1998-09-29 20:24:17 +00:00
Andrew Tridgell
c3effa8b59 this completes the splitup of server.c.
the splitup was done with an axe, not a scalpel, so there are some
rough edges. I mostly wanted to get the general form right with fine
tuning of what goes where to come later. Still, this is better than
what we had before where server.c was a general repository for
anything that didn't fit elsewhere.
(This used to be commit a6d194886a)
1998-08-17 13:11:34 +00:00