Changeset 684 in ProjectBuilder for devel/pb/bin/pb


Ignore:
Timestamp:
Feb 16, 2009, 2:28:51 AM (15 years ago)
Author:
Bruno Cornec
Message:

/etc/shadow doesn't exist necessarily in VE/VMs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r681 r684  
    19731973# No passwd for build account only keys
    19741974$file="/etc/shadow";
    1975 open(PBFILE,$file) || die "Unable to open $file";
    1976 open(PBOUT,"> $file.new") || die "Unable to open $file.new";
    1977 while (<PBFILE>) {
     1975if (-f $file) {
     1976    open(PBFILE,$file) || die "Unable to open $file";
     1977    open(PBOUT,"> $file.new") || die "Unable to open $file.new";
     1978    while (<PBFILE>) {
    19781979EOF
    19791980    print SCRIPT << "EOF";
    1980     s/^$pbac->{$ENV{'PBPROJ'}}:\!\!:/$pbac->{$ENV{'PBPROJ'}}:*:/;
    1981     s/^$pbac->{$ENV{'PBPROJ'}}:\!:/$pbac->{$ENV{'PBPROJ'}}:*:/; #SLES 9 e.g.
    1982 EOF
    1983     print SCRIPT << 'EOF';
    1984     print PBOUT $_;
    1985 }
    1986 close(PBFILE);
    1987 close(PBOUT);
    1988 rename("$file.new",$file);
    1989 chmod 0640,$file;
     1981        s/^$pbac->{$ENV{'PBPROJ'}}:\!\!:/$pbac->{$ENV{'PBPROJ'}}:*:/;
     1982        s/^$pbac->{$ENV{'PBPROJ'}}:\!:/$pbac->{$ENV{'PBPROJ'}}:*:/; #SLES 9 e.g.
     1983EOF
     1984        print SCRIPT << 'EOF';
     1985        print PBOUT $_;
     1986    }
     1987    close(PBFILE);
     1988    close(PBOUT);
     1989    rename("$file.new",$file);
     1990    chmod 0640,$file;
     1991    }
    19901992
    19911993# Keep the VM in text mode
Note: See TracChangeset for help on using the changeset viewer.