File: request-key-debug.sh

package info (click to toggle)
keyutils 1.5.5-3%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 772 kB
  • sloc: ansic: 2,842; sh: 2,674; makefile: 221
file content (33 lines) | stat: -rwxr-xr-x 906 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
###############################################################################
#
# Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.
# Written by David Howells (dhowells@redhat.com)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version
# 2 of the License, or (at your option) any later version.
#
###############################################################################
#
# Request key debugging
#
# Call: request-key-debug.sh <keyid> <desc> <callout> <session-keyring>
#

echo RQDebug keyid: $1
echo RQDebug desc: $2
echo RQDebug callout: $3
echo RQDebug session keyring: $4

if [ "$3" != "neg" ]
then
    keyctl instantiate $1 "Debug $3" $4 || exit 1
else
    cat /proc/keys
    echo keyctl negate $1 30 $4
    keyctl negate $1 30 $4
fi

exit 0