[linux-audio-dev] jack and setuid

Jens M Andreasen jens.andreasen at chello.se
Wed Nov 2 11:56:22 UTC 2005


On Wed, 2005-11-02 at 12:21 +0100, conrad berhörster wrote:

> 
> bash-3.00$ jack_lsp
> JACK server not running
> 
> why i can't use jack an normal user? what have i missed? why there are 5 
> processes of jack? is this a secure way? do i need every application as suid?

Yes. The jackd and your application needs to belong to the same user. So
in order for the suid strategy to work, all your jack applications must
also be suid. Not all applications can run as suid root because the
underlying UI will not allow it.

If you have source, try the inserting the following before starting any
UI thread:
 
 /**
   * Give back ownership to the real user,
   * so that we don't fuck up the machine while
   * posing as root.
   *
   */
  setreuid(getuid(), getuid());	


While we are at it; there is a bug in some some versions of libpthread,
causing the new UI thread to inherit RT capabilities set in the calling
thread. Workaround, explicitly turn it off as in:


pthread_attr_init(&i_thread_attr);

// We do not want to paint pixels at insane speeds
pthread_attr_setinheritsched(&i_thread_attr,PTHREAD_EXPLICIT_SCHED);
      
pthread_create(&i_thread,&i_thread_attr,interface,NULL);
      

>   
> 
-- 

mvh // Jens M Andreasen




More information about the Linux-audio-dev mailing list