This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <config.h>
20
21 #include "acl.h"
22
23 #include <signal.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <unistd.h>
27 #include <sys/types.h>
28 #include <sys/stat.h>
29
30 #include "macros.h"
31
32 int
33 main (int argc, char *argv[])
34 {
35 const char *file;
36 struct stat statbuf;
37
38 ASSERT (argc == 2);
39
40 file = argv[1];
41
42 if (stat (file, &statbuf) < 0)
43 {
44 fprintf (stderr, "could not access file \"%s\"\n", file);
45 exit (EXIT_FAILURE);
46 }
47
48
49 #if HAVE_DECL_ALARM
50
51
52 {
53 int alarm_value = 5;
54 signal (SIGALRM, SIG_DFL);
55 alarm (alarm_value);
56 }
57 #endif
58
59 #if USE_ACL
60 {
61 int ret = file_has_acl (file, &statbuf);
62 if (ret < 0)
63 {
64 fprintf (stderr, "could not access the ACL of file \"%s\"\n", file);
65 exit (EXIT_FAILURE);
66 }
67 printf ("%s\n", ret ? "yes" : "no");
68 }
69 #else
70 printf ("no\n");
71 #endif
72
73 return 0;
74 }