LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-23-2011, 01:40 PM   #1
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Rep: Reputation: 1
one small question/ in Squid ACL


acl FILE_MP3 urlpath_regex -i \.mp3$
http_access deny FILE_MP3

I HAVE SET THIS RULE; ACL rule in Squid to block downloading of .mp3 files

But I don't understand the purpose of "\".mp3$ here the "\"?
even without it ("\") I am able to block downloading od mp3 files and what is purpose "$" ich at the end?
 
Old 04-23-2011, 01:44 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
the \ escapes the .

without out it, the string means "any character followed by m, p, 3 and then the end of the line". With it it means ". followed by m, then p, then 4 then end of line. So without it, a path like "http://domain.com/winamp3" would match, when it is not likely to actually be an mp3 file, but a directory. Obviously things like mime types are relevant here as well, but at that level that's the difference.
 
Old 04-23-2011, 01:50 PM   #3
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
Sorry I could not understand!!
 
Old 04-23-2011, 03:15 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by manalisharmabe
... and what is purpose "$" ich at the end?
That's another regex character that matches "end of string" or "end of line". If you didn't have that one in place, you could accidentally match URL paths like /downloads/foo.mp313/pr0n.wma.

And if you don't understand the replies you're receiving, please search the 'net for "regex tutorial".
 
1 members found this post helpful.
Old 04-24-2011, 02:29 AM   #5
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
i undestood anomie words!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SQUID: Can anyone help me out with the ACL's foubie Linux - Server 5 10-07-2009 08:55 AM
Squid ACL Question LinuxLuvr Linux - Server 1 12-02-2008 11:11 AM
small squid question. lil_drummaboy Linux - Networking 2 02-11-2005 05:17 PM
Squid ACL Question kemplej Linux - Security 5 08-03-2004 10:56 AM
SQUID: ACL question razametal Linux - Software 1 09-18-2003 07:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration