List Info

Thread: Win32 patches




Win32 patches
user name
2006-09-07 18:47:42
Some patches for <pwd.h> and <grp.h> functions
are needed on
Windows. Attached in diffs-6.txt.

--gv
	--- SVN-Latest\cherokee\unix4win32.c	Thu Sep 07 20:40:22
2006
+++ cherokee\unix4win32.c	Thu Sep 07 18:05:25 2006
 -152,6
+152,8 
 getpwuid (int uid)
 {
 	__pw.pw_name  = getlogin ();
+	__pw.pw_passwd = NULL;
+	__pw.pw_gecos  = NULL;
 	__pw.pw_dir   = home_dir;
 	__pw.pw_shell = login_shell;
 	__pw.pw_uid   = 0;
 -162,10
+164,9 
 /* everyone is root on WIN32
  */
 struct passwd *
-getpwnam (char *name)
+getpwnam (const char *name)
 {
-        struct passwd* pw = (struct passwd*)
malloc(sizeof(struct passwd));
-        memset (pw, '\0', sizeof(struct passwd));
+        struct passwd* pw = calloc(sizeof(struct passwd),
1);
         return pw;
 }

--- SVN-Latest\cherokee\unix4win32.h	Thu Sep 07 20:40:23
2006
+++ cherokee\unix4win32.h	Thu Sep 07 18:06:49 2006
 -103,19
+103,22 

 struct passwd {
 	char *pw_name;   /* login user id  */
+	char *pw_passwd; /* login password */
 	char *pw_dir;    /* home directory */
 	char *pw_shell;  /* login shell    */
+	char *pw_gecos;
 	int   pw_gid;
 	int   pw_uid;
 };

 struct group {
 	char *gr_name;   /* login user id  */
+	char *gr_passwd; /* login password */
 	int  gr_gid;
 };

 struct passwd *getpwuid (int uid);
-struct passwd *getpwnam (char *name);
+struct passwd *getpwnam (const char *name);


 /* Structure for scatter/gather I/O.
--- SVN-Latest\cherokee\util.c	Thu Sep 07 20:40:23 2006
+++ cherokee\util.c	Thu Sep 07 17:41:43 2006
 -803,7
+803,7 
 	int tmp = 1;

 #ifdef _WIN32
-	tmp = ioctlsocket (fd, FIONBIO, (u_long)&tmp);
+	tmp = ioctlsocket (fd, FIONBIO, (u_long*)&tmp);
 #else
 	tmp = ioctl (fd, FIONBIO, &tmp);
 #endif
--- SVN-Latest\cherokee\util.h	Thu Sep 07 20:40:23 2006
+++ cherokee\util.h	Thu Sep 07 17:38:19 2006
 -40,8
+40,13 
 # include <arpa/inet.h>
 #endif

+#ifdef HAVE_PWD_H
 #include <pwd.h>
+#endif
+
+#ifdef HAVE_GRP_H
 #include <grp.h>
+#endif

 #include <time.h>
 #include <dirent.h>
_______________________________________________
Cherokee mailing list
Cherokee0x50.org
http://www.0x50.org/cgi-bin/mailman/listinfo/cherokee
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )