klibc-bot for maximilian attems
2012-May-27 21:24 UTC
[klibc] [klibc:master] kinit: Fix capabilities alternate read/ write io without flush
Commit-ID: 8544fef6d5e5bc8f927ffbd3e4031b905c907de9 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=8544fef6d5e5bc8f927ffbd3e4031b905c907de9 Author: maximilian attems <max at stro.at> AuthorDate: Sun, 27 May 2012 23:18:07 +0200 Committer: maximilian attems <max at stro.at> CommitDate: Sun, 27 May 2012 23:18:07 +0200 [klibc] kinit: Fix capabilities alternate read/write io without flush Just fseek back to the start. Signed-off-by: maximilian attems <max at stro.at> --- usr/kinit/capabilities.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/usr/kinit/capabilities.c b/usr/kinit/capabilities.c index eab4d93..c606144 100644 --- a/usr/kinit/capabilities.c +++ b/usr/kinit/capabilities.c @@ -167,6 +167,9 @@ static void do_usermodehelper_file(const char *filename, int cap_ordinal) hi32 &= ~(1 << (cap_ordinal - 32)); /* Commit the new bit masks to the kernel */ + ret = fseek(file, 0L, SEEK_SET); + if (ret != 0) + fail("Failed on file %s to seek %d\n", filename, ret); sprintf(buf, "%u %u", lo32, hi32); ret = fwrite(buf, 1, strlen(buf) + 1, file); if (ret != 0)
H. Peter Anvin
2012-May-28 04:04 UTC
[klibc] [klibc:master] kinit: Fix capabilities alternate read/ write io without flush
On 05/27/2012 02:24 PM, klibc-bot for maximilian attems wrote:> Commit-ID: 8544fef6d5e5bc8f927ffbd3e4031b905c907de9 > Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=8544fef6d5e5bc8f927ffbd3e4031b905c907de9 > Author: maximilian attems <max at stro.at> > AuthorDate: Sun, 27 May 2012 23:18:07 +0200 > Committer: maximilian attems <max at stro.at> > CommitDate: Sun, 27 May 2012 23:18:07 +0200 > > [klibc] kinit: Fix capabilities alternate read/write io without flush > > Just fseek back to the start. >I'm confused by this. This seems odd at the very best. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Seemingly Similar Threads
- [klibc:master] capabilities: Use fflush() instead of fseek ()
- [PATCH v2] kinit: Add drop_capabilities support.
- [PATCH] klibc: fix capability dropping
- [PATCH v1 0/2] Support dropping of capabilities from early userspace.
- [LLVMdev] Instructions working on 64bit registers without true support for 64bit operations