summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-09-22 17:04:38 +0200
committerDaniel Mack <github@zonque.org>2015-09-22 17:04:38 +0200
commitd11885c81419cac217ae132c1ef80733707ba650 (patch)
treec367fa9b5198865e7f5bb10a0121ccd17f0cba7d /src/machine
parentf98f4ace4df1b67572a5fbb3b1924b303d77d773 (diff)
parent3be78ab2b8f26c3c868275cac2458553efeda8a5 (diff)
Merge pull request #1335 from poettering/some-fixes
A variety of mostly unrelated fixes
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machinectl.c4
-rw-r--r--src/machine/machined-dbus.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index ab113efb28..d276fbe956 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -327,7 +327,7 @@ static int list_images(int argc, char *argv[], void *userdata) {
printf("%-*s %-*s %s%-3s%s %-*s %-*s %-*s\n",
(int) max_name, images[j].name,
(int) max_type, images[j].type,
- images[j].read_only ? ansi_highlight_red() : "", yes_no(images[j].read_only), images[j].read_only ? ansi_highlight_off() : "",
+ images[j].read_only ? ansi_highlight_red() : "", yes_no(images[j].read_only), images[j].read_only ? ansi_normal() : "",
(int) max_size, strna(format_bytes(size_buf, sizeof(size_buf), images[j].size)),
(int) max_crtime, strna(format_timestamp(crtime_buf, sizeof(crtime_buf), images[j].crtime)),
(int) max_mtime, strna(format_timestamp(mtime_buf, sizeof(mtime_buf), images[j].mtime)));
@@ -793,7 +793,7 @@ static void print_image_status_info(sd_bus *bus, ImageStatusInfo *i) {
printf("\t RO: %s%s%s\n",
i->read_only ? ansi_highlight_red() : "",
i->read_only ? "read-only" : "writable",
- i->read_only ? ansi_highlight_off() : "");
+ i->read_only ? ansi_normal() : "");
s1 = format_timestamp_relative(ts_relative, sizeof(ts_relative), i->crtime);
s2 = format_timestamp(ts_absolute, sizeof(ts_absolute), i->crtime);
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index eef9c5fa5f..41bb106d28 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -876,7 +876,7 @@ static int method_map_from_machine_user(sd_bus_message *message, void *userdata,
if (r < 0)
return r;
- if (UID_IS_INVALID(uid))
+ if (!uid_is_valid(uid))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid user ID " UID_FMT, uid);
machine = hashmap_get(m->machines, name);
@@ -910,7 +910,7 @@ static int method_map_from_machine_user(sd_bus_message *message, void *userdata,
continue;
converted = uid - uid_base + uid_shift;
- if (UID_IS_INVALID(converted))
+ if (!uid_is_valid(converted))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid user ID " UID_FMT, uid);
return sd_bus_reply_method_return(message, "u", (uint32_t) converted);
@@ -929,7 +929,7 @@ static int method_map_to_machine_user(sd_bus_message *message, void *userdata, s
r = sd_bus_message_read(message, "u", &uid);
if (r < 0)
return r;
- if (UID_IS_INVALID(uid))
+ if (!uid_is_valid(uid))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid user ID " UID_FMT, uid);
if (uid < 0x10000)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_USER_MAPPING, "User " UID_FMT " belongs to host UID range", uid);
@@ -968,7 +968,7 @@ static int method_map_to_machine_user(sd_bus_message *message, void *userdata, s
continue;
converted = (uid - uid_shift + uid_base);
- if (UID_IS_INVALID(converted))
+ if (!uid_is_valid(converted))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid user ID " UID_FMT, uid);
o = machine_bus_path(machine);
@@ -994,7 +994,7 @@ static int method_map_from_machine_group(sd_bus_message *message, void *groupdat
if (r < 0)
return r;
- if (GID_IS_INVALID(gid))
+ if (!gid_is_valid(gid))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid group ID " GID_FMT, gid);
machine = hashmap_get(m->machines, name);
@@ -1028,7 +1028,7 @@ static int method_map_from_machine_group(sd_bus_message *message, void *groupdat
continue;
converted = gid - gid_base + gid_shift;
- if (GID_IS_INVALID(converted))
+ if (!gid_is_valid(converted))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid group ID " GID_FMT, gid);
return sd_bus_reply_method_return(message, "u", (uint32_t) converted);
@@ -1047,7 +1047,7 @@ static int method_map_to_machine_group(sd_bus_message *message, void *groupdata,
r = sd_bus_message_read(message, "u", &gid);
if (r < 0)
return r;
- if (GID_IS_INVALID(gid))
+ if (!gid_is_valid(gid))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid group ID " GID_FMT, gid);
if (gid < 0x10000)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_GROUP_MAPPING, "Group " GID_FMT " belongs to host GID range", gid);
@@ -1086,7 +1086,7 @@ static int method_map_to_machine_group(sd_bus_message *message, void *groupdata,
continue;
converted = (gid - gid_shift + gid_base);
- if (GID_IS_INVALID(converted))
+ if (!gid_is_valid(converted))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid group ID " GID_FMT, gid);
o = machine_bus_path(machine);