Make indent
authorRobert Swiecki <robert@swiecki.net>
Tue, 11 Oct 2016 22:59:10 +0000 (00:59 +0200)
committerRobert Swiecki <robert@swiecki.net>
Tue, 11 Oct 2016 22:59:10 +0000 (00:59 +0200)
cmdline.c
log.c
user.c

index 58b4335adf781ef2eb627d285fc2d5478223dc6b..7efe5166cd063dee1e22a0009477c291ddbdad49 100644 (file)
--- a/cmdline.c
+++ b/cmdline.c
@@ -123,19 +123,19 @@ void cmdlineLogParams(struct nsjconf_t *nsjconf)
                struct mounts_t *p;
                TAILQ_FOREACH(p, &nsjconf->mountpts, pointers) {
                        LOG_I("Mount point: src:'%s' dst:'%s' type:'%s' flags:0x%tx options:'%s'",
-                                               p->src, p->dst, p->fs_type, p->flags, p->options);
+                             p->src, p->dst, p->fs_type, p->flags, p->options);
                }
        }
        {
                struct mapping_t *p;
                TAILQ_FOREACH(p, &nsjconf->uid_mappings, pointers) {
                        LOG_I("Uid mapping: inside_uid:'%s' outside_uid:'%s' count:'%s'",
-                                               p->inside_id, p->outside_id, p->count);
+                             p->inside_id, p->outside_id, p->count);
                }
 
                TAILQ_FOREACH(p, &nsjconf->gid_mappings, pointers) {
                        LOG_I("Gid mapping: inside_uid:'%s' outside_uid:'%s' count:'%s'",
-                                               p->inside_id, p->outside_id, p->count);
+                             p->inside_id, p->outside_id, p->count);
                }
        }
 }
