]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- fixed constness of context_str return value 754/head
authorArvin Schnell <aschnell@suse.de>
Mon, 5 Dec 2022 07:12:50 +0000 (08:12 +0100)
committerArvin Schnell <aschnell@suse.de>
Mon, 5 Dec 2022 07:13:40 +0000 (08:13 +0100)
package/snapper.changes
snapper/FileUtils.cc
snapper/FileUtils.h
snapper/Selinux.cc
snapper/Selinux.h

index 1300a8c73fbfc69d0804e6e3be69f877e26252c3..05d93365dce941b6b8844d9e0db608806fdf7ea2 100644 (file)
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon Dec 05 08:13:07 CET 2022 - aschnell@suse.com
+
+- fix build with never selinux
+
 -------------------------------------------------------------------
 Tue Nov 15 13:24:47 CET 2022 - aschnell@suse.com
 
index 5add3d465efba885e0f6d24025c417ff67d3fdcc..97c5f51f4c50424b067eb49850bca482caa2d678 100644 (file)
@@ -621,7 +621,7 @@ namespace snapper
 
 
     bool
-    SDir::fsetfilecon(const string& name, char* con) const
+    SDir::fsetfilecon(const string& name, const char* con) const
     {
        assert(name.find('/') == string::npos);
        assert(name != "..");
@@ -724,7 +724,7 @@ namespace snapper
 
 
     bool
-    SDir::fsetfilecon(char* con) const
+    SDir::fsetfilecon(const char* con) const
     {
        bool retval = true;
 
@@ -850,7 +850,7 @@ namespace snapper
 
 
     void
-    SFile::fsetfilecon(char* con) const
+    SFile::fsetfilecon(const char* con) const
     {
        dir.fsetfilecon(name, con);
     }
index b0a35f7e6c2d7e874c11b8a2d99c524beea3cf70..2b189d06f35a364b084688a00380213aff134187 100644 (file)
@@ -108,8 +108,8 @@ namespace snapper
                   const string& mount_data) const;
        bool umount(const string& mount_point) const;
 
-       bool fsetfilecon(const string& name, char* con) const;
-       bool fsetfilecon(char* con) const;
+       bool fsetfilecon(const string& name, const char* con) const;
+       bool fsetfilecon(const char* con) const;
        bool restorecon(SelinuxLabelHandle* sh) const;
        bool restorecon(const string& name, SelinuxLabelHandle* sh) const;
 
@@ -146,7 +146,7 @@ namespace snapper
        ssize_t listxattr(char* list, size_t size) const;
        ssize_t getxattr(const char* name, void* value, size_t size) const;
 
-       void fsetfilecon(char* con) const;
+       void fsetfilecon(const char* con) const;
        void restorecon(SelinuxLabelHandle* sh) const;
 
     private:
index fefb2c62938a00d67351da801b9ff21da8c9b8bf..e7fad52361b15272564b4396ef56303c8af5bbd8 100644 (file)
@@ -82,7 +82,7 @@ namespace snapper
     }
 
 
-    DefaultSelinuxFileContext::DefaultSelinuxFileContext(char* context)
+    DefaultSelinuxFileContext::DefaultSelinuxFileContext(const char* context)
     {
        if (setfscreatecon(context) < 0)
        {
index 2e5d806bcd16e515356a46f7ac4c9f39b6229ae5..38735ced6b2ffd681ab4b73db65eb98de867a198 100644 (file)
@@ -50,7 +50,7 @@ namespace snapper
     class SnapperContexts
     {
     public:
-       char* subvolume_context() const { return context_str(subvolume_ctx); }
+       const char* subvolume_context() const { return context_str(subvolume_ctx); }
        SnapperContexts();
        ~SnapperContexts() { context_free(subvolume_ctx); }
 
@@ -61,7 +61,7 @@ namespace snapper
     class DefaultSelinuxFileContext : private boost::noncopyable
     {
     public:
-       DefaultSelinuxFileContext(char* context);
+       DefaultSelinuxFileContext(const char* context);
        ~DefaultSelinuxFileContext();
     };