summaryrefslogtreecommitdiff
path: root/source3/web/cgi.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-03-17 12:31:43 +0000
committerAndrew Tridgell <tridge@samba.org>1998-03-17 12:31:43 +0000
commitf996885676f041437430bfd5843a3000611b0923 (patch)
treefb9dd798b00edbf3cb7f7cdb3cdaae8c666a7358 /source3/web/cgi.c
parent59d7006b05bb301e36f786b047b90ab9ef5be122 (diff)
downloadsamba-f996885676f041437430bfd5843a3000611b0923.tar.gz
samba-f996885676f041437430bfd5843a3000611b0923.tar.bz2
samba-f996885676f041437430bfd5843a3000611b0923.zip
this isn't a big commit, it just looks like it :-)
I needed the client_name() and client_addr() functions in swat so I could tell who was connecting from where. The problem was that these functions didn't take a file descriptor parameter they just used the global "Client". So I needed to change all calls to pass a parameter ... lots of files. (This used to be commit a776058900a727591bd7b69debdaa25c0e31d693)
Diffstat (limited to 'source3/web/cgi.c')
-rw-r--r--source3/web/cgi.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index 46654b1303..9931ca1468 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -665,3 +665,24 @@ char *cgi_pathinfo(void)
return r;
}
+/***************************************************************************
+return the hostname of the client
+ ***************************************************************************/
+char *cgi_remote_host(void)
+{
+ if (baseurl) {
+ return client_name(1);
+ }
+ return getenv("REMOTE_HOST");
+}
+
+/***************************************************************************
+return the hostname of the client
+ ***************************************************************************/
+char *cgi_remote_addr(void)
+{
+ if (baseurl) {
+ return client_addr(1);
+ }
+ return getenv("REMOTE_ADDR");
+}