Added database protection with setuid.
Added the initial support for the database protection with the setuid mechanism. In the beginning the program creates(or opens) the database as a special user, and then switches to the real uid and functions normally.
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -10,6 +10,8 @@
|
||||
See the file LICENSE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#define FUSE_USE_VERSION 31
|
||||
|
||||
#define _GNU_SOURCE
|
||||
@@ -28,17 +30,17 @@ const char *mountpoint = NULL;
|
||||
int main(int argc, char *argv[]) {
|
||||
umask(0);
|
||||
|
||||
mountpoint = realpath(argv[argc - 1], NULL);
|
||||
|
||||
int ret = source_init(mountpoint);
|
||||
int ret = init_ui_socket();
|
||||
if (ret != 0) {
|
||||
perror("source_init");
|
||||
fprintf(stderr, "Could not initalize ui-socket.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ret = init_ui_socket();
|
||||
mountpoint = realpath(argv[argc - 1], NULL);
|
||||
|
||||
ret = source_init(mountpoint);
|
||||
if (ret != 0) {
|
||||
fprintf(stderr, "Could not initalize ui-socket.\n");
|
||||
perror("source_init");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user