Permalink
Browse files

Add a makefile target to setuid the procket binary

Add a makefile target following Kenji Rikitake's procket-chmod.sh script.
Also, explain in the README how to call the setuid bin.
  • Loading branch information...
1 parent a9cff61 commit 927662fde81232f79d601086cc1d297323938f7d @msantos committed Apr 8, 2012
Showing with 9 additions and 1 deletion.
  1. +4 −0 Makefile
  2. +5 −1 README.md
View
4 Makefile
@@ -23,3 +23,7 @@ deps: $(REBAR)
examples: eg
eg:
@erlc -I deps -o ebin examples/*.erl
+
+setuid: all
+ sudo chown root priv/procket
+ sudo chmod 4750 priv/procket
View
6 README.md
@@ -91,6 +91,10 @@ make it setuid.
sudo chmod 750 /usr/local/bin/procket
sudo chmod u+s /usr/local/bin/procket
+ Use procket:open/2 and pass in the progname option:
+
+ procket:open(22, [{progname, "/usr/local/bin/procket"}] ++ Opt).
+
* use Linux capabilities: beam or the user running beam can be
given whatever socket privileges are needed. For example, using file
capabilities:
@@ -100,7 +104,7 @@ capabilities:
To see the capabilities:
getcap /usr/local/lib/erlang/erts-5.8.3/bin/beam.smp
-
+
To remove the capabilities:
setcap -r /usr/local/lib/erlang/erts-5.8.3/bin/beam.smp

0 comments on commit 927662f

Please sign in to comment.