LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-25-2012, 06:16 PM   #1
MidwestProduct
LQ Newbie
 
Registered: Sep 2012
Posts: 6

Rep: Reputation: Disabled
Is bash being bipolar? Permission allowed, then denied


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?
 
Old 10-25-2012, 06:37 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Show the cmds exactly and
Code:
ls -l
on the files (lowercase L there).
I suspect in the 'auto' case, you are concatenating in such a way that you end up with a new file and the default on file creation is no executable perms.

PS: as you are doing a course, here are some very good refs
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

Last edited by chrism01; 10-25-2012 at 06:38 PM.
 
1 members found this post helpful.
Old 10-25-2012, 08:26 PM   #3
MidwestProduct
LQ Newbie
 
Registered: Sep 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Why didn't I think of that! That is exactly what the problem is. Thank you!
 
Old 10-25-2012, 11:49 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
That's why you are doing the course
 
  


Reply



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
bash: ./a.out: Permission denied ...... Debojit777 Linux - Newbie 11 11-07-2011 10:03 AM
bash: /etc/ld.so.conf: Permission denied theKbStockpiler Linux - General 5 09-11-2010 05:01 PM
su: /bin/bash: Permission denied fedora4002 Linux - Security 5 01-29-2010 08:46 AM
bash: Permission Denied Panagiotis_IOA Slackware 5 11-07-2006 10:25 PM
bash: /etc/profile: Permission denied Zero-0-Effect Linux - General 3 03-28-2005 04:47 AM

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

All times are GMT -5. The time now is 07:24 AM.

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
Open Source Consulting | Domain Registration