diff --git a/log.c b/log.c
index 28f54c96fbbb2a1b2acb807450c9f0d97d282dbd..1117152452ad2cf331625f8b2e8c5919d66959b7 100644 (file)
--- a/log.c
+++ b/log.c
@@ -54,7 +54,8 @@ bool logInitLogFile(struct nsjconf_t *nsjconf, const char *logfile, bool is_verb
        if (logfile == NULL) {
                log_fd = STDERR_FILENO;
        } else {
-               if (TEMP_FAILURE_RETRY(log_fd = open(logfile, O_CREAT | O_RDWR | O_APPEND, 0640)) == -1) {
+               if (TEMP_FAILURE_RETRY(log_fd = open(logfile, O_CREAT | O_RDWR | O_APPEND, 0640)) ==
+                   -1) {
                        log_fd = STDERR_FILENO;
                        PLOG_E("Couldn't open logfile open('%s')", logfile);
                        return false;
diff --git a/user.c b/user.c
index e785ea1ff8e6bb50ea5b119c8ed656cf9ded24b1..56c5fb558ae83a0a34d2b83eeb686d97bafac82e 100644 (file)
--- a/user.c
+++ b/user.c
@@ -54,7 +54,8 @@ static bool userSetGroups(pid_t pid)
        return true;
 }
 
-static bool userUidMapSelf(struct nsjconf_t *nsjconf, pid_t pid) {
+static bool userUidMapSelf(struct nsjconf_t *nsjconf, pid_t pid)
+{
        char fname[PATH_MAX];
        char map[128];
 
@@ -70,7 +71,8 @@ static bool userUidMapSelf(struct nsjconf_t *nsjconf, pid_t pid) {
        return true;
 }
 
-static bool userGidMapSelf(struct nsjconf_t *nsjconf, pid_t pid) {
+static bool userGidMapSelf(struct nsjconf_t *nsjconf, pid_t pid)
+{
        char fname[PATH_MAX];
        char map[128];
 
@@ -86,16 +88,17 @@ static bool userGidMapSelf(struct nsjconf_t *nsjconf, pid_t pid) {
 }
 
 // use /usr/bin/newgidmap for writing the uid and gid map
-static bool userGidMapExternal(struct nsjconf_t *nsjconf, pid_t pid) {
+static bool userGidMapExternal(struct nsjconf_t *nsjconf, pid_t pid)
+{
        char cmd_buf[1024];
        char *cmd_ptr = cmd_buf;
        size_t len = sizeof(cmd_buf);
        int write_size;
 
        write_size = snprintf(cmd_ptr, len, "/usr/bin/newgidmap %lu %lu %lu 1",
-                       (unsigned long)pid,
-                       (unsigned long)nsjconf->inside_gid,
-                       (unsigned long)nsjconf->outside_gid);
+                             (unsigned long)pid,
+                             (unsigned long)nsjconf->inside_gid,
+                             (unsigned long)nsjconf->outside_gid);
        if (write_size <= 0 || (size_t) write_size > len) {
                LOG_E("snprintf writing the new{u,g}idmap command failed");
                return false;
@@ -106,8 +109,8 @@ static bool userGidMapExternal(struct nsjconf_t *nsjconf, pid_t pid) {
        struct mapping_t *p;
        TAILQ_FOREACH(p, &nsjconf->gid_mappings, pointers) {
                write_size = snprintf(cmd_ptr, len, " %s %s %s",
-                               p->inside_id, p->outside_id, p->count);
-       if (write_size <= 0 || (size_t) write_size > len) {
+                                     p->inside_id, p->outside_id, p->count);
+               if (write_size <= 0 || (size_t) write_size > len) {
                        LOG_E("snprintf writing the new{u,g}idmap command failed");
                        return false;
                }
@@ -116,25 +119,26 @@ static bool userGidMapExternal(struct nsjconf_t *nsjconf, pid_t pid) {
        }
 
        if (system(cmd_buf) != 0) {
-                       LOG_E("system('%s') failed", cmd_buf);
-                       while(1) ;
-                       return false;
+               LOG_E("system('%s') failed", cmd_buf);
+               while (1) ;
+               return false;
        }
 
        return true;
 }
 
 // use /usr/bin/newuidmap for writing the uid and gid map
-static bool userUidMapExternal(struct nsjconf_t *nsjconf, pid_t pid) {
+static bool userUidMapExternal(struct nsjconf_t *nsjconf, pid_t pid)
+{
        char cmd_buf[1024];
        char *cmd_ptr = cmd_buf;
        size_t len = sizeof(cmd_buf);
        int write_size;
 
        write_size = snprintf(cmd_ptr, len, "/usr/bin/newuidmap %lu %lu %lu 1",
-                       (unsigned long)pid,
-                       (unsigned long)nsjconf->inside_uid,
-                       (unsigned long)nsjconf->outside_uid);
+                             (unsigned long)pid,
+                             (unsigned long)nsjconf->inside_uid,
+                             (unsigned long)nsjconf->outside_uid);
        if (write_size <= 0 || (size_t) write_size > len) {
                LOG_E("snprintf writing the new{u,g}idmap command failed");
                return false;
@@ -145,8 +149,8 @@ static bool userUidMapExternal(struct nsjconf_t *nsjconf, pid_t pid) {
        struct mapping_t *p;
        TAILQ_FOREACH(p, &nsjconf->uid_mappings, pointers) {
                write_size = snprintf(cmd_ptr, len, " %s %s %s",
-                               p->inside_id, p->outside_id, p->count);
-       if (write_size <= 0 || (size_t) write_size > len) {
+                                     p->inside_id, p->outside_id, p->count);
+               if (write_size <= 0 || (size_t) write_size > len) {
                        LOG_E("snprintf writing the new{u,g}idmap command failed");
                        return false;
                }
@@ -155,8 +159,8 @@ static bool userUidMapExternal(struct nsjconf_t *nsjconf, pid_t pid) {
        }
 
        if (system(cmd_buf) != 0) {
-                       LOG_E("system('%s') failed", cmd_buf);
-                       return false;
+               LOG_E("system('%s') failed", cmd_buf);
+               return false;
        }
 
        return true;