Subject: Re: build (compiling libpam) fails
To: Rui Paulo <rpaulo@fnop.net>
From: Teemu Rinta-aho <teemu@rinta-aho.org>
List: current-users
Date: 10/10/2005 13:12:38
Rui Paulo wrote:
> On 2005.10.10 12:58:39 +0300, Teemu Rinta-aho wrote:
> | #   compile  libpam/openpam_get_option.ln
> | CC=/usr/obj/tools/bin/i386--netbsdelf-gcc 
> | /usr/obj/tools/bin/i386--netbsdelf-lin
> | t -chapbxzF -Sw -X 233 -d /usr/obj/usr/src/destdir.i386/usr/include  
> | -DLIB_MAJ=0
> |  -DOPENPAM_STATIC_MODULES -DOPENPAM_STATIC_MODULE    -i 
> |  /usr/src/dist/openpam/li
> | b/openpam_get_option.c
> | /usr/src/dist/openpam/lib/openpam_get_option.c(68): syntax error [249]
> | /usr/src/dist/openpam/lib/openpam_get_option.c(71): warning: function 
> | openpam_ge
> | t_option falls off bottom without returning value [217]
> 
> Can you show me these two lines ?
> 
> 		-- Rui Paulo

Well unless CVS has freaked, they're as they should be in v1.2.
Here's the whole file excluding the copyright. I checked that
RETURNS() has been defined in openpam_impl.h.

#include <sys/param.h>

#include <string.h>

#include <security/pam_appl.h>
#include <security/openpam.h>

#include "openpam_impl.h"

/*
  * OpenPAM extension
  *
  * Returns the value of a module option
  */

const char *
openpam_get_option(pam_handle_t *pamh,
         const char *option)
{
         pam_chain_t *cur;
         size_t len;
         int i;

         ENTERS(option);
         if (pamh == NULL || pamh->current == NULL || option == NULL)
                 RETURNS(NULL);
         cur = pamh->current;
         len = strlen(option);
         for (i = (cur->optv[i][len] == '\0')
                                 RETURNS(&cur->optv[i][len]); /** Line 68 **/
                         else if (cur->optv[i][len] == '=')
                                 RETURNS(&cur->optv[i][len + 1]);
                 }
         }
         RETURNS(NULL);
         /*NOTREACHED*/
}

/**
  * The =openpam_get_option function returns the value of the specified
  * option in the context of the currently executing service module, or
  * =NULL if the option is not set or no module is currently executing.
  *
  * >openpam_set_option
  */