aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2023-03-11 18:11:47 -0800
committerAndrew G. Morgan <morgan@kernel.org>2023-03-11 18:11:47 -0800
commit9c084eceb21250d3ffd4cf1c368dd39f99ef4df1 (patch)
tree49f7f2744fcb31655248e53fff5c6889c52cc4c3
parente32563557ba85f0cbdf0baf62f9a4aec392e4158 (diff)
downloadlibcap-9c084eceb21250d3ffd4cf1c368dd39f99ef4df1.tar.gz
Replace the README with a README.md
Also include the `go mod tidy` detail. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r--goapps/web/README18
-rw-r--r--goapps/web/README.md28
-rw-r--r--goapps/web/web.go2
3 files changed, 30 insertions, 18 deletions
diff --git a/goapps/web/README b/goapps/web/README
deleted file mode 100644
index cbabd5d..0000000
--- a/goapps/web/README
+++ /dev/null
@@ -1,18 +0,0 @@
-This sample program needs to be built as follows (when built with Go
-prior to 1.15):
-
- CGO_LDFLAGS_ALLOW="-Wl,-?-wrap[=,][^-.@][^,]*" go build web.go
-
-go1.15+ does not require the CGO_LDFLAGS_ALLOW variable and can build
-this code with
-
- go build web.go
-
-A more complete walk through of what this code does is provided here:
-
- https://sites.google.com/site/fullycapable/getting-started-with-go/building-go-programs-that-manipulate-capabilities
-
-Go compilers prior to go1.11.13 are not expected to work. Report more
-recent issues to:
-
- https://bugzilla.kernel.org/buglist.cgi?component=libcap&list_id=1065141&product=Tools&resolution=---
diff --git a/goapps/web/README.md b/goapps/web/README.md
new file mode 100644
index 0000000..970d10e
--- /dev/null
+++ b/goapps/web/README.md
@@ -0,0 +1,28 @@
+# Web serving with/without privilege
+
+## Building
+
+This sample program needs to be built as follows (when built with Go
+prior to 1.15):
+```
+ export CGO_LDFLAGS_ALLOW="-Wl,-?-wrap[=,][^-.@][^,]*"
+ go mod tidy
+ go build web.go
+```
+go1.15+ does not require the `CGO_LDFLAGS_ALLOW` environment variable
+and can build this code with:
+```
+ go mod tidy
+ go build web.go
+```
+
+## Further discussion
+
+A more complete walk through of what this code does is provided on the
+[Fully Capable
+website](https://sites.google.com/site/fullycapable/getting-started-with-go/building-go-programs-that-manipulate-capabilities).
+
+## Reporting bugs
+
+Go compilers prior to go1.11.13 are not expected to work. Report more
+recent issues to the [`libcap` bug tracker](https://bugzilla.kernel.org/buglist.cgi?component=libcap&list_id=1065141&product=Tools&resolution=---).
diff --git a/goapps/web/web.go b/goapps/web/web.go
index c96e745..5f9c5cb 100644
--- a/goapps/web/web.go
+++ b/goapps/web/web.go
@@ -13,6 +13,8 @@
// package - go versions prior to 1.15 need some environment variable
// workarounds):
//
+// go mod init web
+// go mod tidy
// go build web.go
// sudo setcap cap_setpcap,cap_net_bind_service=p web
// ./web --port=80