[Top][All Lists]

[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: Gecko/20100228 Lightning/0.9 Thunderbird/ Mnenhy/

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:

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

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$'
> getent passwd 'NtDom\root'

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]