update_ssh.pl may exit before deploying all keys #1

Closed
opened 2025-04-26 08:46:36 +02:00 by patrick · 1 comment
Owner

Some parts of the code will cause an premature exit of the script if an error happens due to external factors. For example when setting ownerships and/or permissions on the final public key file:

    chmod ($perm, "$file")
        or do_log ("ERROR: cannot set permissions on $file [$!/$hostname]")
        and exit (1);
    chown ($uid, $gid, "$file")
        or do_log ("ERROR: cannot set ownerships on $file [$!/$hostname]")
        and exit (1);

As a consequence not all public keys may be deployed and this may ultimately leave the system in an unmanaged state (loss of access).

It would be better to allow such errors to be ignored via a configuration option.

Some parts of the code will cause an **premature exit** of the script if an error happens due to external factors. For example when setting ownerships and/or permissions on the final public key file: ``` chmod ($perm, "$file") or do_log ("ERROR: cannot set permissions on $file [$!/$hostname]") and exit (1); chown ($uid, $gid, "$file") or do_log ("ERROR: cannot set ownerships on $file [$!/$hostname]") and exit (1); ``` As a consequence not all public keys may be deployed and this may ultimately leave the system in an unmanaged state (loss of access). It would be better to allow such errors to be ignored via a configuration option.
patrick self-assigned this 2025-04-26 08:46:44 +02:00
Author
Owner

Fixed in b484d9a264 by adding the ignore_errors flag

Fixed in b484d9a264 by adding the `ignore_errors` flag
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kudos/ssh_controls#1
No description provided.