Go Back   DaemonForums > FreeBSD > FreeBSD Security

FreeBSD Security Securing FreeBSD.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 6th June 2008
jcatrysse jcatrysse is offline
New User
Join Date: Jun 2008
Posts: 2
Default SUDO Wildcards


I have a php script that creates directories as ftp:ftp

Best thing I can think of is doing a simple php mkdir and then a sudo with chown and a specific parameters definition.

In my sudoers I have added:
www ALL= NOPASSWD: /usr/sbin/chown ftp\:ftp /exports/nasbezoom/volume[a-z0-9_ -/]*
This seems to work for:
sudo /usr/sbin/chown ftp:ftp /exports/nasbezoom/volume6
but also for:
sudo /usr/sbin/chown ftp:ftp /exports/nasbezoom/volume6/../blablabla
Am I doing something wrong with my wildcards?

Reply With Quote
  #2   (View Single Post)  
Old 7th June 2008
J65nko J65nko is offline
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,132

Wrong? You just underestimate the significance of the "*" wildcard

From the sudoers manpage

       sudo allows shell-style wildcards (aka meta or glob characters) to be
       used in pathnames as well as command line arguments in the sudoers
       file.  Wildcard matching is done via the POSIX fnmatch(3) routine.
       Note that these are not regular expressions.

       *       Matches any set of zero or more characters.
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 30th June 2008
jcatrysse jcatrysse is offline
New User
Join Date: Jun 2008
Posts: 2

Is see, i tought the * was about the preceding expression...

Can it be done with sudo?

Reply With Quote

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing sudo rex FreeBSD General 4 24th October 2008 12:40 AM

All times are GMT. The time now is 07:44 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick