Re: [Proftpd-user] HideFiles and regex help needed
David Wells <d.wells <at> vitalcan.com.ar>
2007-06-13 16:02:24 GMT
Thanx a lot Richard, just what I needed, it's working perfectly now
Gray, Richard escribió:
> Hi David
>
> Have a look at the documentation for the HideFiles directive:
>
> http://www.proftpd.org/docs/directives/linked/config_ref_HideFiles.html
>
> In the examples section, the first two examples show the same regex with and without quotes - there is a
small difference.
>
> Your regexp looks essentially correct, but you should either lose the quotes, or escape the backslash
with another backslash.
>
> e.g.
> HideFiles (^|/)\.
> or
> HideFiles "(^|/)\\."
>
> Also, as mentioned in the docs, you might want to have a look at the IgnoreHidden directive as well.
>
> Richard
> ________________________________
>
> From: proftp-user-bounces <at> lists.sourceforge.net
[mailto:proftp-user-bounces <at> lists.sourceforge.net] On Behalf Of David Wells
> Sent: Monday, June 11, 2007 9:50 PM
> To: proftp-user <at> lists.sourceforge.net
> Subject: Re: [Proftpd-user] HideFiles and regex help needed
>
>
> Hi Thomas, thank you very much!!! I did some slight modifications and worked like a charm!!!
> I replaced your regex with the following "(^|/)\.bash|(^|/)\.ssh|(^|/)\Maildir" and all .bash*,
.ssh* and Maildir/* are simply ignored completely. What I did try was "(^|/)\." to vanish all .* files but
this way I cannot list any files. Do you or anybody else have by any chance some sugestion on how to acomplish this?
>
> Thanx a lot, David Wells.
>
> Thomas L. Shinnick escribió:
>
> At 01:34 PM 6/8/2007, David Wells wrote:
>
>
> Hi everybody!
>
> I have set up proftp so my users can log in into the server and they get chrooted into their ~/ directory.
Everything works fine up to there. The problem I'm having is that I need to hide the users ~/.* files and
directories and some directories such as ~/Maildir/. I've been trying to use the "HideFiles" directive
with no kind of success and I have no experience writing a regex so I would very much appreciate if someone
could help me.
>
> Thanx in advance, David.
>
>
> In my production setup I wanted everyone to have their own message files, ala
> # When users chdir into new directory, display '.message'
> DisplayFirstChdir .msg.chdir
>
> So naturally I didn't want the users (or at least the remote users) to be able to affect those files. So I used
> HideFiles "(^|/)\.msg\."
>
> This says to 'hide' a file if the whole filepath begins_with .msg. or if an internal part of the filepath
contains /.msg.
>
> The key is the (^|/) part which says beginning of the whole path, or anywhere following a path separator,
which catches a bare ".msg.foo" or "no/.msg.is/added"
>
> You might have to experiment, as I don't remember if the complete path to the file is matched against. The
question is whether
> HideFiles "^Maildir"
> might also unintentionally hide file "/saves/Maildir.tar.gz" if the user was already CD'd into
"/saves" and says "dir *.gz"
>
> ________________________________
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ________________________________
>
>
> _______________________________________________
> ProFTPD Users List <proftpd-users <at> proftpd.org> <mailto:proftpd-users <at> proftpd.org>
> Unsubscribe problems?
> http://www.proftpd.org/list-unsub.html
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> This message is intended only for the personal and confidential use of the designated recipient(s) named
above. If you are not the intended recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly prohibited. This communication is
for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer
to buy any financial product, an official confirmation of any transaction, or as an official statement of
Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do
not represent that this information is complete or accurate and it should not be relied upon as such. All
information is subject to change without notice.
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> ProFTPD Users List <proftpd-users <at> proftpd.org>
> Unsubscribe problems?
> http://www.proftpd.org/list-unsub.html
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
ProFTPD Users List <proftpd-users <at> proftpd.org>
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html