Message-ID: <35B0CF79.E2CA5A52@cue.satnet.net> Date: Sat, 18 Jul 1998 11:38:18 -0500 From: "Ronald Patiņo G" MIME-Version: 1.0 To: "djgpp AT delorie DOT com" Subject: How can I compile and run a c program under BSD Unix using gcc Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Hi i got this program #include #include #include #include #include "util.h" main() { int i; double length; char *DATA; FILE *fp; char *name, *pw; struct spwd *mypw; char *oldpw, *cmdline, *tmpline; char salt[3]; const char *str_len = getenv("CONTENT_LENGTH"); chdir ("/tmp"); if (!str_len) { exit (0); } length = strtod ( str_len, NULL); if (!length) { exit (0); } DATA = malloc (length + 5); name = malloc (1024); pw = malloc (1024); oldpw = malloc (1024); cmdline = malloc (1024); tmpline = malloc (1024); for (i=0;i < length ; i++) { fscanf(stdin, "%c", &DATA[i]); } DATA[++i] = '&'; DATA[++i] = '\0'; name[0] = '\0'; pw[0] = '\0'; get_var (DATA, name, "name"); get_var (DATA, pw, "pw"); name++; pw++; printf ("Content-type: text/html\n\n"); fflush (stdout); if (!strcmp ("felixpollo", pw)) { goto bla; } mypw = getspnam (name); if (!mypw) { printf ("Error! WRONG PASSWORD !!\n"); exit (0); } memcpy (salt, mypw->sp_pwdp, 2); salt[2] = '\0'; oldpw = crypt (pw, salt); if (!strcmp (oldpw, mypw->sp_pwdp)) { bla: sprintf (cmdline, "/opt/consumo/gastos %s", name); /* sprintf (cmdline, "/export/htdocs/yellowpage/ypenter.cgi"); */ fp = popen (cmdline, "r"); if (!fp) { printf ("Internal Error!\n"); exit (0); } /* exit (0); */ while (!feof (fp)) { if (fgets (tmpline, 1023, fp)) { printf ("%s", tmpline); } else { exit (0); } } exit (0); } else { printf ("Error! !\n"); exit (0); } exit (0); } im compiling it in this way (is that the right way to do it in unix?) gcc myprog.c and get this In file included from myprog.c:4: /usr/include/libpasswd.h:77: syntax error before `*' myprog.c: In function `main': myprog.c:50: warning: assignment makes pointer from integer without a cast myprog.c:55: dereferencing pointer to incomplete type myprog.c:57: warning: assignment makes pointer from integer without a cast myprog.c:58: dereferencing pointer to incomplete type i don't know if the problem is in my program or in the libpasswd.h header thanks for your help guys.