1

I'm writing camera interface for HALCON 13.0 in Ubuntu platform, the interface is named hAcqxVision and realized by file with name hAcqxVision.so, and this interface fill will cal the vendor's driver named libtycam.so, but calling libtycam.so should be with root authority, otherwise it will report error.

Then I wrote a executable binary that call libtycam.so directly with root authority, it worked well. but it would fail when with HALCON and hAcqxVision.so, and HALCON can't run with root authority.

could you please tell any way to realize this? Thanks.

Tommy
  • 31
  • 1

1 Answers1

0

This is a generic answer, but the usual way to do this on unix-es is to start as root (use the suid bit if you have to), then drop privileges for the part of the program that doesn't require root. Take a look at seteuid and the saved used id concepts.

Torp
  • 7,924
  • 1
  • 20
  • 18