setuid program

R

Rajesh

Can someone provide me a sample C program to set the uid? The requirement is
the batch id 'abatchid' should be the one who can copy a file from foldera
to folderb. But the user who does not have privilege to run this command,
should be able to run the C program, which setuid of the batch id and runs
it. The program should take 2 parameters, one source folder/file and the
second one destination folder/file.
Thanks for your help
 
A

Alan Balmer

Can someone provide me a sample C program to set the uid? The requirement is
the batch id 'abatchid' should be the one who can copy a file from foldera
to folderb. But the user who does not have privilege to run this command,
should be able to run the C program, which setuid of the batch id and runs
it. The program should take 2 parameters, one source folder/file and the
second one destination folder/file.
Thanks for your help
Is this a Request For Quote?
 
D

Derk Gwen

# Can someone provide me a sample C program to set the uid? The requirement is
# the batch id 'abatchid' should be the one who can copy a file from foldera
# to folderb. But the user who does not have privilege to run this command,
# should be able to run the C program, which setuid of the batch id and runs
# it. The program should take 2 parameters, one source folder/file and the
# second one destination folder/file.

The magic of setuid is not the program itself, but in the attributes of the file
containing the program. If all you want is a copy program, you can copy /bin/cp
to a new file and do setuid on that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top