bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: invoke tilde expansion on quoted string


From: Linda Walsh
Subject: Re: invoke tilde expansion on quoted string
Date: Sun, 07 Apr 2013 01:13:09 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666

Eric Blake wrote:
> Even if your system allows shell metacharacters in usernames, tilde
> expansion does not.
----

I never  thought of that -- I seemed like there should be a
getxxxx command that access the appropriate library by using
your systems's configuration.  Unfortunately, it looks like
it might be SuSE only, though you could grab the latest source
for it -- it's in their glibc-2.17 package, so the source
for that would be:
http://download.opensuse.org/factory/repo/src-oss/suse/src/glibc-2.17-10.2.src.rpm

I've seen similar utils for nis/yp, but not one that was
"general" to work with glib which uses the OS's preferred lookup
methods.



It does handle metacharacters (spaces, '$' and '\' tested):

> getent passwd 'Domain Administrator'
Domain Administrator:x:500:18:Domain Admin accnt:/home/root:/bin/bash
> getent passwd 'NtDom$'
NtDom$:x:50505:516:S-1-5-21-33333-77777-33333:/var/lib/nobody:/bin/nologin
> getent passwd 'NtDom\root'
NtDom\root:x:0:0:root:/root:/bin/bash

---
Certainly is another place where NUL terminated strings would be
useful for holding any returned value.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]