- $rules->{exp_perms} =~ m/^(.*):(.*):(.*)$/;
- if ($1 ne "") {
- if (defined(getpwnam($1))) {
- $userid = int(getpwnam($1));
- } else {
- $userid = $1;
- }
- if ($uid != $userid) { $wrong = 1; }
- }
- if ($2 ne "") {
- if (defined(getgrnam($2))) {
- $groupid = int(getgrnam($2));
- } else {
- $groupid = $2;
- }
- if ($gid != $groupid) { $wrong = 1; }
- }
- if ($3 ne "") {
- if (($mode & 07777) != oct($3)) { $wrong = 1; };
- }
- if ($wrong == 0) {
- print "permissions: ok\n";
- } else {
- printf " expected permissions are: %s:%s:%#o\n", $1, $2, oct($3);
- printf " created permissions are : %i:%i:%#o\n", $uid, $gid, $mode & 07777;
- print "permissions: error\n";
- $error++;
- sleep(1);
- }
+ $rules->{exp_perms} =~ m/^(.*):(.*):(.*)$/;
+ if ($1 ne "") {
+ if (defined(getpwnam($1))) {
+ $userid = int(getpwnam($1));
+ } else {
+ $userid = $1;
+ }
+ if ($uid != $userid) { $wrong = 1; }
+ }
+ if ($2 ne "") {
+ if (defined(getgrnam($2))) {
+ $groupid = int(getgrnam($2));
+ } else {
+ $groupid = $2;
+ }
+ if ($gid != $groupid) { $wrong = 1; }
+ }
+ if ($3 ne "") {
+ if (($mode & 07777) != oct($3)) { $wrong = 1; };
+ }
+ if ($wrong == 0) {
+ print "permissions: ok\n";
+ } else {
+ printf " expected permissions are: %s:%s:%#o\n", $1, $2, oct($3);
+ printf " created permissions are : %i:%i:%#o\n", $uid, $gid, $mode & 07777;
+ print "permissions: error\n";
+ $error++;
+ sleep(1);
+ }