You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB

27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 4 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2002 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 2.02 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available at through the world-wide-web at |
  10. | http://www.php.net/license/2_02.txt. |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Sterling Hughes <sterling@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #include "php.h" /*php specific */
  20. #define WIN32_LEAN_AND_MEAN
  21. #include <windows.h>
  22. #include <lmaccess.h>
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <string.h>
  26. #include <lmapibuf.h>
  27. #include "pwd.h"
  28. #include "grp.h"
  29. #ifndef THREAD_SAFE
  30. static struct passwd pwd;
  31. #endif
  32. static char *home_dir = ".";
  33. static char *login_shell = "not command.com!";
  34. struct passwd *
  35. getpwnam(char *name)
  36. {
  37. return (struct passwd *) 0;
  38. }
  39. char *
  40. getlogin()
  41. {
  42. static char name[256];
  43. DWORD max_len = 256;
  44. GetUserName(name, &max_len);
  45. return name;
  46. }
  47. struct passwd *
  48. getpwuid(int user_id)
  49. {
  50. pwd.pw_name = getlogin();
  51. pwd.pw_dir = home_dir;
  52. pwd.pw_shell = login_shell;
  53. pwd.pw_uid = 0;
  54. return &pwd;
  55. }