[Fedora-directory-commits] adminutil/lib/libadminutil form_post.c, 1.6, 1.7

Noriko Hosoi (nhosoi) fedora-directory-commits at redhat.com
Sat Jun 9 00:27:22 UTC 2007


Author: nhosoi

Update of /cvs/dirsec/adminutil/lib/libadminutil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12965/lib/libadminutil

Modified Files:
	form_post.c 
Log Message:
Resolves: Bug 237356
Summary: Move DS Admin Code into Admin Server (Comment #42)
Description: In the effort of using adminutil instead of the each server's 
local library (e.g., libds_admin), post_begin equivalent used in the DS code 
checks the return value from the function.  Changing the return type from void 
to int to adjust.



Index: form_post.c
===================================================================
RCS file: /cvs/dirsec/adminutil/lib/libadminutil/form_post.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- form_post.c	15 May 2007 00:53:33 -0000	1.6
+++ form_post.c	9 Jun 2007 00:27:20 -0000	1.7
@@ -176,13 +176,14 @@
     return rstr;
 }
 
-PR_IMPLEMENT(void)
+PR_IMPLEMENT(int)
 post_begin(FILE *in) 
 {
     char *vars = NULL, *tmp = NULL;
     int cl;
     char buf1[BUFSIZ];
     char buf2[BUFSIZ];
+    int rc = 0;
 
     if(!(tmp = getenv("CONTENT_LENGTH"))) {
         if (admutil_i18nResource) {
@@ -201,6 +202,7 @@
                     "Your browser sent no content length with a POST command. Please be sure to use a fully compliant browser.",
                     NULL);
         }
+        rc = 1;
     }
         
     cl = atoi(tmp);
@@ -220,6 +222,7 @@
                 "Could not allocate enough memory to read in the POST parameters.",
                 NULL);
       }
+      rc = 1;
     }        
 
     if( !(fread(vars, 1, cl, in)) ) {
@@ -237,12 +240,14 @@
                 "The POST variables could not be read from stdin.",
                 NULL);
       }
+      rc = 1;
     }
 
     vars[cl] = '\0';
 
     input = string_to_vec(vars);
     PL_strfree(vars); /* string_to_vec dups it */
+    return rc;
 }
 
 PR_IMPLEMENT(void)




More information about the Fedora-directory-commits mailing list