mkdir -p %{buildroot}%{_prefix}/sbin
install -m 755 script/sdk_launch %{buildroot}%{_prefix}/sbin/
+
+%post
+mkdir -p /home/developer/.applications
+chown -R developer:users /home/developer/
+chsmack -a "User" /home/developer/
+chsmack -a "User" /home/developer/.applications
+
%files
%manifest sdbd.manifest
%license LICENSE
}
int set_developer_privileges() {
- gid_t groups[] = { SID_DEVELOPER, SID_APP_LOGGING, SID_SYS_LOGGING, SID_INPUT };
+ gid_t groups[] = { GID_DEVELOPER, SID_APP_LOGGING, SID_SYS_LOGGING, SID_INPUT };
if (setgroups(sizeof(groups) / sizeof(groups[0]), groups) != 0) {
D("set groups failed (errno: %d, %s)\n", errno, strerror(errno));
}
// then switch user and group to developer
- if (setgid(SID_DEVELOPER) != 0) {
+ if (setgid(GID_DEVELOPER) != 0) {
D("set group id failed (errno: %d, %s)\n", errno, strerror(errno));
return -1;
}
if (stat(ONDEMAND_ROOT_PATH, &st) == -1) {
return;
}
- if (st.st_uid != SID_DEVELOPER || st.st_gid != SID_DEVELOPER) {
+ if (st.st_uid != SID_DEVELOPER || st.st_gid != GID_DEVELOPER) {
char cmd[128];
snprintf(cmd, sizeof(cmd), "chown %s:%s %s -R", DEV_NAME, DEV_NAME, ONDEMAND_ROOT_PATH);
if (system(cmd) < 0) {
exit(1);
}
/* then switch user and group to "developer" */
- if (setgid(SID_DEVELOPER) != 0) {
+ if (setgid(GID_DEVELOPER) != 0) {
fprintf(stderr, "set group id failed errno: %d\n", errno);
exit(1);
}
#define SID_TTY 5 /* group for /dev/ptmx */
#define SID_APP tzplatform_getuid(TZ_USER_NAME) /* application */
#define SID_DEVELOPER tzplatform_getuid(TZ_SDK_USER_NAME) /* developer with SDK */
+#define GID_DEVELOPER 100 /* developer will be member of users with SDK */
#define SID_APP_LOGGING 6509
#define SID_SYS_LOGGING 6527
#define SID_INPUT 1004