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

 
 

sr #105652: Socket Permissions Patch

Submitted by:  Simon Dible <simon_6162>
Submitted on:  Tue 31 Oct 2006 07:17:09 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 2 - MinorStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup