Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Anonymous
Tuesday, January 9th, 2007 at 4:16:51pm UTC 

  1. --- safe_mode.c.old     2007-01-10 04:22:08.000000000 +0000
  2. +++ safe_mode.c 2007-01-10 05:54:30.686444344 +0000
  3. @@ -228,12 +228,32 @@
  4.                return SG(request_info).current_user;   
  5.  #else
  6.                struct passwd *pwd;
  7. +#ifdef HAVE_GETPWUID_R
  8. +              struct passwd _pw;
  9. +              struct passwd *retpwptr = NULL;
  10. +              int pwbuflen;
  11. +              char *pwbuf;
  12. +              int ret;
  13. +              pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
  14. +              pwbuf = emalloc(pwbuflen);
  15.  
  16. +              ret = getpwuid_r(pstat->st_uid, &_pw, pwbuf, pwbuflen, &retpwptr);
  17. +              if (0 != ret) {
  18. +            efree(pwbuf);
  19. +                     return "";
  20. +              }
  21. +              pwd = &_pw;
  22. +#else
  23.                if ((pwd=getpwuid(pstat->st_uid))==NULL) {
  24.                       return "";
  25.                }
  26. +#endif
  27. +   
  28.                SG(request_info).current_user_length = strlen(pwd->pw_name);
  29.                SG(request_info).current_user = estrndup(pwd->pw_name, SG(request_info).current_user_length);
  30. +#ifdef HAVE_GETPWUID_R
  31. +              efree(pwbuf);
  32. +#endif
  33.                return SG(request_info).current_user;   
  34.  #endif
  35.         }     

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right
worth-right