Project

General

Profile

Feature #5610

Allow strings as input for Process.uid=

Added by shevegen (Robert A. Heiler) almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:40923]

Description

On my unix system I often have a "debug" user account, belonging to the "debug" group.

With:

Process.euid

You can find out the effective uid and you can change it via =.

Process.euid = 522

That works. Today I tried to do this though:

Process.euid = "debug"

It does not work because .euid= wants a string.

Would it not be better to be more flexible than that? Internally it
could be converted into a number anyway as /etc/passwd can be
read. And if it can not be converted, an exception could be raised.

At least for me that would be quite convenient, no idea if this has
merit for others, but then again it is just a proposal. :)

Thank you for reading.

Associated revisions

Revision 35158
Added by nobu (Nobuyoshi Nakada) over 5 years ago

  • process.c (obj2uid, obj2gid): allow strings as input user/group id. [Feature #5610]

Revision 35158
Added by nobu (Nobuyoshi Nakada) over 5 years ago

  • process.c (obj2uid, obj2gid): allow strings as input user/group id. [Feature #5610]

Revision 35158
Added by nobu (Nobuyoshi Nakada) over 5 years ago

  • process.c (obj2uid, obj2gid): allow strings as input user/group id. [Feature #5610]

Revision 35158
Added by nobu (Nobuyoshi Nakada) over 5 years ago

  • process.c (obj2uid, obj2gid): allow strings as input user/group id. [Feature #5610]

History

#1 [ruby-core:40924] Updated by shevegen (Robert A. Heiler) almost 6 years ago

Oops, sorry. Not a bug, but a feature request. Hmm not sure how to change it ...

#2 [ruby-core:40929] Updated by drbrain (Eric Hodel) almost 6 years ago

  • Tracker changed from Bug to Feature
  • Category set to core
  • Priority changed from 3 to Normal
  • Target version set to 2.0.0

#3 [ruby-core:40931] Updated by kosaki (Motohiro KOSAKI) almost 6 years ago

The request looks make sense to me.

#4 [ruby-core:43748] Updated by mame (Yusuke Endoh) over 5 years ago

  • Status changed from Open to Assigned
  • Assignee set to kosaki (Motohiro KOSAKI)

Kosaki-san,

Are you interested in creating a patch?

--
Yusuke Endoh mame@tsg.ne.jp

#5 [ruby-core:43786] Updated by nobu (Nobuyoshi Nakada) over 5 years ago

=begin
Since (({Process.groups=})) already accepts strings, this proposal sounds reasonable.
=end

#6 Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r35158.
markus, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • process.c (obj2uid, obj2gid): allow strings as input user/group id. [Feature #5610]

Also available in: Atom PDF