From 27e039b0cf766bd6a04a04c45ca6834d31d64b90 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 20 Nov 1996 02:54:01 +0000 Subject: (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. --- ufs/inode.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3