#include #include #include "privs.h" #include "die.h" void drop_privileges(bool enforce, uid_t uid, gid_t gid) { if (enforce) { if (uid == getuid()) panic("Uid cannot be the same as the current user!\n"); if (gid == getgid()) panic("Gid cannot be the same as the current user!\n"); } if (setgid(gid) != 0) panic("Unable to drop group privileges: %s!\n", strerror(errno)); if (setuid(uid) != 0) panic("Unable to drop user privileges: %s!\n", strerror(errno)); } tle='net-next.git Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2016-07-12 11:41:50 -0600
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-07-19 17:43:38 +0300
commit82cc1a49b6358394938e759dc4c22b2be773bbad (patch)
tree14ab5cfb49ade347724792326dc35a5ad151f617 /Documentation
parentcae8b441fc20812d7260dc3b45e05ee98fcfff1b (diff)
tpm: Add TPM 2.0 support to the Nuvoton i2c driver (NPCT6xx family)
The command flow is exactly the same, the core simply needs to be told to enable TPM2 mode when the compatible string indicates a TPM2. Signed-off-by: Andrew Azmansky <andrew.zamansky@nuvoton.com> Tested-by: Andrew Zamansky <andrew.zamansky@nuvoton.com> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to 'Documentation')