Sponsored Content
Top Forums Programming Changing the priority of a program Post 11996 by Perderabo on Sunday 16th of December 2001 12:32:57 PM
Old 12-16-2001
Adding a negative increment to a process's nice value requires that the process have an effective uid of root. Is this program running suid to root? When bash starts up in that state, it will abandon the root power unless -p has been specified. Other modern shells will also have features to resist running scripts while suid'ed. My guess is that this happened to you.

Does /usr/local/bin/vmod4dSOUND need root power? If it can run as an ordinary user, pick one, let's say it's uid 4. Now write a program like:
Code:
int main(int argc, char *argv[])
{
      nice(-20);
      setuid(4);
      execl("/usr/local/bin/vmod4dSOUND", "vmod4dSOUND", NULL);
}

And call this, perhaps, runvmod4dSOUND. It must be owned by root and have the setuid bit on:
chown root runvmod4SOUND
chmod 4755 runvmod4SOUND

Now you have a program that can run your sound and it is already setuid to root. So now the invoking program can be an ordinary user.

And when you invoke it, just do...
system("/usr/local/bin/runvmod4dSOUND");

You don't need to copy the string into an array the way you are doing.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Increasing priority of a process

Hi! Experts, Is there anyway to incerase the priority of a process which is already started and running??.. I think nice can used for increase priority when we start the process.. But donno how to do when its already running.. Any help would be apreciated.. Jyoti (2 Replies)
Discussion started by: jyotipg
2 Replies

2. HP-UX

urgent help required on changing process priority using nice

Hi folks, Hope you can help me. I have a process that is currently running at nice 20 and need it to run faster (-10?). How do I change the process using nice? I have the process number and thought it would be along the lines of; nice -10 process_id but it doesn't seem to like that. (1 Reply)
Discussion started by: gshuttleworth
1 Replies

3. Shell Programming and Scripting

Please Help me with this ..High Priority!

Hi, I am a nw bie to Schell Scripting, i have a same king of requirement as posted above. my input file is also a log file as below..... 28.05.2008 07:02:56,105 INFO Validation request recieved 28.05.2008 07:03:57,856 INFO 0:01:13.998 Response sent with: <?xml version="1.0"... (0 Replies)
Discussion started by: balaji_gopal
0 Replies

4. UNIX for Advanced & Expert Users

IRQ priority in FC9

Hi, I want to increase IRQ4 priority to maximum in Fedora core 9 (kernel version 2.6.25.11-97).If anybody knows plz help me.... I will be very thankful .. regards, Raj (0 Replies)
Discussion started by: rajuprade
0 Replies

5. Programming

kill priority

hello everybody! i would like to post a question. If i embed in my C code the command kill(9,pid) inside an if command. Is this command(kill) executed in any way. Both if the if is true and false. Does kill have greater priority than the if command. thanx in advance! (5 Replies)
Discussion started by: nicos
5 Replies

6. AIX

priority for process

hi how to change the priority of a process for eg.if a,b,c these there process are running and if i have to give the b process as high priority and high severe level what should i do (3 Replies)
Discussion started by: senmak
3 Replies

7. Red Hat

DNS priority

Hi All, Is this correct on DNS searching? (1st priority) /etc/hosts (2nd p.) /etc/resolv.conf Are there more things that I didn't know? Thank you for any comments you may add. (5 Replies)
Discussion started by: itik
5 Replies

8. Programming

Changing the way arguments are read from program

I have the following piece of code. Currently the command line arguments are passed as shown below using the "= "sign. I capture the name of the argument, for example vmod and it's corresponding user parameter which is jcdint-z30.cmd. ./raytrac vmod=jcdint-z30.cmd srFile=jcdint.sr Now I want... (12 Replies)
Discussion started by: kristinu
12 Replies

9. Red Hat

The priority of the log

Hi, I can't find the priority in my logs, which under the catalogue of /var/log/lmessages. For example, if the log below occur on my machine, there is no <30>. What should I do if I want to see <30> . <30>Oct 9 22:33:20 hlfedora auditd: The audit daemon is exiting. (0 Replies)
Discussion started by: zhaoyy
0 Replies

10. Shell Programming and Scripting

Retreiving multiple files by changing a parameter with one program

Hi all, I am using following command: perl program.pl input.txt output.txt CUTOFF 3 > groups_3.txt containing program.pl, two files (input.txt, output.txt) and getting output in groups_3.txt: But, I wish to have 30 files corresponding to each CUTOFF ranging from 0 to 30 using the same... (1 Reply)
Discussion started by: bioinfo
1 Replies
KRB5_APPDEFAULT(3)					   BSD Library Functions Manual 					KRB5_APPDEFAULT(3)

NAME
krb5_appdefault_boolean, krb5_appdefault_string, krb5_appdefault_time -- get application configuration value LIBRARY
Kerberos 5 Library (libkrb5, -lkrb5) SYNOPSIS
#include <krb5.h> void krb5_appdefault_boolean(krb5_context context, const char *appname, krb5_realm realm, const char *option, krb5_boolean def_val, krb5_boolean *ret_val); void krb5_appdefault_string(krb5_context context, const char *appname, krb5_realm realm, const char *option, const char *def_val, char **ret_val); void krb5_appdefault_time(krb5_context context, const char *appname, krb5_realm realm, const char *option, time_t def_val, time_t *ret_val); DESCRIPTION
These functions get application defaults from the appdefaults section of the krb5.conf(5) configuration file. These defaults can be specified per application, and/or per realm. These values will be looked for in krb5.conf(5), in order of descending importance. [appdefaults] appname = { realm = { option = value } } appname = { option = value } realm = { option = value } option = value appname is the name of the application, and realm is the realm name. If the realm is omitted it will not be used for resolving values. def_val is the value to return if no value is found in krb5.conf(5). SEE ALSO
krb5_config(3), krb5.conf(5) HEIMDAL
July 25, 2000 HEIMDAL
All times are GMT -4. The time now is 05:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy