Mailing List Archive

Need help adding symlink-like capability to Apache on NT
We've devised a system for using shortcuts like symlinks. What we need to
do is, given a url that may contain "symlinks", we need to internally
resolve that name into a full NT path so that apache works with the correct
file/directory. We have the code for this, but we aren't quite sure what
entry points in the code to work with (started looking at the source today).
Can anyone provide some hints?

Thanks,

Bret McMillan
Re: Need help adding symlink-like capability to Apache on NT [ In reply to ]
Bret McMillan wrote:
>
> We've devised a system for using shortcuts like symlinks. What we need to
> do is, given a url that may contain "symlinks", we need to internally
> resolve that name into a full NT path so that apache works with the correct
> file/directory. We have the code for this, but we aren't quite sure what
> entry points in the code to work with (started looking at the source today).
> Can anyone provide some hints?
>
> Thanks,
>
> Bret McMillan


So, basically, you are saying that everything 'outside' of the
DocRoot and/or CGI directories are available to the 'public'?

Not sure that is what you want to do...

Just thinking out loud...
-Sneex- :]
______________________________________________________________________
Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
http://certserver.pgp.com:11371/pks/lookup?op=get&search=0x37EFC00F
Re: Need help adding symlink-like capability to Apache on NT [ In reply to ]
You have a valid concern... let me explain a bit more. Right now,
shortcuts are used in place of symlinks.
If you had a "foo" symlink on the linux version, on the nt version it is
represented by "foo.lnk". These shortcut files are created at install time.

Assume foo.lnk exists in your httpdoc directory. Assume foo.lnk links to
C:\Bret\, in which HelloWord.html exists.

What I want to happen is for a url request of
"http://www.server.com/foo/HelloWorld.html" displays the contents of
HelloWorld.html.

We have an executable program that will do this:

Commandline: "slink foo/HelloWorld.html"
Cout's: "/bret/HelloWorld.html"

So that part is essentially done. What we're trying to figure out is where
to integrate that into apache's code.

Thanks for any and all info,

Bret

-----Original Message-----
From: Bill Jones, FCCJ Webmaster <webmaster@fccj.org>
To: apache-docs@apache.org <apache-docs@apache.org>
Date: Tuesday, January 05, 1999 1:39 PM
Subject: Re: Need help adding symlink-like capability to Apache on NT


>Bret McMillan wrote:
>>
>> We've devised a system for using shortcuts like symlinks. What we need
to
>> do is, given a url that may contain "symlinks", we need to internally
>> resolve that name into a full NT path so that apache works with the
correct
>> file/directory. We have the code for this, but we aren't quite sure what
>> entry points in the code to work with (started looking at the source
today).
>> Can anyone provide some hints?
>>
>> Thanks,
>>
>> Bret McMillan
>
>
>So, basically, you are saying that everything 'outside' of the
>DocRoot and/or CGI directories are available to the 'public'?
>
>Not sure that is what you want to do...
>
>Just thinking out loud...
>-Sneex- :]
>______________________________________________________________________
>Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
> http://certserver.pgp.com:11371/pks/lookup?op=get&search=0x37EFC00F
>
Re: Need help adding symlink-like capability to Apache on NT [ In reply to ]
Read the docs for mod_rewrite. If you really want to invoke an external
program to do the mappings it's trivial, you don't need to change the code
at all. In any event, what you want can be done in a module, you don't
need to patch the core.

Dean

On Tue, 5 Jan 1999, Bret McMillan wrote:

