diff options
| author | Dmitry V. Levin <ldv@altlinux.org> | 2014-02-05 22:41:45 +0000 |
|---|---|---|
| committer | Dmitry V. Levin <ldv@altlinux.org> | 2014-02-05 23:41:50 +0000 |
| commit | 3acf4035ea020f54a5fcfd203952e04c4dad48c3 (patch) | |
| tree | 635db1cbb0d63d32720320cbe2a1c5e3f1b5654d /linux | |
| parent | fc4727de60fa79b0f638a2c78a3edf865dc75943 (diff) | |
| download | strace-3acf4035ea020f54a5fcfd203952e04c4dad48c3.tar.gz strace-3acf4035ea020f54a5fcfd203952e04c4dad48c3.tar.bz2 strace-3acf4035ea020f54a5fcfd203952e04c4dad48c3.tar.xz | |
Implement add_key, keyctl, and request_key decoding
* keyctl.c: New file.
* linux/keyctl.h: Likewise.
* Makefile.am (strace_SOURCES): Add keyctl.c.
(EXTRA_DIST): Add linux/keyctl.h.
* linux/dummy.h (sys_add_key, sys_keyctl, sys_request_key): Remove.
* linux/syscall.h (sys_add_key, sys_keyctl, sys_request_key): New
prototypes.
Diffstat (limited to 'linux')
| -rw-r--r-- | linux/dummy.h | 3 | ||||
| -rw-r--r-- | linux/keyctl.h | 61 | ||||
| -rw-r--r-- | linux/syscall.h | 3 |
3 files changed, 64 insertions, 3 deletions
diff --git a/linux/dummy.h b/linux/dummy.h index 2804499..eefe781 100644 --- a/linux/dummy.h +++ b/linux/dummy.h @@ -32,15 +32,12 @@ #endif /* still unfinished */ -#define sys_add_key printargs #define sys_ioperm printargs #define sys_iopl printargs #define sys_kcmp printargs -#define sys_keyctl printargs #define sys_lookup_dcookie printargs #define sys_name_to_handle_at printargs #define sys_open_by_handle_at printargs -#define sys_request_key printargs #define sys_sysfs printargs #define sys_vm86old printargs #define sys_vm86 printargs diff --git a/linux/keyctl.h b/linux/keyctl.h new file mode 100644 index 0000000..840cb99 --- /dev/null +++ b/linux/keyctl.h @@ -0,0 +1,61 @@ +/* keyctl.h: keyctl command IDs + * + * Copyright (C) 2004, 2008 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. + */ + +#ifndef _LINUX_KEYCTL_H +#define _LINUX_KEYCTL_H + +/* special process keyring shortcut IDs */ +#define KEY_SPEC_THREAD_KEYRING -1 /* - key ID for thread-specific keyring */ +#define KEY_SPEC_PROCESS_KEYRING -2 /* - key ID for process-specific keyring */ +#define KEY_SPEC_SESSION_KEYRING -3 /* - key ID for session-specific keyring */ +#define KEY_SPEC_USER_KEYRING -4 /* - key ID for UID-specific keyring */ +#define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */ +#define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */ +#define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */ +#define KEY_SPEC_REQUESTOR_KEYRING -8 /* - key ID for request_key() dest keyring */ + +/* request-key default keyrings */ +#define KEY_REQKEY_DEFL_NO_CHANGE -1 +#define KEY_REQKEY_DEFL_DEFAULT 0 +#define KEY_REQKEY_DEFL_THREAD_KEYRING 1 +#define KEY_REQKEY_DEFL_PROCESS_KEYRING 2 +#define KEY_REQKEY_DEFL_SESSION_KEYRING 3 +#define KEY_REQKEY_DEFL_USER_KEYRING 4 +#define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5 +#define KEY_REQKEY_DEFL_GROUP_KEYRING 6 +#define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7 + +/* keyctl commands */ +#define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */ +#define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */ +#define KEYCTL_UPDATE 2 /* update a key */ +#define KEYCTL_REVOKE 3 /* revoke a key */ +#define KEYCTL_CHOWN 4 /* set ownership of a key */ +#define KEYCTL_SETPERM 5 /* set perms on a key */ +#define KEYCTL_DESCRIBE 6 /* describe a key */ +#define KEYCTL_CLEAR 7 /* clear contents of a keyring */ +#define KEYCTL_LINK 8 /* link a key into a keyring */ +#define KEYCTL_UNLINK 9 /* unlink a key from a keyring */ +#define KEYCTL_SEARCH 10 /* search for a key in a keyring */ +#define KEYCTL_READ 11 /* read a key or keyring's contents */ +#define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */ +#define KEYCTL_NEGATE 13 /* negate a partially constructed key */ +#define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */ +#define KEYCTL_SET_TIMEOUT 15 /* set key timeout */ +#define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */ +#define KEYCTL_GET_SECURITY 17 /* get key security label */ +#define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */ +#define KEYCTL_REJECT 19 /* reject a partially constructed key */ +#define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */ +#define KEYCTL_INVALIDATE 21 /* invalidate a key */ +#define KEYCTL_GET_PERSISTENT 22 /* get a user's persistent keyring */ + +#endif /* _LINUX_KEYCTL_H */ diff --git a/linux/syscall.h b/linux/syscall.h index 316113e..8725040 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -33,6 +33,7 @@ int sys_accept(); int sys_accept4(); int sys_access(); +int sys_add_key(); int sys_adjtimex(); int sys_arch_prctl(); int sys_bind(); @@ -124,6 +125,7 @@ int sys_ioctl(); int sys_ioprio_get(); int sys_ioprio_set(); int sys_ipc(); +int sys_keyctl(); int sys_kexec_load(); int sys_kill(); int sys_link(); @@ -203,6 +205,7 @@ int sys_recvmsg(); int sys_remap_file_pages(); int sys_removexattr(); int sys_renameat(); +int sys_request_key(); int sys_restart_syscall(); int sys_rt_sigaction(); int sys_rt_sigpending(); |
