Skip to content

Instantly share code, notes, and snippets.

@jarkkojs
Created March 23, 2021 02:00
Show Gist options
  • Save jarkkojs/7b417be20cb52ed971a90561192f0883 to your computer and use it in GitHub Desktop.
Save jarkkojs/7b417be20cb52ed971a90561192f0883 to your computer and use it in GitHub Desktop.
# 0x01 view
# Ox02 read
# 0x04 write
# 0x08 search
# 0x10 link
# 0x20 setattr
#
# A key default permissions: 0x3f010000
# A keyring default permissions: 0x3f3f0000
# TEST: Remove R from possessor.
KEYID=$(keyctl add user test test @u)
keyctl setperm $KEYID 0x3d010000
keyctl print $KEYID
keyctl unlink $KEYID
# TEST: Remove A and R from possessor.
KEYID=$(keyctl add user test test @u)
keyctl setperm $KEYID 0x1d010000
keyctl print $KEYID
keyctl unlink $KEYID
# TEST: Remove A, W and R from possessor.
KEYID=$(keyctl add user test test @u)
keyctl setperm $KEYID 0x19010000
keyctl print $KEYID
keyctl unlink $KEYID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment