473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

linux 2.6.25 capabilities.

Hallo Group Members

I have the following problem with capabilities under linux. It looks
like they are not taken into consideration when when program is run in
gdb. A bit more detailed below

/tmp/p1.c:

#include <sys/types.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/param.h>
#include <string.h>
#include <time.h>
#include <stdio.h>
#include <errno.h>

int main() {
struct msqid_ds ds;
int queue_id = msgget( 1/*key*/, IPC_CREAT|0666 );
if ( msgctl(queue_id, IPC_STAT, &ds) != 0 )
return 0;
ds.msg_qbytes = 256*1024;
if ( msgctl(queue_id, IPC_SET, &ds) < 0 ) {
printf( "Error: %s\n", strerror( errno ) );
}
return 0;
}

prompt$ /tmp/p1
Error: Operation not permitted

prompt# /usr/sbin/setcap CAP_SYS_RESOURCE+eip /tmp/p1

prompt$ /tmp/p1 #. now works fine.
prompt$

but:
prompt$ gdb /tmp/p1
GNU gdb Fedora (6.8-17.fc9)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) run
Starting program: /tmp/p1
Error: Operation not permitted

Program exited normally.

prompt$ gcc --version
gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I am running fedora core 9 with kernel 2.6.25.14-108.

Have You got idea why?
Best regards
Sep 8 '08 #1
4 1606
Michal <ra******@tenbit.plwrites:
I have the following problem with capabilities under linux. It looks
like they are not taken into consideration when when program is run in
gdb. A bit more detailed below
[snip]

Try asking in a Linux newsgroup.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 8 '08 #2
Michal wrote:
Hallo Group Members
Look at your subject header:
Subject: linux 2.6.25 capabilities.

Notice that neither it nor your reported code are in fact related to any
problem with the programming language C.

Notice that you use headers which are not standard C headers, but
specific to your implementation. None of <sys/types.h>, <unistd.h>,
<sys/ipc.h>, <sys/msg.h>, or <sys/param.hare standard C. The "sys/"
part of some of the names and "uni" in the other are clues.

Notice that "struct msqid_ds" is not defined in your code, nor is it one
of the structs defined in the C programming language,

Notice that neither of msgget() and msgctl() are standard C functions.

That suggests that your question
Have You got idea why?
cannot be answered in terms of the C programming language, but may be
better asked in a newsgroup for users of your implementation. The folks
posting in such newsgroups, after all, claim to be the experts regarding
that implementation.
Sep 8 '08 #3
Michal wrote:
>
I have the following problem with capabilities under linux. It
looks like they are not taken into consideration when when
program is run in gdb. A bit more detailed below
This uses features not provided by standard ISO C, the subject of
this newsgroup, and thus is off-topic here. Try a linux group, or
comp.unix.programmer.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Sep 8 '08 #4
Michal wrote:
I am running fedora core 9 with kernel 2.6.25.14-108.

Have You got idea why?
You should ask your supervisor.

--
pete
Sep 8 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Ranger West | last post by:
Hello there, Are there any out-of-the box handhelds that run Linux/Apache/MYSQL and PHP? Does Redhat, Suse, or Gentoo support any handhelds? I know the Zaurus comes close, but I've heard...
1
by: Jens Thiede | last post by:
I want to use python heavily on my embeded linux. What would the best way be to slim down Python. Only keep those modules you would acctually need, and not imparing Python's capabilities? ...
6
by: Franco Fiorese | last post by:
Hi all, I am relatively new about Python benchmarks. After some experiments I found that Python on my PC Windows XP has a relevant higher performance than on Linux. The simple test using...
0
by: Tony Barker | last post by:
Helpful associates, We are going to acquire and new database server that is intel based and we want to have some failover capabilities. Our question now is should we go with Linux based cluster...
6
by: Scott Simpson | last post by:
What is a good tool for running XPath queries on Linux? I have the O'Reilly XPath book and I'm using XPath Visualizer on Windows and that seems to work fine, but I'm looking for something on Linux....
26
by: Simon | last post by:
I'm doing a survey. When do you think GNU/Linux will be ready for the average Joe? What obstacles must it overcome first?
3
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
27
by: Mike | last post by:
Open source programs in general suck pretty bad also. Here are some loose facts regarding why projects like Linux, PHP, MYSQL, and other open source programs suck: - Linux is simply a clone of...
1
by: rada.lambretha | last post by:
Configuring Linux as a Firewall * Making installation choices * Introducing iptables * Using iptables commands * Simplifying things with firewall GUIs * Adding proxy functionality As...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.