| »ç¿ëÀÚ :: Powent. User :: Pwent´Â Perl ÀÎÅÍÆäÀ̽º getpw * () ÇÔ¼öÀÔ´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
»ç¿ëÀÚ :: Powent. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Tom Christiansen
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~nwclark/perl-5.8.8/pod/perltoot.pod
»ç¿ëÀÚ :: Powent. ű×
»ç¿ëÀÚ :: Powent. ¼³¸í
User :: Pwent´Â Perl ÀÎÅÍÆäÀ̽º GetPW * () ÇÔ¼öÀÔ´Ï´Ù. User :: Pwent´Â Perl ÀÎÅÍÆäÀ̽º GetPW * () ÇÔ¼öÀÔ´Ï´Ù .Synopsis User :: Pwent; $ pw = getPwnam ( 'µ¥¸ó') || "DAEMON »ç¿ëÀÚ ¾øÀ½"; if ($ pw-> uid == 1 $ pw-> dir = m # ^ / (bin | tmp)? z # s) {root dir on on 1 " } $ real_shell = $ PW-> ½© || '/ bin / sh'; (($ fullname, $ office, $ vistphone, $ homphone) = split / s *, s * /, $ pw-> gecos) {s // ucfirst (lc ($ pw-> name) / ge; } »ç¿ëÀÚ :: Pwent QW (Çʵå)¸¦ »ç¿ëÇϽʽÿÀ. getpwnam ( 'µ¥¸ó') || "DAEMON »ç¿ëÀÚ ¾øÀ½"; if ($ pw_uid == 1 $ pw_dir = ~ m # ^ / (bin | tmp)? z # s) {root dir on on other on on in of in root dir "; } $ pw = getpw ($ who); User :: Pwent QW / : ±âº» PW_HAS /; if (pw_has (qw ) {....} (pw_has ( "name name name uid gid passwd")) {....} ±¸Á¶Ã¼ pwd°¡ÀÖ´Â °æ¿ì : ", scalar pw_has (), "n";ÀÌ ¸ðµâÀÇ ±âº» ³»º¸³»±â´Â ÇÙ½É getPwent (), getpwuid () ¹× getpwnam () ÇÔ¼ö¸¦ µ¤¾î ¾¹´Ï´Ù. user :: pwent °´Ã¼¸¦ ¹ÝȯÇÏ´Â ¹öÀüÀ¸·Î ¹Ù²ß´Ï´Ù. ÀÌ °´Ã¼´Â pwd.hÀÇ CÀÇ passwd ±¸Á¶¿¡¼ À¯»çÇÏ°Ô ¸í¸í µÈ ±¸Á¶ Çʵå À̸§À» ¹ÝȯÇÏ´Â ¸Þ¼Òµå¸¦ °¡Áö°í ÀÖ½À´Ï´Ù. Áï, À̸§, passwd, uid, gid, º¯°æ, ³ªÀÌ, ÇÒ´ç·®, ÁÖ¼®, Ŭ·¡½º, gecos, dir, shell ¹× ¸¸·á. passwd, gecos ¹× ½© Çʵå´Â taint ¸ðµå·Î ½ÇÇàµÉ ¶§ ¿À¿°µË´Ï´Ù. ÇÊµå °¡Á® ¿À±â ű׸¦ »ç¿ëÇÏ¿© ÀÏ¹Ý º¯¼ö·Î ¸ðµç ±¸Á¶ Çʵ带 Á÷Á¢ °¡Á®¿Ã ¼öµµ ÀÖ½À´Ï´Ù. (ÀÌ´Â ¿©ÀüÈ÷ ÇÙ½É ±â´ÉÀ» ¹«½ÃÇÕ´Ï´Ù.)ÀÌ Çʵå´Â ¾ÕÀÇ PW_¶ó´Â º¯¼ö¸¦ ¾Õ¼± PW_ ÇÁ·ÐÆ®·Î ÁöÁ¤ÇÕ´Ï´Ù. µû¶ó¼ $ passwd_obj-> shellÀº fields.the getpw () ÇÔ¼ö¸¦ °¡Á® ¿À´Â °æ¿ì $ pw_shell¿¡ ÇØ´çÇÕ´Ï´Ù. ÇÙ½É ÀçÁ¤ÀÇ, ºó °¡Á® ¿À±â ¸ñ·Ï »ç¿ëÀ» Àü´Þ ÇÑ ´ÙÀ½ Àüü ±ÔÁ¤ À̸§À¸·Î ÇÔ¼ö ÇÔ¼ö¿¡ ¾×¼¼½ºÇÕ´Ï´Ù. ³»ÀåÀº Ç×»ó Core :: Pseudo-Package¸¦ ÅëÇØ °è¼Ó »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿ä±¸ »çÇ× : ¡¤ Perl.
»ç¿ëÀÚ :: Powent. °ü·Ã ¼ÒÇÁÆ®¿þ¾î