[sudo-users] behavior of create_iolog_path(), iolog_mkdtemp() and sudo_logsrvd version 1.9.1

Andy W. andreww35t at gmail.com
Mon Jun 15 21:52:04 MDT 2020


Hello,
I am noticing that the "XXXXXX" suffix  documented in the sudo_logsrvd.conf
manual does not seem to work as advertised or I have misunderstood.  I am
running sudo_logsrvd 1.9.1.

I get the same result no matter what I put into the iolog_file value of the
conf file--with or without expansions such as %{hostname} and with or
without directory components.  If the value contains XXXXXX at the end, it
fails with the inappropriate ioctl error below.

Test cases:
Demonstrating with absurd iolog_file value of "this_actual_string_XXXXXX":

> # grep ^iolog_[df]i /etc/sudo_logsrvd.conf
> iolog_dir = /var/log/sudo-io/
> iolog_file = this_actual_string_XXXXXX
> # grep create_iolog /var/log/sudo_logsrvd_debug
> Jun 16 04:27:38 sudo_logsrvd[6909] unable to mkdir iolog path
> /var/log/sudo-io/this_actual_string_eEHTnR: Inappropriate ioctl for device
> @ create_iolog_path() ./iolog_writer.c:597
> # grep logsrvd /etc/sudo.conf
> Debug sudo_logsrvd /var/log/sudo_logsrvd_debug util at warn
> #
>

Same result with this (anonymised):

> # grep ^iolog_[df]i /etc/sudo_logsrvd.conf
> iolog_dir = /var/log/sudo-io/
> iolog_file = %{hostname}/%{user}/log-XXXXXXX
> # grep create_iolog /var/log/sudo_logsrvd_debug
> Jun 16 04:37:46 sudo_logsrvd[7126] unable to mkdir iolog path
> /var/log/sudo-io/mysystem/myuser/log-XBMUKde: Inappropriate ioctl for
> device @ create_iolog_path() ./iolog_writer.c:597
> #


I want the XXXXXX functionality becase I am trying to avoid the truncation
scenario mentioned in the manual:

               If the path created by concatenating iolog_dir and
>                iolog_file already exists, the existing I/O log file
>                will be truncated and overwritten unless iolog_file
>                ends in six or more Xs.



 Any suggestions would be appreciated.


Best Regards,

Andrew West


More information about the sudo-users mailing list