[dev] [sbase] cp and security

From: Random832 <random832_AT_fastmail.us>
Date: Thu, 23 Jun 2011 17:59:51 -0400

I've written most of cp, but one issue keeps bugging me.

I can't figure out how to get rid of race conditions within the
constraints that sbase is implemented in (POSIX 2001, no XSI
extensions).

If we were using POSIX 2008 or XSI extensions, I could use the at()
functions, or at least fchdir(), to reliably solve this problem. As it
is, I'm left with two choices:

Emulate fchdir with a "magic cookie" struct containing an absolute path,
device, and inode number [stat(".") every time and panic if device and
inode number don't match the cookie]

Do nothing.

Any thoughts?
Received on Thu Jun 23 2011 - 23:59:51 CEST

This archive was generated by hypermail 2.2.0 : Fri Jun 24 2011 - 00:12:03 CEST