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
commit56ef5d5b431c08037e09849debfe9ea001b5e481 (patch)
tree31c3541af5a2217c3ea3c82dd48d4d02dbf483a3
parent7eaadcab20d3580b4248be866188786cb0536d8c (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)
{