ydotool icon indicating copy to clipboard operation
ydotool copied to clipboard

feat: look up username/groupname for socket ownership

Open s3lph opened this issue 1 year ago • 0 comments

At the moment, the uid/gid for the ydotoold socket ownership must be provided numerically.

This PR extends the socket owner string parsing with the following logic:

  1. Try to parse uid and gid as int
    • If the entire string is consumed (i.e. it was fully numerical), treat it as uid/gid => done
  2. Otherwise, treat it as a username or groupname and look it up via getpwnam/getgrnam
    • If the name is not found, exit
    • Otherwise use the found user's uid / group's gid

s3lph avatar Nov 23 '24 19:11 s3lph