Browse Source

uuidd: fix open/lock state issue

* warn on open/lock state issue
* remove ProtectSystem=strict from systemd service setting, because it
  makes clock state file read-only

  openat(AT_FDCWD, "/var/lib/libuuid/clock.txt",
     O_RDWR|O_CREAT|O_CLOEXEC, 0660) = -1 EROFS (Read-only file system)

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2040366
Signed-off-by: Karel Zak <kzak@redhat.com>
pull/1581/head
Karel Zak 7 months ago
parent
commit
f27876f9c1
  1. 9
      misc-utils/uuidd.c
  2. 1
      misc-utils/uuidd.service.in

9
misc-utils/uuidd.c

@ -494,7 +494,8 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
break;
case UUIDD_OP_TIME_UUID:
num = 1;
__uuid_generate_time(uu, &num);
if (__uuid_generate_time(uu, &num) < 0 && !uuidd_cxt->quiet)
warnx(_("failed to open/lock clock counter"));
if (uuidd_cxt->debug) {
uuid_unparse(uu, str);
fprintf(stderr, _("Generated time UUID: %s\n"), str);
@ -504,7 +505,8 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
break;
case UUIDD_OP_RANDOM_UUID:
num = 1;
__uuid_generate_random(uu, &num);
if (__uuid_generate_time(uu, &num) < 0 && !uuidd_cxt->quiet)
warnx(_("failed to open/lock clock counter"));
if (uuidd_cxt->debug) {
uuid_unparse(uu, str);
fprintf(stderr, _("Generated random UUID: %s\n"), str);
@ -513,7 +515,8 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
reply_len = sizeof(uu);
break;
case UUIDD_OP_BULK_TIME_UUID:
__uuid_generate_time(uu, &num);
if (__uuid_generate_time(uu, &num) < 0 && !uuidd_cxt->quiet)
warnx(_("failed to open/lock clock counter"));
if (uuidd_cxt->debug) {
uuid_unparse(uu, str);
fprintf(stderr, P_("Generated time UUID %s "

1
misc-utils/uuidd.service.in

@ -8,7 +8,6 @@ ExecStart=@usrsbin_execdir@/uuidd --socket-activation
Restart=no
User=uuidd
Group=uuidd
ProtectSystem=strict
ProtectHome=yes
PrivateDevices=yes
PrivateNetwork=yes

Loading…
Cancel
Save