Skip to content

Commit

Permalink
dbus-util: let's take it down a notch when converting file mode to st…
Browse files Browse the repository at this point in the history
…ring

I'm definitely a fan of precision, but in this case it's a bit too much:

    $ systemd-run --unit=test --socket-property=ListenFIFO=/tmp/foo --socket-property=SocketMode=0644 true
    $ systemctl cat test.socket
    # /run/systemd/transient/test.socket
    # This is a transient unit file, created programmatically via the systemd API. Do not edit.
    [Unit]
    Description=/usr/bin/true

    [Socket]
    ListenFIFO=/tmp/foo
    SocketMode=0000000000000000000000000000000000000644
  • Loading branch information
mrc0mmand committed Jun 1, 2023
1 parent 6178ced commit b86ed7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/dbus-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int bus_property_get_triggered_unit(
return sd_bus_message_append(reply, "s", trigger ? trigger->id : NULL);
}

BUS_DEFINE_SET_TRANSIENT(mode_t, "u", uint32_t, mode_t, "%040o");
BUS_DEFINE_SET_TRANSIENT(mode_t, "u", uint32_t, mode_t, "%04o");
BUS_DEFINE_SET_TRANSIENT(unsigned, "u", uint32_t, unsigned, "%" PRIu32);

static inline bool valid_user_group_name_or_id_relaxed(const char *u) {
Expand Down

0 comments on commit b86ed7f

Please sign in to comment.