hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/gils/su.rv
blob: d7ab2d20c17d330385910416a3b69094900f0d70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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