1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
15 int xwalk_tizen_check_user_app(void) {
19 struct group* current_g;
20 int64_t len = sysconf(_SC_GETGR_R_SIZE_MAX);
23 buffer = reinterpret_cast<char*>(malloc((size_t)len));
27 err = getgrgid_r(getgid(), &grp, buffer, len, ¤t_g);
29 fprintf(stderr, "group can't be determined");
30 fprintf(stderr, "launching an application will not work\n");
34 if ( (!current_g) || (
35 strcmp(current_g->gr_name, "users") &&
36 strcmp(current_g->gr_name, "app"))) {
37 fprintf(stderr, "group '%s' is not allowed :",
38 current_g ? current_g->gr_name : "<NULL>");
39 fprintf(stderr, "launching an application will not work\n");