This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

rm: cannot remove : Permission denied

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I am trying to delete files inside directory using script. But i end up with error " rm: cannot remove `/software//11-09-2011/summary-1.txt': Permission denied Error. How can i rectify this error.

Below is file permission for my script :

-rwxrwxrwx 1 oracle oinstall 334 Dec 1 17:00 purgeMediationFiles.sh

The directory which contain files has below permission :

drwxr-xr-x 3 oracle oinstall 12288 Aug 13 2011 12-08-2011

And all the file inside this directory is with permission :

-rw-r--r-- 1 oracle oinstall 63932 Aug 13 2011 summary-1.txt

Regards,
Jay
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which user account are you using to delete those files? It must be "oracle", because nobody else has write (i.e., delete) permissions to that file.
 
jaya kemmannu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,


I am logged in as other than oracle and root user like "jay123". Since owner of the script " purgeMediationFiles.sh " is oracle , if i try to run the script as different user(jay123) i thought it will delete the text files. Is my understanding wrong?

Regards,
Jaya
 
author
Posts: 23853
141
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

jaya kemmannu wrote:
I am logged in as other than oracle and root user like "jay123". Since owner of the script " purgeMediationFiles.sh " is oracle , if i try to run the script as different user(jay123) i thought it will delete the text files. Is my understanding wrong?



No. Having permissions to run a script doesn't mean you get the authority of the owner of the script. For that option, you need to turn on the setuid flag on the script. And to turn on that flag, you will need write permission on the directory where the script resides.

Henry
 
jaya kemmannu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Henry .. Any idea on how to turn on setuid on my script. to do so do we need oracle user login ?
 
Henry Wong
author
Posts: 23853
141
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

jaya kemmannu wrote:Thanks Henry .. Any idea on how to turn on setuid on my script. to do so do we need oracle user login ?



As mentioned, you need write permission on the directory -- and having the oracle login is probably the easiest way to obtain it.

Henry
 
jaya kemmannu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I was able to delete files which is having same file permission structures that are located in different path with different login.
 
Ranch Hand
Posts: 466
1
IntelliJ IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a permission issue, your user is not having privileges to delete the file. Check for the group which has delete access to the files and have your user added to it.
 
jaya kemmannu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

How to Check for the group which has delete access to the files and add them to group ?

Regards,
Jay

 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!