> You have a valid concern... let me explain a bit more. Right now,
> shortcuts are used in place of symlinks.
> If you had a "foo" symlink on the linux version, on the nt version it is
> represented by "foo.lnk". These shortcut files are created at install time.
>
> Assume foo.lnk exists in your httpdoc directory. Assume foo.lnk links to
> C:\Bret\, in which HelloWord.html exists.
>
> What I want to happen is for a url request of
> "http://www.server.com/foo/HelloWorld.html" displays the contents of
> HelloWorld.html.
>
> We have an executable program that will do this:
>
> Commandline: "slink foo/HelloWorld.html"
> Cout's: "/bret/HelloWorld.html"
>
> So that part is essentially done. What we're trying to figure out is where
> to integrate that into apache's code.
>
> Thanks for any and all info,
>
> Bret
>
> -----Original Message-----
> From: Bill Jones, FCCJ Webmaster <webmaster@fccj.org>
> To: apache-docs@apache.org <apache-docs@apache.org>
> Date: Tuesday, January 05, 1999 1:39 PM
> Subject: Re: Need help adding symlink-like capability to Apache on NT
>
>
> >Bret McMillan wrote:
> >>
> >> We've devised a system for using shortcuts like symlinks. What we need
> to
> >> do is, given a url that may contain "symlinks", we need to internally
> >> resolve that name into a full NT path so that apache works with the
> correct
> >> file/directory. We have the code for this, but we aren't quite sure what
> >> entry points in the code to work with (started looking at the source
> today).
> >> Can anyone provide some hints?
> >>
> >> Thanks,
> >>
> >> Bret McMillan
> >
> >
> >So, basically, you are saying that everything 'outside' of the
> >DocRoot and/or CGI directories are available to the 'public'?
> >
> >Not sure that is what you want to do...
> >
> >Just thinking out loud...
> >-Sneex- :]
> >______________________________________________________________________
> >Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
> > http://certserver.pgp.com:11371/pks/lookup?op=get&search=0x37EFC00F
> >
>
>
Re: Need help adding symlink-like capability to Apache on NT [ In reply to ]
Bret McMillan wrote:
>
> You have a valid concern... let me explain a bit more. Right now,
> shortcuts are used in place of symlinks.
> If you had a "foo" symlink on the linux version, on the nt version it is
> represented by "foo.lnk". These shortcut files are created at install time.
>
> Assume foo.lnk exists in your httpdoc directory. Assume foo.lnk links to
> C:\Bret\, in which HelloWord.html exists.
>
> What I want to happen is for a url request of
> "http://www.server.com/foo/HelloWorld.html" displays the contents of
> HelloWorld.html.
>
> We have an executable program that will do this:
>
> Commandline: "slink foo/HelloWorld.html"
> Cout's: "/bret/HelloWorld.html"
>
> So that part is essentially done. What we're trying to figure out is where
> to integrate that into apache's code.
>
> Thanks for any and all info,
>
> Bret
>
> -----Original Message-----
> From: Bill Jones, FCCJ Webmaster <webmaster@fccj.org>
> To: apache-docs@apache.org <apache-docs@apache.org>
> Date: Tuesday, January 05, 1999 1:39 PM
> Subject: Re: Need help adding symlink-like capability to Apache on NT
>
> >Bret McMillan wrote:
> >>
> >> We've devised a system for using shortcuts like symlinks. What we need
> to
> >> do is, given a url that may contain "symlinks", we need to internally
> >> resolve that name into a full NT path so that apache works with the
> correct
> >> file/directory. We have the code for this, but we aren't quite sure what
> >> entry points in the code to work with (started looking at the source
> today).
> >> Can anyone provide some hints?
> >>
> >> Thanks,
> >>
> >> Bret McMillan
> >
> >
> >So, basically, you are saying that everything 'outside' of the
> >DocRoot and/or CGI directories are available to the 'public'?
> >
> >Not sure that is what you want to do...
> >
> >Just thinking out loud...
> >-Sneex- :]
> >______________________________________________________________________
> >Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
> > http://certserver.pgp.com:11371/pks/lookup?op=get&search=0x37EFC00F
> >


Dean, in another reply, has a valid point with mod_rewrite; however,
my question would be -

Did it work right under Linux with the soft links?

Allowing soft (or hard) links outside of DocRoot is not
a good idea, at any rate. I know that Apache's cgi
functionality doesn't follow links when they are
cgi-centric, not sure about NT.

Apache is a great WWW server, but modifying the core
distribution, especially in NT, isn't a good idea.

Anyways, if I remember correctly, all you need to do
is turn on WWW-centric shares for the content you
wish to share. I have never gotten Apache to
follow a link on NT. But, I do use Unix servers
more, so there may be another way...

HTH,
-Sneex- :]
______________________________________________________________________
Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
http://certserver.pgp.com:11371/pks/lookup?op=get&search=0x37EFC00F
Re: Need help adding symlink-like capability to Apache on NT [ In reply to ]
I'm looking at http://www.engelschall.com/pw/apache/rewriteguide/#ToC4 right
now, at the bottom for an external rewriting engine...

wouldn't this take "http://www.server.com/foo/HelloWorld.html" and then just
basically ask apache to find a document "http://www.server.com/..\..\[as
many as needed to get to root dir]/bret/HelloWorld.html" ?
Wouldn't that open a large security hole?

Bret

-----Original Message-----
From: Dean Gaudet <dgaudet@arctic.org>
To: apache-docs@apache.org <apache-docs@apache.org>
Date: Tuesday, January 05, 1999 2:10 PM
Subject: Re: Need help adding symlink-like capability to Apache on NT


>Read the docs for mod_rewrite. If you really want to invoke an external
>program to do the mappings it's trivial, you don't need to change the code
>at all. In any event, what you want can be done in a module, you don't
>need to patch the core.
>
>Dean
>
>On Tue, 5 Jan 1999, Bret McMillan wrote:
>
>> You have a valid concern... let me explain a bit more. Right now,
>> shortcuts are used in place of symlinks.
>> If you had a "foo" symlink on the linux version, on the nt version it is
>> represented by "foo.lnk". These shortcut files are created at install
time.
>>
>> Assume foo.lnk exists in your httpdoc directory. Assume foo.lnk links to
>> C:\Bret\, in which HelloWord.html exists.
>>
>> What I want to happen is for a url request of
>> "http://www.server.com/foo/HelloWorld.html" displays the contents of
>> HelloWorld.html.
>>
>> We have an executable program that will do this:
>>
>> Commandline: "slink foo/HelloWorld.html"
>> Cout's: "/bret/HelloWorld.html"
>>
>> So that part is essentially done. What we're trying to figure out is
where
>> to integrate that into apache's code.
>>
>> Thanks for any and all info,
>>
>> Bret
Re: Need help adding symlink-like capability to Apache on NT [ In reply to ]
Bret McMillan wrote:
>
> I'm looking at http://www.engelschall.com/pw/apache/rewriteguide/#ToC4 right
> now, at the bottom for an external rewriting engine...
>
> wouldn't this take "http://www.server.com/foo/HelloWorld.html" and then just
> basically ask apache to find a document "http://www.server.com/..\..\[as
> many as needed to get to root dir]/bret/HelloWorld.html" ?
> Wouldn't that open a large security hole?
>
> Bret
>

Hmmm... I don't think so, but I've been wrong before...

Under Unix you could backtrack to the /etc/shadow or
something... Not a good thing...

-Sneex-
______________________________________________________________________
Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
http://certserver.pgp.com:11371/pks/lookup?op=get&search=0x37EFC00F
Re: Need help adding symlink-like capability to Apache on NT [ In reply to ]
Oh maybe it doesn't let you rewrite to filenames. I was pretty sure it
did.

Dean

On Tue, 5 Jan 1999, Bret McMillan wrote:

> I'm looking at http://www.engelschall.com/pw/apache/rewriteguide/#ToC4 right
> now, at the bottom for an external rewriting engine...
>
> wouldn't this take "http://www.server.com/foo/HelloWorld.html" and then just
> basically ask apache to find a document "http://www.server.com/..\..\[as
> many as needed to get to root dir]/bret/HelloWorld.html" ?
> Wouldn't that open a large security hole?
>
> Bret
>
> -----Original Message-----
> From: Dean Gaudet <dgaudet@arctic.org>
> To: apache-docs@apache.org <apache-docs@apache.org>
> Date: Tuesday, January 05, 1999 2:10 PM
> Subject: Re: Need help adding symlink-like capability to Apache on NT
>
>
> >Read the docs for mod_rewrite. If you really want to invoke an external
> >program to do the mappings it's trivial, you don't need to change the code
> >at all. In any event, what you want can be done in a module, you don't
> >need to patch the core.
> >
> >Dean
> >
> >On Tue, 5 Jan 1999, Bret McMillan wrote:
> >
> >> You have a valid concern... let me explain a bit more. Right now,
> >> shortcuts are used in place of symlinks.
> >> If you had a "foo" symlink on the linux version, on the nt version it is
> >> represented by "foo.lnk". These shortcut files are created at install
> time.
> >>
> >> Assume foo.lnk exists in your httpdoc directory. Assume foo.lnk links to
> >> C:\Bret\, in which HelloWord.html exists.
> >>
> >> What I want to happen is for a url request of
> >> "http://www.server.com/foo/HelloWorld.html" displays the contents of
> >> HelloWorld.html.
> >>
> >> We have an executable program that will do this:
> >>
> >> Commandline: "slink foo/HelloWorld.html"
> >> Cout's: "/bret/HelloWorld.html"
> >>
> >> So that part is essentially done. What we're trying to figure out is
> where
> >> to integrate that into apache's code.
> >>
> >> Thanks for any and all info,
> >>
> >> Bret
>
>
>
Re: Need help adding symlink-like capability to Apache on NT [ In reply to ]
In article <Pine.LNX.3.96dg4.990105121141.3636G-100000@twinlark.arctic.org> you wrote:

> Oh maybe it doesn't let you rewrite to filenames. I was pretty sure it
> did.

You can rewrite directly to filenames.

Ralf S. Engelschall
rse@engelschall.com
www.engelschall.com