diff options
| author | hachem <im@hachem.wtf> | 2026-10-21 06:45:53 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-10-21 06:45:53 +0200 |
| commit | 6f8e692be1c196113b91ad1986a00c9d6f6f0e48 (patch) | |
| tree | 642bf354c1eacf3e67cdb3d41437586dfe44e4c0 /gils/su.rv | |
| parent | 306e9cb38e3922093708dfbbaf12979edff2b788 (diff) | |
Diffstat (limited to 'gils/su.rv')
| -rw-r--r-- | gils/su.rv | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gils/su.rv b/gils/su.rv new file mode 100644 index 0000000..d7ab2d2 --- /dev/null +++ b/gils/su.rv @@ -0,0 +1,14 @@ +# i need to implement the same vulns as sudo + +const context = env.ctx + +if context.argv:len() < 2 do + fail("usage: su <user>\n") +end else do + const uid = user_uid(context.argv[1]) + if uid < 0 do + fail("su: #{context.argv[1]}: no such user\n") + end else do + session.uid = uid + end +end |
