diff options
-rw-r--r-- | ufs/inode.c | 15 |
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) { |