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

216 Commits

Author SHA1 Message Date
Andrew Tridgell
8f9478b09d r9504: use some low level ejs hackery to give much better exception error messages in both
the web server and smbscript. We can now give backtraces for all internal asserts, not
just high level errors
(This used to be commit 84c756b25c)
2007-10-10 13:34:23 -05:00
Andrew Tridgell
fd74e3e1f5 r9409: fix a problem that volker noticed with web page timeouts causing smbd
to crash. This is one of the downsides of the fact that the ejs engine
is not event driven, resulting in the rendering of each web page being
'semi-async'. We need to protect the web context from the timeout
processing until we have unwound the stack back to the point that the
'web' variable representing the page rendering logic won't be used any
more.
(This used to be commit 97e3c9eaf1)
2007-10-10 13:33:34 -05:00
Andrew Tridgell
b60ef4ee09 r9389: handle errors reading from files in web server
bug found by coverity
(This used to be commit 1a3229777a)
2007-10-10 13:33:32 -05:00
Andrew Tridgell
a663d21106 r9183: more workarounds for the global variables in ejs. I will discuss getting rid of these
with the mbedthis people.
(This used to be commit a5b9e74a5c)
2007-10-10 13:31:29 -05:00
Andrew Tridgell
9811a3981b r9179: cope with simultaneous web requests using the same session variable
(This used to be commit 7d6e601219)
2007-10-10 13:31:29 -05:00
Andrew Tridgell
71f8de6bb3 r9122: cope with trailing garbage in POST contents in the web server
(This used to be commit de0ac6a9d6)
2007-10-10 13:31:18 -05:00
Andrew Tridgell
9abc667c71 r8726: increase default session timeout to 15 minutes to be less painful for developers
(This used to be commit d40e590674)
2007-10-10 13:29:59 -05:00
Andrew Tridgell
c7ca980ca9 r8665: fixed a segv at high debug level in the web server
thanks to volker for finding this
(This used to be commit e02d7753f7)
2007-10-10 13:29:51 -05:00
Andrew Tridgell
53ffd147bd r8632: use <pre> around displayed exceptions
(This used to be commit 001917cc9d)
2007-10-10 13:29:46 -05:00
Andrew Tridgell
e835621799 r8520: fixed a pile of warnings from the build farm gcc -Wall output on
S390. This is an attempt to avoid the panic we're seeing in the
automatic builds.

The main fixes are:

 - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats

 - use of NULL format statements to perform dn searches.

 - assumption that sizeof() returns an int
(This used to be commit a58ea6b385)
2007-10-10 13:29:34 -05:00
Andrew Tridgell
a0bc4da1a3 r8483: switched our generated ejs rpc code over to the new OO interface. This
means we don't pollute the name space, and also makes for faster
startup times as we only create variables for the pipes that we use,
not all pipes
(This used to be commit 57d7a585e8)
2007-10-10 13:23:08 -05:00
Andrew Tridgell
7b8332369f r8482: gnutls_x509_crt_set_subject_key_id is not available in some versions
of gnutls. Thanks to ab for spotting this.
(This used to be commit 437c4057ae)
2007-10-10 13:23:08 -05:00
Andrew Tridgell
adbb1612c1 r8399: move the ejs and esp code closer to the directory layout used by the
upstream sources. This makes it much easier to keep it up to date.

I will separate out the mpr code into lib/appweb/mpr next
(This used to be commit 52db7a052b)
2007-10-10 13:22:39 -05:00
Love Hörnquist Åstrand
91163c518c r8361: ctype is* macros needs unsigned arguments
(This used to be commit 07a7ab0a6a)
2007-10-10 13:20:11 -05:00
Tim Potter
9d70babef1 r8351: When finished sending call stream_terminate_connection() with a nice
message instead of NULL.

Fix up some other terminate messgages to be consistent.
(This used to be commit c0428ef337)
2007-10-10 13:20:10 -05:00
Andrew Tridgell
8ca17e2f47 r8255: enable access to the ejs constants generated by pidl from the web server esp pages
(This used to be commit 354cdf893d)
2007-10-10 13:19:26 -05:00
Andrew Tridgell
b3e493470f r7911: task_terminate() is defined in the macosx headers, so change the name
to task_server_terminate()
(This used to be commit a7447e25ac)
2007-10-10 13:18:48 -05:00
Andrew Tridgell
7a17da2186 r7751: only enable tls on the ldaps port in ldap server, and reject non-tls
connections on that port
(This used to be commit 30da6a1cc4)
2007-10-10 13:18:31 -05:00
Andrew Tridgell
822498b7f5 r7744: converted the web server to use the lib/tls/ generic tls code
(This used to be commit 023fc567ba)
2007-10-10 13:18:30 -05:00
Volker Lendecke
84ee48e3e9 r7441: Get rid of // comments. Tridge, if this breaks anything, please revert it. More tomorrow
Volker
(This used to be commit 02efa4427d)
2007-10-10 13:17:54 -05:00
Simo Sorce
6eb8838190 r7236: uhmm this require to be in too
(This used to be commit 3b5fc036f3)
2007-10-10 13:17:30 -05:00
Simo Sorce
4a08acec08 r7235: We do not need PAM here anymore
(This used to be commit f338697edd)
2007-10-10 13:17:30 -05:00
Simo Sorce
d640d12673 r7234: that code path is died
(This used to be commit efbfabdefa)
2007-10-10 13:17:29 -05:00
Simo Sorce
9783b104e6 r7231: remove some old stuff
(This used to be commit 2e3316be9f)
2007-10-10 13:17:29 -05:00
Stefan Metzmacher
b60ea95547 r7179: remove compiler warnings
metze
(This used to be commit 0e1b1c3937)
2007-10-10 13:17:23 -05:00
Stefan Metzmacher
b035f34168 r7177: fill in REMOTE_ADDR correctly
metze
(This used to be commit aab9b953da)
2007-10-10 13:17:22 -05:00
Jelmer Vernooij
e4a505192d r7166: Move replacement stuff to seperate directory
(easier to add win32-specific bits later)
Trim LIBBASIC a bit more
(This used to be commit fc7f519e4a)
2007-10-10 13:17:22 -05:00
Andrew Tridgell
43bc09e2aa r7107: detect when a users session has expired and set request['SESSION_EXPIRED']
(This used to be commit 0c2e42986c)
2007-10-10 13:17:17 -05:00
Andrew Tridgell
5aaaa7ef0e r7104: add support into the web server for session[] variables without cookies by using
query strings
(This used to be commit 6ca3e3af89)
2007-10-10 13:17:17 -05:00
Andrew Tridgell
bb2a811bf4 r7087: always run the /scripting/preauth.esp page before processing any
request. If this page produces any output then that output is sent to
the browser and the request is not processed

This allows us to ensure that all pages are authenticated
(This used to be commit 6a876d6611)
2007-10-10 13:17:14 -05:00
Andrew Tridgell
ec4bdc172e r7086: make include() recognise the ".esp" extension and include the file as
an esp script instead of as a ejs script
(This used to be commit af97ded8d4)
2007-10-10 13:17:14 -05:00
Andrew Tridgell
6782622296 r7079: remember to register the esp calls
(This used to be commit ab27e58c08)
2007-10-10 13:17:13 -05:00
Andrew Tridgell
8754c793bf r7072: moved the esp hooks calls to the ejs level, so we can call them from
both esp scripts and ejs scripts. This allows the smbscript program to
call all the existing extension calls like lpGet() and ldbSearch()

Also fixed smbscript to load smb.conf, and setup logging for DEBUG()

