Solved

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

Posted on 2006-11-18
9
5,805 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 
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 40

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 40

Expert Comment

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
UNiX Script filesystem space usage 19 77
Can I delete authorized_keys in FreeBSD 1 99
Best way to split and output to csv in bash 2 67
awk sed 8 68
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

820 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