limal-nfs-server
KNfsIdmapdConf.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | nfs-server library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 | (C) Novell, Inc. |
13 \----------------------------------------------------------------------/
14 
15  File: KNfsIdmapdConf.hpp
16 
17  Author: Marius Tomaschewski, Chakravarthi P
18  Maintainer: Chakravarthi P
19 
20 /-*/
25 #ifndef LIMAL_NFS_SERVER_KNFS_IDMAPD_CONF_HPP
26 #define LIMAL_NFS_SERVER_KNFS_IDMAPD_CONF_HPP
27 
30 
31 #include <blocxx/String.hpp>
32 #include <blocxx/Array.hpp>
33 
34 
35 // -------------------------------------------------------------------
36 namespace LIMAL_NAMESPACE
37 {
38 namespace NFS_SERVER_NAMESPACE
39 {
40 
41 
42 class KNfsIdmapdRules;
43 
44 
45 // -------------------------------------------------------------------
47 {
48 public:
50  KNfsIdmapdConf(const IdmapdConf &conf);
51  ~KNfsIdmapdConf();
52 
53  bool
54  validIdmapdEntry (const blocxx::String &name,
55  const blocxx::String &value) const;
56 
57  blocxx::String
58  verifyIdmapdEntry (const IdmapdEntry &entry) const;
59 
60  blocxx::Array<blocxx::String>
61  verifyIdmapdSection (const IdmapdSection &section) const;
62 
68  const blocxx::Array<blocxx::String>
69  verifyConf ();
70 
75  void
76  load(const blocxx::String &filename);
77 
87  void
88  save(const blocxx::String &idmapdFile,
89  const blocxx::String &backupSuffix);
90 
95  static IdmapdConf
96  parseIdmapdConfFile(const blocxx::String &idmapdFile);
97 
102  static IdmapdEntry
103  parseIdmapdEntry(const blocxx::String &entry);
104 
115  static void
116  writeIdmapdConfFile(const IdmapdConf &idmapdConf,
117  const blocxx::String &idmapdFile,
118  const blocxx::String &backupSuffix);
119 
120 private:
121  KNfsIdmapdRules *rules;
122  bool dirty;
123 };
124 
125 
126 // -------------------------------------------------------------------
127 } // End of NFS_SERVER_NAMESPACE
128 } // End of LIMAL_NAMESPACE
129 
130 #endif // LIMAL_NFS_SERVER_KNFS_IDMAPD_CONF_HPP
131 // vim: set ts=8 sts=8 sw=8 ai