Refactor AccessProvider and ScopedAccessProvider
[platform/core/test/security-tests.git] / src / security-manager-tests / test_cases_credentials.cpp
index 6571f9c..3a5a9d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2016-2020 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 #include <sys/un.h>
 #include <unistd.h>
 
-#include <access_provider.h>
+#include <app_context.h>
 #include <cynara_helpers_creds.h>
 #include <dpl/test/test_runner.h>
 #include <label_generator.h>
@@ -60,8 +60,8 @@ private:
 
 void udsServer(SynchronizationPipe &pipe, const struct sockaddr_un &sockaddr,
                const struct ProcessCredentials &peerCredentials) {
-    SecurityServer::AccessProvider ap(peerCredentials.label());
-    ap.applyAndSwithToUser(peerCredentials.uid(), peerCredentials.gid());
+    AppContext ctx(peerCredentials.label());
+    ctx.apply(peerCredentials.uid(), peerCredentials.gid());
     pipe.claimChildEp();
 
     int sock = UDSHelpers::createServer(&sockaddr);