UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 1st, 2011, 03:50 AM
Technext Technext is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2010
Posts: 35 Technext User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 57 m 48 sec
Reputation Power: 3
Mkdir: cannot create directory `/builds/somedir/': Permission denied

Hi,


I am trying to run a shell script which contains an mkdir command as part of the execution. The script fails with the following error:
mkdir: cannot create directory `/builds/somedir/': Permission denied

The user running the script is 'harry' and belongs to group 'school'. The target directory is owned by another user ‘sally’.

ls -ld /builds/somedir/
drwxr-xr-x+ 14 sally bin 1024 May 31 18:01 /builds/somedir/

The above path (/builds/somedir/) is a Samba share.

To make it work, I tried few things but to no avail:
--------------------------------------------------
1. setfacl -d -m u:harry:rwx /builds/somedir
setfacl -d -m g:school:rwx /builds/somedir

2. Added following entry in /etc/sudoers file
# User privilege specification
harry ALL=(ALL) ALL
--------------------------------------------------

After making these changes, I tried running the mkdir command manually also but no luck.

The OS is GNU\Linux.

There is one thing weird that I just noticed: even with root user, I was not able to create directory in the given path. Does it has anything to do with Samba share?

After noticing this behavior, I removed the above entry from sudoers file, and instead added the following but still no luck.
-----------------------
harry ALL=(sally) ALL
-----------------------

Any ideas\inputs?


Regards,
Gaurav

Reply With Quote
  #2  
Old June 2nd, 2011, 01:27 AM
Technext Technext is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2010
Posts: 35 Technext User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 57 m 48 sec
Reputation Power: 3
To update, things are working now. I think i now know what blunder i was committing: i was running this script as follows:
Code:
sudo sh scriptname.sh


'su' must be assuming that my intended user is 'root', and since even root user was not able to create directory in the given path, the script was failing. When i changed it to the following, it worked:
Code:
sudo sally sh scriptname.sh

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Mkdir: cannot create directory `/builds/somedir/': Permission denied

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap