[clug] Python question Re setuid()

Leigh Makewell leigh at ozforces.com
Fri Jan 16 01:25:16 GMT 2004


Thank you.

I used the code that Brad gave me. Works perfectly.

Darren Freeman wrote:

>On Fri, 2004-01-16 at 11:26, Leigh Makewell wrote:
>  
>
>>Hi guys.
>>    
>>
>
>  
>
>>So does anyone know how to get the userid for a given username?
>>
>>I suppose I could parse the passwd file, but thats just a pain in the 
>>butt :)
>>    
>>
>
>Not really, I think an awk script would do the trick, or even a shell
>script. Set your delimiter to ':' and the first entry is the username.
>Awk will find that no problems. Then the third entry is the uid.
>
>The following line entered at a shell will print my UID:
>
>gawk -F ':' '/dfreeman:*/ {print $3}' </etc/passwd
>
>  
>
>>Leigh Makewell
>>    
>>
>
>Have fun,
>Darren
>  
>



More information about the linux mailing list