Setting such a mask will make any files created on ocassion (such as
temporary files) unreadable by others.
Change-Id: I6843a49cb123a663effb1ab99e8118e968786624
#define __DEFS_H__
#define KERNEL_DEFINED_TASK_COMM_LEN 16 // from include/linux/sched.h
+#define DEFAULT_UMASK 0077
#define CRASH_PATH "@CRASH_PATH@"
#define CRASH_ROOT_PATH "@CRASH_ROOT_PATH@"
#include <sys/capability.h>
#include <sys/prctl.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include "shared/log.h"
{
int res;
+ /* Have consinsent umask across invocations - from shell, crash-service, kernel */
+ umask(DEFAULT_UMASK);
+
if (!drop_privileges(USER_NAME)) {
res = EXIT_FAILURE;
goto exit;
#include <stdbool.h>
#include <stdlib.h>
#include <sys/select.h>
+#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int main(void)
{
+ /* Have consinsent umask across invocations - from shell, crash-service, kernel */
+ umask(DEFAULT_UMASK);
+
if (!have_livecoredumper()) {
_E("livecoredumper not available - can not provide livedump API. Terminating.\n");
return EXIT_FAILURE;