mkfs7: add uid function to handle -1
This commit is contained in:
+9
-3
@@ -513,6 +513,12 @@ sub parse_perms {
|
|||||||
return ( $filetype, $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
|
# Open the named proto file and parse it
|
||||||
sub parse_proto_file {
|
sub parse_proto_file {
|
||||||
my $file = shift;
|
my $file = shift;
|
||||||
@@ -543,17 +549,17 @@ sub parse_proto_file {
|
|||||||
|
|
||||||
if ( $type eq I_DIRECTORY ) {
|
if ( $type eq I_DIRECTORY ) {
|
||||||
my ( $name, $permstr, $uid, $inum ) = @words;
|
my ( $name, $permstr, $uid, $inum ) = @words;
|
||||||
make_dir( $name, $perms, oct($uid), $inum );
|
make_dir( $name, $perms, uid($uid), $inum );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( $type eq I_FILE ) {
|
if ( $type eq I_FILE ) {
|
||||||
my ( $name, $permstr, $uid, $extfile, $inum ) = @words;
|
my ( $name, $permstr, $uid, $extfile, $inum ) = @words;
|
||||||
add_file( $name, $perms, oct($uid), $extfile, $inum );
|
add_file( $name, $perms, uid($uid), $extfile, $inum );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( $type eq I_SPECIAL ) {
|
if ( $type eq I_SPECIAL ) {
|
||||||
my ( $name, $permstr, $uid, $inum ) = @words;
|
my ( $name, $permstr, $uid, $inum ) = @words;
|
||||||
add_special( $name, $perms, oct($uid), $inum );
|
add_special( $name, $perms, uid($uid), $inum );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( $type eq I_LINK ) {
|
if ( $type eq I_LINK ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user