Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-11-18
9
Medium Priority
?
6,332 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1200 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.
Suggested Courses

719 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