1
0
mirror of https://github.com/DoctorWkt/pdp7-unix.git synced 2026-04-24 19:40:14 +00:00

mkfs7: add uid function to handle -1

This commit is contained in:
phil
2019-10-28 02:39:13 -04:00
parent 07c9a5c2d7
commit 8dcc21ed8d

View File

@@ -513,6 +513,12 @@ sub parse_perms {
return ( $filetype, $perms );
}
sub uid {
my $uid = shift;
return 0777777 if ($uid eq '-1');
return oct($uid);
}
# Open the named proto file and parse it
sub parse_proto_file {
my $file = shift;
@@ -543,17 +549,17 @@ sub parse_proto_file {
if ( $type eq I_DIRECTORY ) {
my ( $name, $permstr, $uid, $inum ) = @words;
make_dir( $name, $perms, oct($uid), $inum );
make_dir( $name, $perms, uid($uid), $inum );
next;
}
if ( $type eq I_FILE ) {
my ( $name, $permstr, $uid, $extfile, $inum ) = @words;
add_file( $name, $perms, oct($uid), $extfile, $inum );
add_file( $name, $perms, uid($uid), $extfile, $inum );
next;
}
if ( $type eq I_SPECIAL ) {
my ( $name, $permstr, $uid, $inum ) = @words;
add_special( $name, $perms, oct($uid), $inum );
add_special( $name, $perms, uid($uid), $inum );
next;
}
if ( $type eq I_LINK ) {