lkml.org 
[lkml]   [1999]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [security]: kernel ioctl()'s [3]
Date
From

> Chris Evans wrote:

>> Because programs running as root assume

>> open("blah", O_RDWR)
>> write(blah)

>> will work. They do NOT expect to have to

>> open("blah", O_RDWR)
>> if (-EPERM)
>> chflags("blah", immutable off)
>> open("blah", O_RDWR)

> assumptions are generally bad.

Failure to check for errors is often BAD.

> two situations immediately come to mind.

> - extended attribute; immutable
> - extended attribute; append only
> - filesystem mounted RO
> - 100% filesystem usage, 0% free

--- that's four;

Let's also add

- System is BSD 4.4 and user immutable or user append-only
UFS flag is set.


> therefore the first example is very very bad.
> always check your return values, expect the unexpected and survive. =)

> -d

--
Jim Dennis jdennis@linuxcare.com
Linuxcare: Linux Corporate Support Team: http://www.linuxcare.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:3.387 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site