help with C programme to lock remote resources

hello every one
i am working on a project to lock remote computer resources(hard drive, usb, cd- rom, folder etc). i have maintained connection using JAVA RMI and using JAVA JNI to lock resources, now i am really stuck up with C programme to do actual locking, i am using RHL-5 on admin computer and clients are using fedora and ubuntu. is it possible? or do linux have any utilities.
the architecture is- admin enforcing restrictions on clients.

please i require your help.

hello i am new to this forum and dont know if i am in right place to post this question. waiting for your reply.

By lock do you mean 'prevent all other users from accessing'

Locking usually refers to file locking - lockf() for example. The reason you don't have a good answer (this is a poor answer) is that your question doesn't make sense.

Plus your system may not support mandatory file locking anyway.

Please simply state what the requirement is - your goal - NOT how you want to get to your goal -- perl java, C etc, is irrelevant. Based on what you said I would connect as root and change permissions on directories - devices are files, too. But that sounds patently pointless to me.

thank you for your valuable suggestion.
yes i want to 'prevent all other users from accessing'

requirement of my project is to restrict the user from accessing some of the resources on his local machine.
can i do it the way you said?

You have your work cut out for you! One approach might be to use could try using SELinux.

got it,
thank you all for your expertise and valuable help.

You may also want to investigate ACL - access control lists. They provide very fine-grained control over accessing any file/device - ie., everybody but the username jmc can access this file/device. see: man chacl.

As with SELinux it may be painful to implement if this is implemented on a lot of different machines, and it will be a huge amount of work.

just gone throug man chacl, and i am trying to implement it, if any problem persists please help me, also thanks for referring SELinux or else i would have never known about it.
thank you all.