LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-19-2004, 08:30 AM   #1
toubo
LQ Newbie
 
Registered: Aug 2004
Posts: 10

Rep: Reputation: 0
s bit VS core file


Hi,

I just discovered that by setting a S bit to an executable, it will prevent it from generating a core file ? Is there a security reason behind it ? Is it possible that I can change this behaviour so that I can ALWAYS get a core file regardless of the setting of S bit ?

Thanks,

Toubo...
 
Old 10-19-2004, 06:32 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
I wasn't aware of this. Have you checked root's home directory to see if the core file is there?

Håkan
 
Old 10-20-2004, 11:26 AM   #3
toubo
LQ Newbie
 
Registered: Aug 2004
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks Hakan for your reply. I have checked the whole harddisk and I am sure that there is no trace of the core file. The core file will generate right away if I remove S-bit or change the ownership of the file to be non-root though.

Here is the piece of code that you can try to produce the core dump.

#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>


int main(int argc, char *argv[]) {

printf("Program started\n");

/* This program should end and produces a core dump here */
kill(getpid(), SIGSEGV);

printf("Program ended\n");
return 0;
}


Once you change the program file property:

chown root.root a.out
chmod a+s a.out

No core file will be generated.

Toubo...
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help : Can't Install Fedora Core 4 64 Bit maverick_007 Fedora - Installation 8 10-26-2005 06:33 AM
Fedora Core 64 Bit Guide leon85 Fedora 1 08-14-2005 05:01 PM
dvd for core 3 64 bit faulty? barrythai Fedora 0 01-14-2005 12:26 PM
32-bit doesn't work on fedora core kkrzyho Linux - Laptop and Netbook 1 12-27-2004 11:10 PM
Fedora Core 2 : 64-bit shamgar03 Fedora 3 07-15-2004 02:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:21 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