mainUSBB2K-API - Support: sr #105652, Socket Permissions Patch

 
 

sr #105652: Socket Permissions Patch

Submitter:  Simon Dible <simon_6162>
Submitted:  Tue 31 Oct 2006 07:17:09 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  2 - Minor Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 31 Oct 2006 07:17:09 PM UTC, original submission:  

Hello,

I have made a linker application from your driver to skype. The application I have runs as a normal user, but from what I have tried your driver must be run as root. The problem I have is that the socket you make in your driver only gets read/write permissions for root, could you add the chmod command below to fix this issue, or let me know if i'm doing somthing wrong.

add
#include <sys/stat.h>

after
  serveur.sun_family=AF_UNIX;
  strcpy(serveur.sun_path,USBB2K_SOCKET);
  unlink(serveur.sun_path);
  len = strlen(serveur.sun_path)+sizeof(serveur.sun_family);
  if (bind(sock_serveur,(struct sockaddr *)&serveur,len) == -1){
    syslog(LOG_ERR,"bind");
    exit(1);
  }


add
//##########################################################################
set permissions on the socket so normal users have access
chmod(USBB2K_SOCKET, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP |S_IROTH|S_IWOTH);
//###########################################################################

Thank you for your help and the nice code !

Simon Dible


Simon Dible <simon_6162>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code