cp -f /bin/sh /bin/sh-user
chsmack -a "_" /bin/sh-user
chsmack -e "User::Shell" /bin/sh-user
+mkdir -p %{TZ_SDK_HOME}/share/sdbdlog
+chown owner:users %{TZ_SDK_HOME}/share/sdbdlog
%files
%manifest sdbd.manifest
[Service]
Type=forking
#location of SDBD log file
-#Environment=SDBD_LOG_PATH=/tmp
EnvironmentFile=-/run/tizen-system-env
PIDFile=/tmp/.sdbd.pid
Restart=on-failure
-SmackProcessLabel=System::Privileged
+SmackProcessLabel=System
ExecStart=/usr/sbin/sdbd
[Install]
[Service]
Type=forking
#location of SDBD log file
-#Environment=SDBD_LOG_PATH=/tmp
Environment=DISPLAY=:0
PIDFile=/tmp/.sdbd.pid
RemainAfterExit=yes
#ExecStartPre=/bin/bash -c "/bin/echo '10.0.2.15/32 system::debugging_network' >> /smack/netlabel"
-SmackProcessLabel=System::Privileged
+SmackProcessLabel=System
ExecStart=/bin/sh -c "/usr/sbin/sdbd `/usr/bin/awk '{match($0, /sdb_port=([0-9]+)/,port_match); match($0, /vm_name=([^, ]*)/,vm_match); print \"--emulator=\" vm_match[1] \":\" port_match[1] \" --connect-to=10.0.2.2:26099\" \" --sensors=10.0.2.2:\"port_match[1]+3 }' /proc/cmdline`"
[Install]
Environment=DISPLAY=:0
PIDFile=/tmp/.sdbd.pid
RemainAfterExit=yes
-SmackProcessLabel=System::Privileged
+SmackProcessLabel=System
ExecStart=/usr/sbin/sdbd --listen-port=26101
#include <stdarg.h>
#include <unistd.h>
+#include <tzplatform_config.h>
+
#define TRACE_TAG TRACE_SDB
#include "log.h"
#include "sdbd_plugin.h"
#include "sdktools.h"
-#define LOG_DIRECTORY "/tmp"
+#define LOG_DIRECTORY "/home/owner/share/sdbdlog"
int get_plugin_capability ( parameters* in, parameters* out )
{
} else if ( capability == CAPABILITY_LOG_ENABLE ) {
make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_DISABLED );
} else if ( capability == CAPABILITY_LOG_PATH ) {
- make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", LOG_DIRECTORY );
+ const char* sdkhome = tzplatform_getenv(TZ_SDK_HOME);
+ if (sdkhome != NULL) {
+ make_string_parameter ( & ( out->array_of_parameter[0] ), "%s/share/sdbdlog", sdkhome );
+ } else {
+ make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", LOG_DIRECTORY );
+ }
} else if ( capability == CAPABILITY_APPCMD ) {
make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_ENABLED );
} else if (capability == CAPABILITY_DEBUGMODE ) {
}
}
+#if 0
static void set_syncfile_smack_label(char *src) {
char *label_transmuted = NULL;
char *label = NULL;
*/
}
}
+#endif
static int sync_send_label_notify(int s, const char *path, int success)
{
char *path = buffer;
path++;
path++;
- set_syncfile_smack_label(path);
+ // set_syncfile_smack_label(path);
}
}
return;
}
- if (smack_setlabel(path, SDK_SHELL_LABEL_NAME, SMACK_LABEL_ACCESS) == -1) {
- D("unable to set sdk shell smack label %s due to (errno:%d)\n", SDK_SHELL_LABEL_NAME, errno);
- }
-
// redirect stdout and stderr to the log file
dup2(fd, 1);
dup2(fd, 2);
return -1;
}
- if (smack_setlabel(devname, SDK_SHELL_LABEL_NAME, SMACK_LABEL_ACCESS) == -1) {
- D("unable to set sdk shell smack label %s due to (errno:%d)\n", SDK_SHELL_LABEL_NAME, errno);
- sdb_close(ptm);
- return -1;
- }
-
*pid = fork();
if(*pid < 0) {
D("- fork failed: errno:%d -\n", errno);