Sponsored Content
Full Discussion: Making a system call
Top Forums Programming Making a system call Post 302079003 by hardwickj on Thursday 6th of July 2006 08:51:14 AM
Old 07-06-2006
Right, I know I can do it just by calling the script, however, this is actually what I am trying to avoid. Why you ask? Because the C code is being made "Privilege Aware" (something unique to Solaris 10 I believe) and will have the privilege to start up something that the user normally would not have privilege to do. If it calls a script, that script can be modified to start up a terminal per se. Thus the reason I am trying to do this in C instead of what is currently in place (a script), so it cannot be easily modified.

Any other ideas? Could I use a popen() instead of sytem() to do this? Right about now I wish I would have taken that Systems Programming course in school!

I greatly appreciate any of your help!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Making a SOAP call from within unix shell scripts

Hi guys, Is it possible to make SOAP calls from within Unix shell scripts? I need to access a web service from within UNIX in order to lookup something while I am doing some parsing on a file. Regards, Laud (2 Replies)
Discussion started by: Laud12345
2 Replies

2. Linux

Making Socket System Call From Linux Kernel Module?

Hi Everyone! How can we make a socket() system call from a linux module executing in kernel space? If any one knows, kindly tell me. It will be great. I want to use the socket interface in linux kernel space for sending raw packets over the network. Hamayun (0 Replies)
Discussion started by: mian_m_hamayun
0 Replies

3. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

4. Programming

c system call

How the c compiler differentiates the system calls and function calls? (1 Reply)
Discussion started by: rangaswamy
1 Replies

5. Shell Programming and Scripting

system call

Hi, How to write a system calls in a script ? > cd $HOME > ls -ltr thanks in advance.. (10 Replies)
Discussion started by: hegdeshashi
10 Replies

6. Programming

C:system call

Hi I'm studing the system call. I've written a small program that return the time spent in doing some operations. Now I'd like to write one that return the time spent in user mode of a process. I'm reading that i should use the tms struct: clock_t times(struct tms *buf); struct tms {... (2 Replies)
Discussion started by: Dedalus
2 Replies

7. UNIX for Dummies Questions & Answers

Making tar of a remote file system

Hello, I was asked by my boss to make a backup of one of our systems that is slated to be decommissioned. When I suggested if could tar the "/" directory he nodded and said that would do the trick, When I try and execute the command I get EOF error. I think it is because there is not enough... (2 Replies)
Discussion started by: mojoman
2 Replies

8. Shell Programming and Scripting

system call

Trying to figure out a load issue with a webserver. I have traced a php script and noticed the following connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XX.XX.XX.XX")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000035> poll(, 1, 2000) = 1 () <0.000120>... (5 Replies)
Discussion started by: rajan007
5 Replies

9. Solaris

Making HDD backup in sun Solaris system

Hello to all, I have Fujitsu Celzius M470 workstation which has Sun solaris system installed and want to make a complete backup of the hard drive. The existing HDD is SATA II, 500 GB. I don't have much experience working with SUN solaris systems (not at all) but have some experience with... (5 Replies)
Discussion started by: Mick
5 Replies
priv_getbyname(9F)					   Kernel Functions for Drivers 					priv_getbyname(9F)

NAME
priv_getbyname - map a privilege name to a number SYNOPSIS
#include <sys/cred.h> int priv_getbyname(const char *priv, int flags); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
priv name of the privilege flags flags, must be zero or PRIV_ALLOC DESCRIPTION
The priv_getbyname() function maps a privilege name to a privilege number for use with the priv_*() kernel interfaces. If PRIV_ALLOC is passed as a flag parameter, an attempt is made to allocate a privilege if it is not yet defined. The newly allocated priv- ilege number is returned. Privilege names can be specified with an optional priv_ prefix, which is stripped. Privilege names are case insensitive but allocated privileges preserve case. Allocated privileges can be at most {PRIVNAME_MAX} characters long and can contain only alphanumeric characters and the underscore charac- ter. RETURN VALUES
This function returns the privilege number, which is greater than or equal to 0, if it succeeds. It returns a negative error number if an error occurs. ERRORS
EINVAL This might be caused by any of the following o The flags parameter is invalid. o The specified privilege does not exist. o The priv parameter contains invalid characters. ENOMEM There is no room to allocate another privilege. ENAMETOOLONG An attempt was made to allocate a privilege that was longer than {PRIVNAME_MAX} characters. CONTEXT
This functions can be called from user and kernel contexts. ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |All | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), privileges(5) Writing Device Drivers SunOS 5.11 11 Mar 2004 priv_getbyname(9F)
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy