Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / tests / acladdrights.pl
CommitLineData
805e021f
CE
1#!/usr/bin/env perl
2use OpenAFS::CMU_copyright;
3use OpenAFS::util qw(:DEFAULT %AFS_Help);
4use OpenAFS::afsconf;
5use OpenAFS::fs;
6use OpenAFS::pts;
7use OpenAFS::vos;
8use OpenAFS::bos;
9
10my ($wscell, $path, @pos1, @pos2, @neg1, @neg2, $ret, @tmp, @tmp2, @tmp3, $found);
11&AFS_Init();
12$wscell = &AFS_fs_wscell();
13$found = 0;
14
15eval { &AFS_pts_createuser(user1,,); };
16$path = "/afs/${wscell}/service/acltest";
17mkdir $path, 0777;
18($pos1, $neg1) = &AFS_fs_getacl($path);
19$ret = &AFS_fs_setacl([$path],[["user1", "rlidw"]],,);
20($pos2, $neg2) = &AFS_fs_getacl($path);
21while ($ret = pop(@$pos2)) {
22 @tmp2=@$ret;
23 if ($tmp2[0] eq "user1") {
24 if ($tmp2[1] ne "rlidw") {
25 exit (1);
26 }
27 $tmp2[1] = "rl";
28 unshift @tmp, @tmp2;
29 } else {
30 unshift @tmp, @$ret;
31 }
32}
33
34@tmp2=();
35while ($ret = pop(@$pos1)) {
36 unshift @tmp2, @$ret;
37}
38
39exit(0);
40
41
42