[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

chmod 4760 og 3<&0



Man kan kun køre /usr/bin/checkpassword som root. Det vil jeg gerne lave 
lidt om på, så jeg har lavet et wrapper script, som jeg har givet følgende 
rettigheder:

server:/home/dbj# ls -la chkpw.sh
-rwsr-x--- 1 root dbj 38 2009-09-26 19:23 chkpw.sh

Bemærk s'et. Først ser vi, at det virker som root:

server:/home/dbj# printf "%s\0%s\0%s\0" dbj password Y123456 | 
/home/dbj/chkpw.sh id 3<&0
uid=1002(dbj) gid=1002(dbj) groups=1002(dbj)

Hvis nogen kan forklare denne redirection af standard input til 3, og hvad 
formålet med det er, så bliver jeg glad.

Nu laver vi
server:/home/dbj# su dbj
sslug@sslug:~$ printf "%s\0%s\0%s\0" dbj password Y123456 | 
/home/dbj/chkpw.sh id 3<&0
sslug@sslug:~$

Nu fejler det. Hvorfor?
Skyldes det at bash fortolkeren altid kører som user og ignorer s'et sat for 
scriptet? Jeg tror det, men hvordan omgår man det? Jeg har lavet en kopi af 
programmet, som jeg har givet de fornødne rettigheder, men hvad gør man med 
et script?




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-10-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *