Solved

chmod -rw-rw-rw-   to   srw-rw-rw-

Posted on 2006-11-18
9
5,598 Views
Last Modified: 2012-05-05
The question is simple.

I have these to files:
-rw-rw-rw-  1 popuser root          0 Nov 18 11:26 spamd_full.sock
-rw-rw-rw-  1 popuser root          0 Nov 18 11:26 spamd_light.sock

and I want to change them with the permissions like these 2:

srw-rw-rw-    1 popuser  root            0 Aug 22 11:29 spamd_full.sock
srw-rw-rw-    1 popuser  root            0 Aug 22 11:29 spamd_light.sock


so I did chmod 666 spamd_*
but the problem is how do I give the "s" before "rw" ?

0
Comment
Question by:MaRiOsGR
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 17971121
there's no such permission setting like srw-rw-rw
Please explain what You want?
to set suid bit: chmod +s spamd_* # use -s to remove
to set sgid bit: chmod +S spamd_*
to set sticky bit: chmod +t spamd_*
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 300 total points
ID: 17971130
Oh - I guess You want change the regular file into socket - no way. The spamassasing have to create it by itself. You can just remove the file, so there's room for the socket.
If You insist, I can provide You perl one-liner to create sockets
0
 
LVL 38

Expert Comment

by:yuzh
ID: 17976562
To change the filse permission from
-rw-rw-rw-  1 popuser root          0 Nov 18 11:26 aa

to
-srw-rw-rw-  1 popuser root          0 Nov 18 11:26 aa

to need to do:
chmod u+x aa
chmod u+s aa

where aa is the filename

man chmod
to learn more details.

Please note that there is security risk for script to use suid, please read the following docs to learn
more details about SUID:
http://www.unix.org.ua/orelly/networking/puis/ch05_05.htm
http://www.samag.com/documents/s=1149/sam0106a/0106a.htm
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17977424
question is about  srw- not -rws , -srw does not exist, see ravenpl's comment also.
Monday morning .. everywhere ... ;-)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 38

Expert Comment

by:yuzh
ID: 17977475
I assume MaRiOsGR wants to suid to the owner/user.

It is dangerous to have a file suid and it is world read/writable, some one can modify the script
to do whatever to the system!!!
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17977554
> It is dangerous to have a file suid and it is world read/writable, some one can modify the script
Rather if it will overwrite the script with some binary. Scripts are not affected by suid bit, but You surely can
cat /bin/bash > /path/to/suid/scipt
0
 
LVL 6

Expert Comment

by:bpeterse
ID: 17981623
MaRiOsGR:

The first letter in the permissions display indicates what type of file it is - what you are asking is how to make a socket (that's what the "s" stands for).  The "s" in any other position than the first would indicate a permissions issue and I believe all the experts above have addressed that.  But if you <really> want to create a socket, that's accomplished programmatically... and you should consider posting your question in one of the programming forums.
0
 
LVL 39

Assisted Solution

by:noci
noci earned 200 total points
ID: 17999928
probably the next should work:

Add the following option to your spamd start script:

spamd --socketpath=/whatever/the/path/spamd_full.sock   {other options}
spamd --socketpath=/whatever/the/path/spamd_light.sock  {other options}

Also consider: --socketowner=popuser --socketgroup=root --socketmode=666
0
 
LVL 39

Expert Comment

by:noci
ID: 17999935
Oh, BTW, the socket will be removed when the system is normally closed
by spamd.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now