LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-17-2012, 02:44 AM   #1
Hamerins
LQ Newbie
 
Registered: May 2011
Distribution: Backtrack 5 R1, Fedora 16 Security Spin, Archlinux
Posts: 25

Rep: Reputation: 0
Provide execute permission to a file at the time of creation.


Hello all,

how can we give execute permission for a file at the time of creation itself without using chmod.

Also please tell me which are all the files checked when we execute the command cat or touch to create a new file in ubuntu desktop.



Best Regards,
Hamerins
 
Old 01-17-2012, 02:46 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Can I ask what exactly you are trying to do? Knowing so may help us help you better with what you are trying to do.
 
Old 01-17-2012, 02:55 AM   #3
Hamerins
LQ Newbie
 
Registered: May 2011
Distribution: Backtrack 5 R1, Fedora 16 Security Spin, Archlinux
Posts: 25

Original Poster
Rep: Reputation: 0
I am trying to find an alternate solution for chmod,

if we accidently executed the command sudo chmod -x /bin/chmod

how can we fix this.

one method i know is to reinstall the package that contains chmod.

i am trying to find an alternate fix for this. i think if i get a file with exection permission, i can do and objcopy of the older chmod file to new one which have full permission
 
Old 01-17-2012, 05:17 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
So then just change the permissions themselves for chmod so only root can do so instead of your regular users.
 
Old 01-17-2012, 08:00 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
It could be done by writing a program that uses the chmod system call instead of the chmod binary
 
Old 01-18-2012, 01:08 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,254

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
If rpm based http://www.cyberciti.biz/tips/reset-...ermission.html
 
  


Reply

Tags
file permission


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] how to get the file creation time sudeep_mansh Linux - General 3 11-23-2010 11:56 PM
file creation time dina3e Linux - Newbie 2 03-25-2008 01:45 PM
Change owner, group and permission settings on file and folder creation?? helptonewbie Linux - Newbie 9 12-17-2007 04:03 PM
File Creation Time? enine Linux - General 9 05-17-2006 12:46 PM
Time of creation of a file proxyserver Linux - Software 2 04-11-2004 11:29 AM


All times are GMT -5. The time now is 02:08 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration