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

238 Commits

Author SHA1 Message Date
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