Unix Power ToolsUnix Power ToolsSearch this book

50.14. Why Can't You Change File Ownership?

This restriction is not bogus, because the system supports disk quotas (Section 15.11). If you could give away your own files, you could do something like the following:

% mkdir .hide; chmod 700 .hide
% cd .hide
% create_huge_file >foo
% chown prof1 foo
% create_huge_file >bar
% chown prof2 bar
% create_huge_file >baz
% chown prof3 baz

All you would need do is find someone with a high quota or no quota (such as a professor) who does not often check his own usage (such as a professor) and probably does not care that the disk is 99 percent full (such as a, er, well, never mind), and then give away files as necessary to keep under your own quota. You could regain ownership of the file by copying it to another disk partition, removing the original, and copying it back.

If you need to change ownership, there is a workaround (Section 50.15) that doesn't require root access.

-- CT



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.