chiark / gitweb /
fix off by one error in array index assertion
[elogind.git] / src / core / smack-setup.c
index 611bfdb2df155b20e51bf84ff95a478246c50ec9..a68605c27216407a49e45a8d007bda77af5c9372 100644 (file)
@@ -116,12 +116,14 @@ static int write_rules(const char* dstpath, const char* srcdir) {
 
 #endif
 
-int smack_setup(void) {
+int smack_setup(bool *loaded_policy) {
 
 #ifdef HAVE_SMACK
 
         int r;
 
+        assert(loaded_policy);
+
         r = write_rules("/sys/fs/smackfs/load2", SMACK_CONFIG);
         switch(r) {
         case -ENOENT:
@@ -163,6 +165,8 @@ int smack_setup(void) {
                 return 0;
         }
 
+        *loaded_policy = true;
+
 #endif
 
         return 0;