bash: permission denied...(after it allows me?)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers bash: permission denied...(after it allows me?)
# 1  
Old 10-25-2012
bash: permission denied...(after it allows me?)

I'm sure this question comes up a lot, but I'm particularly confused in this situation.

I can run my program once, just fine. However, if I try to run it again without recompiling, bash refuses to give me permission. I have a small idea why, but I don't think think I'm right.

Here's what I'm doing (for a course assignment). I have a program that has to change itself during runtime. The easiest way I thought to do this would be to to add blank lines to the executable, by creating a file with a few "\n" in them, and then concatenating them using a system call. It works! But only once.

However, if I manually go through and add a new line to the .exe and run it, it never stops me. I don't need to recompile...which is weird.

My thought was that maybe bash thinks I'm up to something...and wants to stop it, which also is understandable. However, I'm just doing my homework, so I hope this isn't the case.

Could anyone shed some light on this matter? Does changing the executable, even if it doesn't hinder its ability to run, cause some problem or issue with permissions?
# 2  
Old 10-25-2012
I guess the problem is with the new file which you are creating with few "\n". This file will not be having the right permissions and when you are concatenating it with the executable it creates permission issues. Please check.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing bash file with sudo for the second time, leads to permission denied, for some commands

I have a script that checks if the script has been ran with sudo. If the script is not ran as sudo, the current script is being executed with exec sudo bash. You are asked for a password, you type in the password, success. Everything is perfect - the commands inside the script are ran as sudo.... (1 Reply)
Discussion started by: boqsc
1 Replies

2. UNIX for Dummies Questions & Answers

Permission denied

when i run echo "User” > /dev/tty5 why do i get permission denied? :confused: (2 Replies)
Discussion started by: chinababy
2 Replies

3. Solaris

ISSUE : bash: cd: /rep/prok: Permission denied

Hi All, i have two accounts with acl permissions. I need to provide read access to both users. for one user s109552 "cd" is not working. drwxrws---+ 8 cvsadmin reto 1024 Aug 23 2011 reto su5sr117# su - s109553 $ bash bash-3.2$ cd /rep/reto bash-3.2$ pwd <-------- it... (2 Replies)
Discussion started by: Naveen.6025
2 Replies

4. Linux

Permission denied

I am using korn shell When I type in Telnet on cmd line, I get message "cannot execute" How can I get permission to execute command ? In which dir is telnet located ? I looked in /usr/bin dir. but its not there Thanks (1 Reply)
Discussion started by: paramshamnani
1 Replies

5. UNIX for Dummies Questions & Answers

Permission denied for bash

my file permissions are -rwxrwxrwx for runInstall file and while giving " sudo bash runInstall.sh " then i am getting error " permission denied" now i don't see any reasonable answer for that please suggest what should i do? :eek: got to start DBConnection practice with oracle database and... (4 Replies)
Discussion started by: toshanshu
4 Replies

6. UNIX for Dummies Questions & Answers

Bash: permission denied

Hello, I have a problem creating files in a certain folder. I installed apache and mysql today, using this guide: http://computerfaq.be/ubuntu-apache-mysql-php-server-installeren/ (can't post links yet :( ) Instead of /home/www/html I used /home/www/ for the document root. Now I... (12 Replies)
Discussion started by: emveedee
12 Replies

7. UNIX for Dummies Questions & Answers

Permission denied

I would like to copy data from local mechine to cluster. Basically, I typed scp -r DVD/ acount@cluster:/ it shows Permission denied. Could anyone please give me a clue to write permission on cluster, please? The poperty of where on cluster I'd like to put is drwxr-xr-x Any idea would... (1 Reply)
Discussion started by: su_in99
1 Replies

8. UNIX for Dummies Questions & Answers

Why do I keep getting .:Permission denied?

I'll start off by saying that I know very little about Unix - however, I do know that I have a .profile file in my home directory, and that I should be able to invoke it by typing . profile. However, when I do this for ANY .filename, I get ".: Permission denied". I'm pretty sure that there is... (12 Replies)
Discussion started by: bbersani
12 Replies

9. UNIX for Dummies Questions & Answers

Permission Denied

I just started computer science at UW Milwaukee. When I access the university Solaris system from PuTTY, I get permission denied when I try to access the file I wrote. Now I really have no idea what I'm doing, I just don't understand why I get permission denied in my won directory. Thank You ... (0 Replies)
Discussion started by: howeezy
0 Replies

10. UNIX for Dummies Questions & Answers

./ Permission Denied.

Could someone tell me why I am getting a permission denied message when I attempt to run this on an out file? Thanks! (8 Replies)
Discussion started by: trouscaillon
8 Replies
Login or Register to Ask a Question