I left the unixAuth() routine in web_server/calls.c at the moment, as
that is really only useful for esp scripts. I imagine that as we
extend esp/ejs, we will put some functions in scripting/ejs/ for use
in both ejs and esp, and some functions in web_server/ where they will
only be accessed by esp web scripts
(This used to be commit e59ae64f60)
2007-10-10 13:17:12 -05:00
Tim Potter
b7ed3fa7d2 r7068: Missed one!
(This used to be commit cebbce9bf5)
2007-10-10 13:17:11 -05:00
Andrew Tridgell
bd027bd015 r7067: older versions of gnutls don't have GNUTLS_KP_TLS_WWW_SERVER
(This used to be commit 9b568eb957)
2007-10-10 13:17:11 -05:00
Tim Potter
7756b990f3 r7066: Rename http_exception to ejs_exception.
(This used to be commit f2e59d3adf)
2007-10-10 13:17:11 -05:00
Tim Potter
14ade23914 r7065: Move ejs from web_server to lib so it can be shared with smbscript.
(This used to be commit b83dc8fbfb)
2007-10-10 13:17:11 -05:00
Tim Potter
0befec0920 r7060: Fix use of uninitialised variable.
(This used to be commit 7568fcbfc5)
2007-10-10 13:17:10 -05:00
Simo Sorce
26ced62131 r7058: Add experimenthal pam authentication for web pages
(This used to be commit 36d9054074)
2007-10-10 13:17:10 -05:00
Simo Sorce
1586af2d42 r7057: remove some ^M at end of lines
(This used to be commit 1fb60dc07d)
2007-10-10 13:17:10 -05:00
Andrew Tridgell
c77ea0c100 r7055: automatically add the dn to all ldbSearch results
(This used to be commit d6fa280808)
2007-10-10 13:17:09 -05:00
Andrew Tridgell
cab11d1fa5 r7053: added a ldbSearch() call to esp
It takes two forms, one with a set of attributes, the other without:

	res = ldbSearch("dbfile", "expression");

        var attrs = new Array("attr1", "attr2", "attr3");
	res = ldbSearch("dbfile", "expression", attrs);
(This used to be commit 1ba602e32b)
2007-10-10 13:17:09 -05:00
Andrew Tridgell
5aacc765e1 r7051: remove an unused file
(This used to be commit 7e6fbd4889)
2007-10-10 13:17:09 -05:00
Stefan Metzmacher
27284d47af r7050: fix linking of smbd
metze
(This used to be commit d2af8eaefa)
2007-10-10 13:17:09 -05:00
Andrew Tridgell
c22d20edb4 r7048: added auto-generation of TLS self-signed certificates if none exist already
This allows smbd to be setup from scratch over ssl without having to
know how to create valid certificates (which can be quite tricky
unless you've done it before)

Of course, a good admin will provide real certificates, and smbd will
use them if specified
(This used to be commit 00b67efc99)
2007-10-10 13:17:08 -05:00
Andrew Tridgell
2b0607248a r7047: rearranged the tls code a bit, and improved the error messages when it fails
(This used to be commit f54533dfba)
2007-10-10 13:17:08 -05:00
Andrew Tridgell
38c2164f68 r7023: reduced the number of warnings in building ejs and esp
(This used to be commit ef998f9f8f)
2007-10-10 13:17:07 -05:00
Andrew Tridgell
4979181861 r7019: - added esp call lpServices() which returns a list of services in smb.conf.
- added a test of lpServices() in the esptest scripts
(This used to be commit 94308d8fed)
2007-10-10 13:17:07 -05:00
Andrew Tridgell
67a38fc159 r7017: added a esp variable server['TLS_SUPPORT'] which tells the script if the server
can support TLS. This will allow us to auto-redirect if a user connects using the
wrong protocol
(This used to be commit fbf4552cd5)
2007-10-10 13:17:06 -05:00
Andrew Tridgell
f466b72222 r7016: - added smb.conf parm 'web tls = true/false'
- by default enable tls if the certfile is set in smb.conf and gnutls library
  was compiled in
(This used to be commit bbafdeae3a)
2007-10-10 13:17:06 -05:00
Andrew Tridgell
b63ce2f479 r7014: added Content-Length header to both esp and non-esp output
(This used to be commit e0673dcfc0)
2007-10-10 13:17:06 -05:00
Andrew Tridgell
ebb0b35242 r7013: added tls support to the builtin web server. It auto-detects if the client
is using tls by looking at the first byte on the connection. This allows
both https and http services to be on the same port
(This used to be commit 6369dfb658)
2007-10-10 13:17:06 -05:00
Stefan Metzmacher
1454d5a4cf r7009: the correct for maing it all build with my gcc-4.0
I assume the problem is caused by including a precompiled header twice...

metze
(This used to be commit 45f8b5dfa1)
2007-10-10 13:17:05 -05:00
Andrew Tridgell
ab78cc9dca r7008: - split out the loadparm type definitions so loadparm internals can be accessed externally
- moved esp_lpGet() to web_server/calls.c

- attempt to fixup ejs build with includes.h again
(This used to be commit 592a81c347)
2007-10-10 13:17:05 -05:00
Andrew Tridgell
7c64c91468 r7007: try to get ejs compiling again
(This used to be commit 9bba51330d)
2007-10-10 13:17:05 -05:00
Stefan Metzmacher
273a4cda73 r7006: fix a build problem with my gcc-4.0
metze
(This used to be commit 3e2b4eda5f)
2007-10-10 13:17:05 -05:00
Andrew Tridgell
2cdce8d1aa r7004: added support for exceptions generated in the esp library. If the OS
supports setjmp/longjmp then the exception will generate a error in
the web page and the Samba log. If the OS doesn't support setjmp then
we will abort.
(This used to be commit 2614ace175)
2007-10-10 13:17:05 -05:00
Andrew Tridgell
1511cde44c r7002: added support for getting at loadparm config parameters via lpGet() in esp scripts
lpGet takes 4 forms
    v = lpGet("type:parm");             gets a parametric variable
    v = lpGet("share", "type:parm");    gets a parametric variable on a share
    v = lpGet("parm");                  gets a global variable
    v = lpGet("share", "parm");         gets a share variable

in all cases a ejs object of the appropriate type for the variable is returned.

This commit also adds the function typeof() which returns the type of an object
(This used to be commit 5537a0d38d)
2007-10-10 13:17:04 -05:00
Andrew Tridgell
1ddf07bd63 r7000: only keep session data if not empty - this saves us using lots of memory needlessly
(This used to be commit cee3caba92)
2007-10-10 13:17:04 -05:00
Andrew Tridgell
fc45b63e47 r6998: - added support for application[] data, which is global to all clients using the web server.
This allows for things like
     application['state'] = "shuttting down"
  and then every web client can see that the server is going down

- added support for session[] data. This allows web pages to store
  long term data specific to this client. It relies on
  cookies. Sessions auto timeout (default timeout 5 minutes). The
  timeout can be set in the scripts.

- changed from processing all .html files as esp, to only processing
  .esp files as esp. This makes it easier to compare the samba web
  server to appWeb as a reference implementation.

- expanded the number of standard variables setup by esp. See the
  showvars.esp example page for all variables.
(This used to be commit c418b23c2e)
2007-10-10 13:17:03 -05:00
Andrew Tridgell
b8c4565845 r6990: apparently some systems define UNUSED :-)
(This used to be commit 696b6f2a9b)
2007-10-10 13:17:03 -05:00
Andrew Tridgell
74dda39226 r6989: - added support for esp style includes (which include a esp file, instead of a ejs file)
- added a test of esp style includes to the esptest html
(This used to be commit af3de9468e)
2007-10-10 13:17:03 -05:00
Andrew Tridgell
44d2a46580 r6987: - make sure esp pages cannot read data outside of the swat directory
- don't expose the real system path to esp scripts

- fixed absolute paths in include() calls
(This used to be commit 6535611aa2)
2007-10-10 13:17:02 -05:00
Andrew Tridgell
e8e8eab400 r6986: added support for <% include("somefile.ejs") %> for including common scripts
(This used to be commit e54b31904c)
2007-10-10 13:17:02 -05:00
Andrew Tridgell
7e58231952 r6982: install the swat pages with 'make installswat'
(This used to be commit 31543e1eae)
2007-10-10 13:17:02 -05:00
Andrew Tridgell
d70912a26a r6981: first version of the builtin web server for Samba4
This includes an embedded server side scripting system called 'esp'
(see http://www.appwebserver.org/products/esp/esp.html) and javascript
based scripting language called 'esj' (see
http://www.appwebserver.org/products/ejs/ejs.html)

The justification for including this scripting language is that it
should make it much easier to write a high quality web interface for
Samba4. The scripting language can call into any Samba4 library code
(so for example it will be able to make ldb and loadparm calls), plus
it provides easy support for forms, cookies, sessions etc.

There is still quite a bit more work to do on the web server, but
there is enough here now for people to look at and comment. I will be
committing some sample web pages that test esp functionality shortly.
(This used to be commit 26f0ba92c0)
2007-10-10 13:17:01 -05:00