1getprofattr(3SECDSBe)curity Attributes Database Library Functiognestprofattr(3SECDB)
2
3
4
6 getprofattr, getprofnam, free_profattr, setprofattr, endprofattr, get‐
7 proflist, free_proflist - get profile description and attributes
8
10 cc [ flag... ] file... -lsecdb -lsocket -lnsl [ library... ]
11 #include <prof_attr.h>
12
13 profattr_t *getprofattr(void);
14
15
16 profattr_t *getprofnam(const char *name);
17
18
19 void free_profattr(profattr_t *pd);
20
21
22 void setprofattr(void);
23
24
25 void endprofattr(void);
26
27
28 void getproflist(const char *profname, char **proflist, int *profcnt);
29
30
31 void free_proflist(char **proflist, int profcnt);
32
33
35 The getprofattr() and getprofnam() functions each return a prof_attr
36 entry. Entries can come from any of the sources specified in the nss‐
37 witch.conf(4) file.
38
39
40 The getprofattr() function enumerates prof_attr entries. The getprof‐
41 nam() function searches for a prof_attr entry with a given name. Suc‐
42 cessive calls to these functions return either successive prof_attr
43 entries or NULL.
44
45
46 The internal representation of a prof_attr entry is a profattr_t struc‐
47 ture defined in <prof_attr.h> with the following members:
48
49 char *name; /* Name of the profile */
50 char *res1; /* Reserved for future use */
51 char *res2; /* Reserved for future use */
52 char *desc; /* Description/Purpose of the profile */
53 kva_t *attr; /* Profile attributes */
54
55
56
57 The free_profattr() function releases memory allocated by the getpro‐
58 fattr() and getprofnam() functions.
59
60
61 The setprofattr() function "rewinds" to the beginning of the enumera‐
62 tion of prof_attr entries. Calls to getprofnam() can leave the enumera‐
63 tion in an indeterminate state. Therefore, setprofattr() should be
64 called before the first call to getprofattr().
65
66
67 The endprofattr() function may be called to indicate that prof_attr
68 processing is complete; the system may then close any open prof_attr
69 file, deallocate storage, and so forth.
70
71
72 The getproflist() function searches for the list of sub-profiles found
73 in the given profname and allocates memory to store this list in
74 proflist. The given profname will be included in the list of sub-pro‐
75 files. The profcnt argument indicates the number of items currently
76 valid in proflist. Memory allocated by getproflist() should be freed
77 using the free_proflist() function.
78
79
80 The free_proflist() function frees memory allocated by the get‐
81 proflist() function. The profcnt argument specifies the number of
82 items to free from the proflist argument.
83
85 The getprofattr() function returns a pointer to a profattr_t if it suc‐
86 cessfully enumerates an entry; otherwise it returns NULL, indicating
87 the end of the enumeration.
88
89
90 The getprofnam() function returns a pointer to a profattr_t if it suc‐
91 cessfully locates the requested entry; otherwise it returns NULL.
92
94 Individual attributes in the prof_attr_t structure can be referred to
95 by calling the kva_match(3SECDB) function.
96
97
98 Because the list of legal keys is likely to expand, any code must be
99 written to ignore unknown key-value pairs without error.
100
101
102 The getprofattr() and getprofnam() functions both allocate memory for
103 the pointers they return. This memory should be deallocated with the
104 free_profattr() function.
105
107 /etc/security/prof_attr profiles and their descriptions
108
109
111 See attributes(5) for descriptions of the following attributes:
112
113
114
115
116 ┌─────────────────────────────┬─────────────────────────────┐
117 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
118 ├─────────────────────────────┼─────────────────────────────┤
119 │MT-Level │MT-Safe │
120 └─────────────────────────────┴─────────────────────────────┘
121
123 auths(1), profiles(1), getexecattr(3SECDB), getauthattr(3SECDB),
124 prof_attr(4)
125
126
127
128SunOS 5.11 31 Mar 2005 getprofattr(3SECDB)