summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-11-20 02:54:01 +0000
committerMiles Bader <miles@gnu.org>1996-11-20 02:54:01 +0000
commit27e039b0cf766bd6a04a04c45ca6834d31d64b90 (patch)
tree9f26997c24934c3b60186b6d8fd0d904416db2ff
parent6a53df1ae9dca2846c4f9a712bfd22491ed30ce8 (diff)
(read_disknode):
If SBLOCK->fs_inodefmt < FS_44INODEFMT, set ST->st_author to st->st_uid, and NP->author_tracks_uid to true. (diskfs_validate_author_change): New function.
-rw-r--r--ufs/inode.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ufs/inode.c b/ufs/inode.c
index 006d595a..286cfafc 100644
--- a/ufs/inode.c
+++ b/ufs/inode.c
@@ -258,7 +258,8 @@ read_disknode (struct node *np)
{
st->st_uid = read_disk_entry (di->di_ouid);
st->st_gid = read_disk_entry (di->di_ogid);
- st->st_author = 0;
+ st->st_author = st->st_uid;
+ np->author_tracks_uid = 1;
}
else
{
@@ -300,6 +301,18 @@ error_t diskfs_node_reload (struct node *node)
return 0;
}
+/* Return 0 if NP's author can be changed to AUTHOR; otherwise return an
+ error code. */
+error_t
+diskfs_validate_author_change (struct node *np, uid_t author)
+{
+ if (compat_mode == COMPAT_GNU)
+ return 0;
+ else
+ /* For non-hurd filesystems, the author & owner are the same. */
+ return (author == np->dn_stat.st_uid) ? 0 : EINVAL;
+}
+
static void
write_node (struct node *np)
{