Skip to content

Commit

Permalink
Add Alpine/musl target files
Browse files Browse the repository at this point in the history
  • Loading branch information
songdongsheng committed Feb 15, 2019
1 parent 5e7d0af commit 98818d3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 16 deletions.
10 changes: 6 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
* text eol=lf
* text eol=lf

su-exec -text
su-exec-shared -text
su-exec-static -text
su-exec -text
su-exec-glibc-shared -text
su-exec-glibc-static -text
su-exec-musl-shared -text
su-exec-musl-static -text
56 changes: 44 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,67 @@ $ su-exec nginx:122 /usr/sbin/nginx -c /etc/nginx/nginx.conf
## Why reinvent gosu/su-exec ?

This does more or less exactly the same thing as [gosu](https://github.com/tianon/gosu)
but it is only 0.6MB (7KB for shared version) instead of 2.2MB.
but it is only 40KB (7KB for shared version) instead of 2.2MB.
In particular, the simple C program has a smaller attack plane.

The [`ncopa's su-exec`](https://github.com/ncopa/su-exec) have critical bugs (or features),
it will **use root permission silently** if given invalid user-spec !
it will **use root permission silently** if invalid user-spec given !

# Download from IPFS (InterPlanetary File System)
## IPFS hash
```
# touch -d "1970-01-01 00:00:00" su-exec-shared su-exec-static
# touch -d "1970-01-01 00:00:00" su-exec-*
# ls -la su-exec-shared su-exec-static
-rwxr-xr-x 1 root root 6960 Jan 1 1970 su-exec-shared
-rwxr-xr-x 1 root root 609376 Jan 1 1970 su-exec-static
# ls -la su-exec-*
-rwxr-xr-x 1 dongsheng dongsheng 6960 Jan 1 1970 su-exec-glibc-shared
-rwxr-xr-x 1 dongsheng dongsheng 609376 Jan 1 1970 su-exec-glibc-static
-rwxr-xr-x 1 dongsheng dongsheng 9880 Jan 1 1970 su-exec-musl-shared
-rwxr-xr-x 1 dongsheng dongsheng 38648 Jan 1 1970 su-exec-musl-static
# ipfs add su-exec-shared su-exec-static
added QmWcck5mQqbzcEx8mM6bdDestYwqiwsXkCVa97odggk9Vy su-exec-shared
added QmX3bzvCM3cxFFWGGMhQnMV214HLzyFceD6Vyf2aRYW7NB su-exec-static
added QmWcck5mQqbzcEx8mM6bdDestYwqiwsXkCVa97odggk9Vy su-exec-glibc-shared
added QmX3bzvCM3cxFFWGGMhQnMV214HLzyFceD6Vyf2aRYW7NB su-exec-glibc-static
added QmdEvCUAUnnaTD4ffwDuanS43FPZZgoCF55DtBgpuoqFQR su-exec-musl-shared
added QmbB7MKHgsx2ZPSmnJJAiu4qDB19v5TtZPhYcfVZydG8Mk su-exec-musl-static
```
## GnuPG / OpenPGP sign
```
Primary key fingerprint: 3DA8 ECBB 5757 2D64 9F3C 0811 0401 AA20 46D3 97FF
Subkey fingerprint: 4073 E993 3572 FC25 1915 5A19 D256 8959 D1DA A566
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
SHA256 (su-exec-glibc-shared) = fed1ba22bb0e5b933efb25f2f9e57e7b3069715423ef693a162d9a01bcb040d7
SHA256 (su-exec-glibc-static) = 59382e38117fc5c001b7d716e53f376cffa50de63c218c03bd213bce4bca5f73
SHA256 (su-exec-musl-shared) = ed6e097a0122d4027238c6927f634b5ac13691c3116ed693cfb7b982b41a48e6
SHA256 (su-exec-musl-static) = 79dd71246b7a6aa1867df1ac0ccde9b9771995fa2bd86e74a0e110244512e67f
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEQHPpkzVy/CUZFVoZ0laJWdHapWYFAlxmrUQACgkQ0laJWdHa
pWaDMAgAuQQ05YcSotSnSkiq7k58gCJX/CGd1LV8bkajfGvyhAqD3YQuaB2/IS2o
QjKqSOKnxj7JLde9/O2elnEHhRgs8u6U2a8yK0NcpY8QgOdglMhydiz4CrXBVe9Q
XdYpHwVZalAnfpSFxq7x3JtQkpeXEteL/8mMBtandc24CVoWkr+A0RjdAzkMOm+l
vd4htpnn1ZspoUHLUSt5WtXbHtXRHC230Zh+h3sw2rig7+1c6hf/aELz+Z5MYKEN
rf1w0X5otySN+yINBp21PquM1vXw0KxVj/rGkBeY0Y+mKOkToNYRsiKqDubmtKL0
Bqm4QcWjSnZxitwI1MLZUO0a2Do1ag==
=/Qr+
-----END PGP SIGNATURE-----
```

## Download from IPFS
```
# ipfs get -o su-exec-shared QmWcck5mQqbzcEx8mM6bdDestYwqiwsXkCVa97odggk9Vy
# ipfs get -o su-exec-static QmX3bzvCM3cxFFWGGMhQnMV214HLzyFceD6Vyf2aRYW7NB
ipfs get -o su-exec-glibc-shared QmWcck5mQqbzcEx8mM6bdDestYwqiwsXkCVa97odggk9Vy
ipfs get -o su-exec-glibc-static QmX3bzvCM3cxFFWGGMhQnMV214HLzyFceD6Vyf2aRYW7NB
ipfs get -o su-exec-musl-shared QmdEvCUAUnnaTD4ffwDuanS43FPZZgoCF55DtBgpuoqFQR
ipfs get -o su-exec-musl-static QmbB7MKHgsx2ZPSmnJJAiu4qDB19v5TtZPhYcfVZydG8Mk
```

## Download from IPFS gateway
### cloudflare-ipfs.com
```
curl -o su-exec-shared https://cloudflare-ipfs.com/ipfs/QmWcck5mQqbzcEx8mM6bdDestYwqiwsXkCVa97odggk9Vy
curl -o su-exec-static https://cloudflare-ipfs.com/ipfs/QmX3bzvCM3cxFFWGGMhQnMV214HLzyFceD6Vyf2aRYW7NB
curl -o su-exec-glibc-shared https://cloudflare-ipfs.com/ipfs/QmWcck5mQqbzcEx8mM6bdDestYwqiwsXkCVa97odggk9Vy
curl -o su-exec-glibc-static https://cloudflare-ipfs.com/ipfs/QmX3bzvCM3cxFFWGGMhQnMV214HLzyFceD6Vyf2aRYW7NB
curl -o su-exec-musl-shared https://cloudflare-ipfs.com/ipfs/QmdEvCUAUnnaTD4ffwDuanS43FPZZgoCF55DtBgpuoqFQR
curl -o su-exec-musl-static https://cloudflare-ipfs.com/ipfs/QmbB7MKHgsx2ZPSmnJJAiu4qDB19v5TtZPhYcfVZydG8Mk
```

0 comments on commit 98818d3

Please sign in to comment.