rpms/globus-gss-assist/F-11 globus-gss-assist-doxygen.patch, NONE, 1.1 globus-gss-assist-gridmapdir.patch, NONE, 1.1 globus-gss-assist-normalization.patch, NONE, 1.1 globus-gss-assist.patch, NONE, 1.1 globus-gss-assist.spec, NONE, 1.1 import.log, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Mattias Ellert ellert at fedoraproject.org
Wed May 20 06:51:41 UTC 2009


Author: ellert

Update of /cvs/pkgs/rpms/globus-gss-assist/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24323/F-11

Modified Files:
	.cvsignore sources 
Added Files:
	globus-gss-assist-doxygen.patch 
	globus-gss-assist-gridmapdir.patch 
	globus-gss-assist-normalization.patch globus-gss-assist.patch 
	globus-gss-assist.spec import.log 
Log Message:
* Thu Apr 16 2009 Mattias Ellert <mattias.ellert at fysast.uu.se> - 4.0-1
- Make comment about source retrieval more explicit
- Change defines to globals
- Remove explicit requires on library packages
- Put GLOBUS_LICENSE file in extracted source tarball


globus-gss-assist-doxygen.patch:

--- NEW FILE globus-gss-assist-doxygen.patch ---
diff -ur globus_gss_assist-4.0.orig/accept.c globus_gss_assist-4.0/accept.c
--- globus_gss_assist-4.0.orig/accept.c	2007-08-09 16:24:23.000000000 +0200
+++ globus_gss_assist-4.0/accept.c	2008-10-17 19:06:48.000000000 +0200
@@ -45,13 +45,11 @@
  * and token processing, using the supplied get_token and
  * send_token routines. 
  *
- * @param token_status
- *        assist routine get/send token status
  * @param minor_status
  *        gssapi return code
  * @param context_handle
  *        pointer to returned context. 
- * @param initiator_cred_handle
+ * @param cred_handle
  *        the cred handle obtained by acquire_cred.
  * @param src_name_char
  *        Pointer to char string repersentation of the
@@ -68,9 +66,16 @@
  *        (Follwing are particular to this assist routine)
  * @param token_status
  *        assist routine get/send token status
+ * @param delegated_cred_handle
+ *        pointer to be set to the credential delegated by the client if
+ *        delegation occurs during the security handshake
+ * @param gss_assist_get_token
  *        a get token routine 
+ * @param gss_assist_get_context
  *        first arg for the get token routine 
+ * @param gss_assist_send_token
  *        a send token routine 
+ * @param gss_assist_send_context
  *        first arg for the send token routine
  * @return
  *        GSS_S_COMPLETE on sucess
@@ -276,13 +281,11 @@
  * itself it passes in and out the read and written buffers and
  * the calling application is responsible for doing the I/O directly.
  *
- * @param token_status
- *        assist routine get/send token status
  * @param minor_status
  *        gssapi return code
  * @param context_handle
  *        pointer to returned context. 
- * @param initiator_cred_handle
+ * @param cred_handle
  *        the cred handle obtained by acquire_cred.
  * @param src_name_char
  *        Pointer to char string repersentation of the
@@ -293,11 +296,9 @@
  *        the connection is established. Maybe NULL if not wanted. 
  *        We will also use this to pass in flags to the globus
  *        version of gssapi_ssleay
- *
  * @param user_to_user_flag
  *        Pointer to flag to be set if
  *        the src_name is the same as our name. 
- *
  * @param input_buffer
  *        pointer to a buffer received from peer.
  * @param input_buffer_len
@@ -308,11 +309,13 @@
  *        non-NULL the contents of this block should be written
  *        to the peer where they will be fed into the
  *        gss_assist_init_sec_context_async() function.
- *
  * @param output_buffer_lenp
  *        pointer to an integer which will be filled
  *        in with the length of the allocated output buffer
  *        pointed to by *output_bufferp.
+ * @param delegated_cred_handle
+ *        pointer to be set to the credential delegated by the client if
+ *        delegation occurs during the security handshake
  *
  * @return
  *        GSS_S_COMPLETE on successful completion when this function does not
diff -ur globus_gss_assist-4.0.orig/display.c globus_gss_assist-4.0/display.c
--- globus_gss_assist-4.0.orig/display.c	2007-08-09 16:24:23.000000000 +0200
+++ globus_gss_assist-4.0/display.c	2008-10-17 19:06:48.000000000 +0200
@@ -45,7 +45,7 @@
  * @param msg
  *        char * (may not be null terminated) to first string or null
  * @param msglen
- *        length of msgring or null
+ *        length of msg
  * @param post
  *        char * to last string or null
  *
@@ -125,6 +125,8 @@
  *        The major status to display
  * @param minor_status
  *        The minor status to display
+ * @param token_status
+ *        token status to display
  * @return 
  *        0
  */
@@ -175,7 +177,8 @@
  *        The major status to display
  * @param minor_status
  *        The minor status to display
- *
+ * @param token_status
+ *        token status to display
  * @return
  *        0
  */
diff -ur globus_gss_assist-4.0.orig/export_sec_context.c globus_gss_assist-4.0/export_sec_context.c
--- globus_gss_assist-4.0.orig/export_sec_context.c	2006-01-19 06:56:01.000000000 +0100
+++ globus_gss_assist-4.0/export_sec_context.c	2008-10-17 19:06:48.000000000 +0200
@@ -29,14 +29,6 @@
 #include "gssapi.h"
 #include <stdio.h>
 
-/**
- * @anchor globus_gsi_gss_assist
- * @mainpage Globus GSI GSS Assist
- *
- * The GSS Assist code provides convenience functions
- * for using the Globus GSS-API.
- */
-
 /* @name Export Security Context
  * @ingroup globus_gsi_gss_assist
  */
diff -ur globus_gss_assist-4.0.orig/init.c globus_gss_assist-4.0/init.c
--- globus_gss_assist-4.0.orig/init.c	2007-08-09 16:24:23.000000000 +0200
+++ globus_gss_assist-4.0/init.c	2008-10-17 19:06:48.000000000 +0200
@@ -49,7 +49,7 @@
  *        globus error object ID that can be passed to globus_error_get
  *        to get the error object.  The error object needs to be freed
  *        with globus_object_free.
- * @param initiator_cred_handle
+ * @param cred_handle
  *        the cred handle obtained by acquire_cred.
  * @param context_handle
  *        pointer to returned context. 
@@ -72,9 +72,9 @@
  * @param gss_assist_get_context
  *        first argument passed to the 
  *        gss_assist_get_token function
- * @param gss_assist_set_token
+ * @param gss_assist_send_token
  *        function pointer for setting the token
- * @param gss_assist_set_context
+ * @param gss_assist_send_context
  *        first argument passed to the 
  *        gss_assist_set_token function pointer
  *
@@ -306,7 +306,7 @@
  *        can be obtained via globus_error_get and should be destroyed
  *        with globus_object_free when no longer needed.  If no error
  *        occurred, the minor status is equal to GLOBUS_SUCCESS.
- * @param initiator_cred_handle
+ * @param cred_handle
  *        the cred handle obtained by acquire_cred.
  * @param context_handle
  *        pointer to returned context. 
diff -ur globus_gss_assist-4.0.orig/tokens_n.c globus_gss_assist-4.0/tokens_n.c
--- globus_gss_assist-4.0.orig/tokens_n.c	2007-08-09 16:24:23.000000000 +0200
+++ globus_gss_assist-4.0/tokens_n.c	2008-10-17 19:06:48.000000000 +0200
@@ -51,7 +51,8 @@
  *        the globus_io_handle_t to get the token from
  * @param bufp
  *        the buffer to read the token into
- * @param the size of what gets read
+ * @param sizep
+ *        the size of what gets read
  *
  * @return 
  *        0 on success
diff -ur globus_gss_assist-4.0.orig/unwrap.c globus_gss_assist-4.0/unwrap.c
--- globus_gss_assist-4.0.orig/unwrap.c	2007-08-09 16:24:23.000000000 +0200
+++ globus_gss_assist-4.0/unwrap.c	2008-10-17 19:06:48.000000000 +0200
@@ -43,9 +43,11 @@
  *        GSSAPI return code, @see gss_unwrap
  * @param context_handle
  *        the context 
- * @param conf_req_flag
- * @param qop_req
- * @param input_message_buffer
+ * @param data
+ *        pointer to be set to the unwrapped application data. This must be
+ *        freed by the caller.
+ * @param length
+ *        pointer to be set to the length of the @a data byte array.
  * @param token_status
  *        assist routine get/send token status 
  * @param gss_assist_get_token
diff -ur globus_gss_assist-4.0.orig/wrap.c globus_gss_assist-4.0/wrap.c
--- globus_gss_assist-4.0.orig/wrap.c	2007-08-09 16:24:23.000000000 +0200
+++ globus_gss_assist-4.0/wrap.c	2008-10-17 19:06:48.000000000 +0200
@@ -39,14 +39,14 @@
  *        GSSAPI return code.  If the call was successful, the minor 
  *        status is equal to GLOBUS_SUCCESS.  Otherwise, it is an
  *        error object ID for which  
- *        @ref globus_error_get and @ref globus_object free
+ *        globus_error_get() and globus_object_free()
  *        can be used to get and destroy it.
  * @param context_handle
  *        the context. 
- * @param conf_req_flag
- * @param qop_req
- * @param input_message_buffer
- *
+ * @param data
+ *        pointer to application data to wrap and send
+ * @param length
+ *        length of the @a data array
  * @param token_status
  *        assist routine get/send token status 
  * @param gss_assist_send_token
@@ -54,6 +54,7 @@
  * @param gss_assist_send_context
  *        first arg for the send_token
  * @param fperr
+ *        file handle to write error message to.
  *
  * @return
  *        GSS_S_COMPLETE on sucess

globus-gss-assist-gridmapdir.patch:

--- NEW FILE globus-gss-assist-gridmapdir.patch ---
--- source-trees/gt2-cvs/gsi/gss_assist/source/gridmap.c	1 Nov 2007 04:04:46 -0000	1.19.4.3
+++ source-trees/gt2-cvs/gsi/gss_assist/source/gridmap.c	30 Jan 2008 19:34:57 -0000
@@ -107,6 +107,393 @@
 
 #endif
 
+
+
+/******************************************************************************
+                       Start of gridmapdir functions
+
+ These all use the environment variable GRIDMAPDIR
+  (a) if not set, then the gridmapdir functions are not used
+  (b) the value it is set to defines the gridmap directory
+      (eg export GRIDMAPDIR=/etc/grid-security/gridmapdir)
+
+******************************************************************************/
+
+#include <utime.h>
+#include <errno.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <pwd.h>
+#include <sys/types.h>
+
+/******************************************************************************
+Function:   gridmapdir_otherlink
+Description:
+        find another link in GRIDMAPDIR to the same inode as firstlink
+        and change the modification time of firstlink to now (so that we
+        always know when this pair was last used)
+        
+Parameters:
+        firstlink, the filename of the link we already know
+
+Returns:
+        a pointer to the other link's filename (without path) or NULL if none
+        found (this is malloc'd and will need freeing)
+
+******************************************************************************/
+static char 
+*gridmapdir_otherlink(char *   firstlink)
+{
+     int            ret;
+     char           *firstlinkpath, *otherlinkdup, *otherlinkpath,
+                    *gridmapdir;
+     struct dirent  *gridmapdirentry;
+     DIR            *gridmapdirstream;
+     struct stat    statbuf;
+     ino_t          firstinode;
+
+     gridmapdir = getenv("GRIDMAPDIR");
+     if (gridmapdir == NULL) return NULL;
+     
+     firstlinkpath = malloc(strlen(gridmapdir) + 2 + strlen(firstlink));
+     sprintf(firstlinkpath, "%s/%s", gridmapdir, firstlink);     
+     ret = stat(firstlinkpath, &statbuf);
+     free(firstlinkpath);   
+     if (ret != 0) return NULL;
+     if (statbuf.st_nlink != 2) return NULL;
+     
+     firstinode = statbuf.st_ino; /* save for comparisons */
+          
+     gridmapdirstream = opendir(gridmapdir);
+
+     if (gridmapdirstream != NULL)
+     {
+         while ((gridmapdirentry = readdir(gridmapdirstream)) != NULL)
+         {       
+                 if (strcmp(gridmapdirentry->d_name, firstlink) == 0) continue;
+           
+                 otherlinkpath = malloc(strlen(gridmapdir) + 2 + 
+                                        strlen(gridmapdirentry->d_name));
+                 sprintf(otherlinkpath, "%s/%s", gridmapdir, 
+                                            gridmapdirentry->d_name);
+
+                 ret = stat(otherlinkpath, &statbuf);     
+                 if ((ret == 0) && (statbuf.st_ino == firstinode))
+                 {
+                      utime(otherlinkpath, (struct utimbuf *) NULL);
+                      free(otherlinkpath);
+                      otherlinkdup = strdup(gridmapdirentry->d_name);
+                      closedir(gridmapdirstream);     
+                      return otherlinkdup;
+                 }
+                 else free(otherlinkpath);
+         }
+         
+         closedir(gridmapdirstream);     
+     }
+
+     return NULL;
+}
+
+/******************************************************************************
+Function:   gridmapdir_urlencode
+Description:
+        Convert string to URL encoded and return pointer to the encoded
+        version, obtained through malloc. Calling routine must free
+        this. Here "URL encoded" means anything other than an isalnum()
+        goes to %HH where HH is its ascii value in hex; also A-Z => a-z 
+        This name is suitable for filenames since no / or spaces.
+
+Parameters:
+        rawstring, the string to be converted
+
+Returns:
+        a pointer to the encoded string or NULL if the malloc failed
+
+******************************************************************************/
+static char 
+*gridmapdir_urlencode(char * rawstring)
+{
+     int          encodedchar = 0, rawchar = 0;
+     char *       encodedstring;
+     
+     encodedstring = (char *) malloc(3 * strlen(rawstring) + 1);
+     
+     if (encodedstring == NULL) return (char *) NULL;
+
+     while (rawstring[rawchar] != '\0')
+     {
+           if (isalnum(rawstring[rawchar]))
+           {
+               encodedstring[encodedchar] = tolower(rawstring[rawchar]);
+               ++rawchar;
+               ++encodedchar;
+           }
+           else
+           {
+               sprintf(&encodedstring[encodedchar], "%%%02x", 
+                                               rawstring[rawchar]);
+               ++rawchar;
+               encodedchar = encodedchar + 3;
+           }        
+     }
+
+     encodedstring[encodedchar] = '\0';
+     
+     return encodedstring;
+}
+
+/******************************************************************************
+Function:   gridmapdir_newlease
+Description:
+        Search for an unleased local username to give to the globus user
+        corresponding to encodedfilename, and then lease it.
+
+Parameters: 
+        encodedfilename, URL-encoded globus client name and pathname of 
+           the globus user who requested authentication 
+        usernameprefix, the prefix of acceptable usernames (or "\0")
+
+Returns:
+        no return value
+******************************************************************************/
+
+void
+gridmapdir_newlease(char *     encodedglobusidp,
+                    char *     usernameprefix)
+{
+     int            ret;
+     char           *userfilename, *encodedfilename, *gridmapdir;
+     struct dirent  *gridmapdirentry;
+     DIR            *gridmapdirstream;
+     struct stat    statbuf;
+     
+     gridmapdir = getenv("GRIDMAPDIR");
+     if (gridmapdir == NULL) return;
+
+     encodedfilename = malloc(strlen(gridmapdir) + (size_t) 2 + 
+                              strlen(encodedglobusidp));
+     sprintf(encodedfilename, "%s/%s", gridmapdir, encodedglobusidp);
+
+     gridmapdirstream = opendir(gridmapdir);
+
+     while ((gridmapdirentry = readdir(gridmapdirstream)) != NULL)
+     {
+       /* we dont want any files that dont look like acceptable usernames */
+       if ((*(gridmapdirentry->d_name) == '%') || 
+           (strcmp(gridmapdirentry->d_name, "root") == 0))   continue;
+       else if (*(gridmapdirentry->d_name) == '.')           continue;
+       else if (index(gridmapdirentry->d_name, '~') != NULL) continue;
+       else if (strncmp(gridmapdirentry->d_name, usernameprefix,
+                        strlen(usernameprefix)) != 0)        continue;
+
+       userfilename = malloc(strlen(gridmapdir) + (size_t) 2 + 
+                             strlen(gridmapdirentry->d_name));
+       sprintf(userfilename, "%s/%s", gridmapdir, gridmapdirentry->d_name);
+       stat(userfilename, &statbuf);
+       
+       if (statbuf.st_nlink == 1) /* this one isnt leased yet */
+       {   
+           ret = link(userfilename, encodedfilename);
+           free(userfilename);
+           if (ret != 0) 
+           {
+               /* link failed: this is probably because a VERY lucky
+                  other process has obtained a lease for encodedfilename 
+                  while we were faffing around */
+               closedir(gridmapdirstream);
+               free(encodedfilename);
+               return;
+           }
+     
+           stat(encodedfilename, &statbuf);
+           if (statbuf.st_nlink > 2) 
+           {
+              /* two globusIDs have grabbed the same username: back off */
+              unlink(encodedfilename);
+              continue;
+           }
+
+           closedir(gridmapdirstream);
+           free(encodedfilename);
+           return; /* link worked ok, so return */
+       }
+       else free(userfilename); /* already in use, try next one */
+     }
+     
+     closedir(gridmapdirstream);
+     free(encodedfilename);
+     return; /* no unleased names left: give up */     
+}
+     
+/******************************************************************************
+Function:   gridmapdir_userid
+Description:
+        This is equivalent to globus_gss_assist_gridmap but for the dynamic
+        user ids in the gridmapdir: maps a globusID to a local unix user id,
+        either one already leased, or calls gridmapdir_newlease() to obtain 
+        a new lease. This is called by globus_gss_assist_gridmap if the 
+        local user id in the static gridmap file begins . (for a dynamic id)
+
+Parameters: 
+        globusidp, globus client name who requested authentication 
+        usernameprefix, prefix of the local usernames which would 
+               be acceptable (or "\0" )
+        *userid returned userid name for local system. 
+
+Returns:
+       
+        0 on success
+        !=0 on failure
+
+******************************************************************************/
+
+static int
+gridmapdir_userid(char *     globusidp,
+                  char *     usernameprefix,
+                  char **    useridp)
+{
+     char             *encodedglobusidp;
+     
+     if (getenv("GRIDMAPDIR") == NULL) return 1; /* GRIDMAPDIR defined? */
+
+     if (globusidp[0] != '/') return 1; /* must be a proper subject DN */
+     
+     encodedglobusidp = gridmapdir_urlencode(globusidp);
+
+     *useridp = gridmapdir_otherlink(encodedglobusidp);
+
+     if (*useridp == NULL) /* maybe no lease yet */
+     {
+         gridmapdir_newlease(encodedglobusidp, usernameprefix); 
+         /* try making a lease */
+         
+         *useridp = gridmapdir_otherlink(encodedglobusidp); 
+         /* check if there is a now a lease - possibly made by someone else */
+
+         if (*useridp == NULL) 
+         {
+             free(encodedglobusidp);
+             return 1; /* still no good */
+         }
+     }
+
+     free(encodedglobusidp);
+     return 0;
+}
+
+/******************************************************************************
+Function:   gridmapdir_globusid
+Description:
+        This is equivalent to globus_gss_assist_map_local_user but for the 
+        dynamic user ids in the gridmapdir: search through leases to find
+        which globusID corresponds to a local unix user id.
+        This is called by globus_gss_assist_map_local_user 
+
+Parameters: 
+        globus client name who requested authentication 
+        *userid returned userid name for local system. 
+
+Returns:
+       
+        0 on success
+        !=0 on failure
+
+******************************************************************************/
+
+static int
+gridmapdir_globusid(char *     useridp,
+                    char **    globusidp)
+{
+     int              encodedptr = 0, decodedptr = 0;
+     char             *encodedglobusidp;
+     
+     if (useridp[0] == '/') return 1; /* must not be a subject DN */
+     
+     encodedglobusidp = gridmapdir_otherlink(useridp);
+
+     if (encodedglobusidp == NULL) return 1; /* not leased */
+     
+     *globusidp = malloc(strlen(encodedglobusidp));
+     
+     while (encodedglobusidp[encodedptr] != '\0')
+     {
+            if (encodedglobusidp[encodedptr] != '%')
+            {
+                (*globusidp)[decodedptr] = encodedglobusidp[encodedptr];
+                ++encodedptr;
+                ++decodedptr;
+            }
+            else /* must be a %HH encoded character */
+            {
+                /* even paranoids have enemies ... */
+                if (encodedglobusidp[encodedptr+1] == '\0') break;
+                if (encodedglobusidp[encodedptr+2] == '\0') break;
+
+                (*globusidp)[decodedptr] = 
+                   globus_i_gss_assist_xdigit_to_value(encodedglobusidp[encodedptr+1]) * 16 +
+                   globus_i_gss_assist_xdigit_to_value(encodedglobusidp[encodedptr+2]);
+
+                encodedptr = encodedptr + 3;
+                ++decodedptr;
+            }
+     }
+              
+     free(encodedglobusidp);
+     (*globusidp)[decodedptr] = '\0';
+     return 0;
+}
+
+/******************************************************************************
+Function:   gridmapdir_userok
+Description:
+        This is equivalent to globus_gss_assist_userok but for the dynamic
+        user ids in the gridmapdir: finds the local unix username leased to 
+        a globusID and compare with the username being checked.
+        This is called by globus_gss_assist_userok if the local user id in
+        the static gridmap file is -  (for a dynamic id)
+
+Parameters: 
+        globus client name who requested authentication 
+        userid to be checked
+
+Returns:
+        0 on success (authorization allowed)
+        !=0 on failure or authorization denied
+                
+******************************************************************************/
+
+static int
+gridmapdir_userok(char *     globusidp,
+                  char *     userid)
+{
+     char                    *encodedglobusidp, *leasedname;
+     
+     if (globusidp[0] != '/') return 1; /* must be a proper subject DN */
+     
+     encodedglobusidp = gridmapdir_urlencode(globusidp);
+     leasedname       = gridmapdir_otherlink(encodedglobusidp);
+     free(encodedglobusidp);
+
+     if (leasedname == NULL) return 1;
+
+     if (strcmp(userid, leasedname) == 0)
+     {
+         free(leasedname);
+         return 0;
+     }
+     else
+     {
+         free(leasedname);
+         return 1;
+     }
+}
+
+/******************************************************************************
+                     End of gridmapdir functions
+******************************************************************************/
+
 /**
  * @name Gridmap
  */
@@ -147,6 +534,8 @@
     globus_result_t                     result = GLOBUS_SUCCESS;
     globus_i_gss_assist_gridmap_line_t *
                                         gline = NULL;
+    char                               *usernameprefix;
+    int                                 ret;
 
     static char *                       _function_name_ =
     "globus_gss_assist_gridmap";
@@ -203,6 +592,16 @@
                 (_GASL("Duplicate string operation failed")));
 	    goto exit;
 	}
+
+	if ((*useridp)[0] == '.') /* need to use gridmapdir */
+	{             
+	    usernameprefix = strdup(&((*useridp)[1]));
+	    free(*useridp); *useridp = NULL;
+	    ret = gridmapdir_userid(globusidp, usernameprefix, useridp);
+	    free(usernameprefix);
+	    return ret;
+        }
+
     }
     else
     {
@@ -314,6 +713,12 @@
         goto exit;
     }
 
+    if (*((gline->user_ids)[0]) == '.') /* try using gridmapdir */ 
+    {
+        globus_i_gss_assist_gridmap_line_free(gline);
+        return gridmapdir_userok(globusid, userid);
+    }
+    else
     for (useridp = gline->user_ids; *useridp != NULL; useridp++)
     {
 	if (strcmp(*useridp, userid) == 0)
@@ -480,7 +885,8 @@
         error_obj = globus_error_get(result);
         globus_object_free(error_obj);
 
-        return 1;
+        /* try with gridmapdir before giving up completely */
+        return gridmapdir_globusid(local_user, globusidp);
     }
 } 
 /* globus_gss_assist_map_local_user() */

globus-gss-assist-normalization.patch:

--- NEW FILE globus-gss-assist-normalization.patch ---
--- globus_gss_assist-3.5/gridmap.c.orig	2003-01-05 01:19:32.000000000 +0100
+++ globus_gss_assist-3.5/gridmap.c	2003-11-21 12:06:22.000000000 +0100
@@ -1082,6 +1082,9 @@
     globus_result_t                     result = GLOBUS_SUCCESS;
     static char *                       _function_name_ =
         "globus_i_gss_assist_gridmap_parse_globusid";
+
+    static char *                       hexdigit = "0123456789ABCDEF";
+
     GLOBUS_I_GSI_GSS_ASSIST_DEBUG_ENTER;
 
     /*
@@ -1146,7 +1149,7 @@
          * First, make sure we have enough room in our output buffer.
          */
 
-	if ((buffer_index + 1 /* for NUL */) >= buffer_len)
+	while ((buffer_index + 4) >= buffer_len)
 	{
 	    /* Grow buffer */
 	    char *tmp_buffer;
@@ -1169,8 +1172,18 @@
             
 	    buffer = tmp_buffer;
 	}
-        
-	buffer[buffer_index++] = unparsed_char;
+
+	if ((unparsed_char < ' ') || (unparsed_char > '~'))
+	{
+	    buffer[buffer_index++] = '\\';
+	    buffer[buffer_index++] = 'x';
+	    buffer[buffer_index++] = hexdigit[(unparsed_char >> 4) & 0x0f];
+	    buffer[buffer_index++] = hexdigit[unparsed_char & 0x0f];
+	}
+	else
+	{
+	    buffer[buffer_index++] = unparsed_char;
+	}
 	buffer[buffer_index] = NUL;
 
 	escaped = 0;

globus-gss-assist.patch:

--- NEW FILE globus-gss-assist.patch ---
diff -ur globus_gss_assist-4.0.orig/programs/grid-mapfile-add-entry.in globus_gss_assist-4.0/programs/grid-mapfile-add-entry.in
--- globus_gss_assist-4.0.orig/programs/grid-mapfile-add-entry.in	2006-01-19 06:56:02.000000000 +0100
+++ globus_gss_assist-4.0/programs/grid-mapfile-add-entry.in	2008-10-17 19:56:21.000000000 +0200
@@ -20,16 +20,16 @@
 # grid-mapfile-add-entry
 #
 
-if test -z "${GLOBUS_LOCATION}"; then
-    echo ""
-    echo "ERROR: Please set GLOBUS_LOCATION to the Globus installation directory before"
-    echo "running this script"
-    echo ""
+if test -f ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer; then
+    . ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer
+elif test -f ${GLOBUS_LOCATION:-/usr}/libexec/globus-script-initializer; then
+    . ${GLOBUS_LOCATION:-/usr}/libexec/globus-script-initializer
+else
+    echo "ERROR: Please set GLOBUS_LOCATION to the Globus installation directory before" 1>&2
+    echo "running this script" 1>&2
     exit 1
 fi
-
-. ${GLOBUS_LOCATION}/libexec/globus-script-initializer
-globus_source ${GLOBUS_LOCATION}/libexec/globus-sh-tools.sh
+globus_source ${libexecdir}/globus-sh-tools.sh
 
 PROGRAM_NAME=`echo $0 | ${GLOBUS_SH_SED-sed} 's|.*/||g'`
 
@@ -231,9 +231,19 @@
 
 $ECHO_DRYRUN "Verifying that Local Name(s)=($ln) are legitimate local accounts."
 
+if test -x ${sbindir}/globus-is-local-user; then
+    globus_is_local_user=${sbindir}/globus-is-local-user
+elif test -x ${libexecdir}/globus-is-local-user; then
+    globus_is_local_user=${libexecdir}/globus-is-local-user
+else
+    echo "ERROR: Unable to find globus-is-local-user" 1>&2
+    Cleanup
+    exit 1
+fi
+
 for name in $ln ; do
     $ECHO_DRYRUN "Checking ln(s)=$name"
-    ${libexecdir}/globus-is-local-user $name
+    ${globus_is_local_user} $name
     if  [ "$?" -eq 0 ] ; then
         $ECHO_DRYRUN "Local Name=$name does exist"
     else
diff -ur globus_gss_assist-4.0.orig/programs/grid-mapfile-delete-entry.in globus_gss_assist-4.0/programs/grid-mapfile-delete-entry.in
--- globus_gss_assist-4.0.orig/programs/grid-mapfile-delete-entry.in	2006-01-19 06:56:02.000000000 +0100
+++ globus_gss_assist-4.0/programs/grid-mapfile-delete-entry.in	2008-10-17 19:56:26.000000000 +0200
@@ -21,16 +21,16 @@
 # grid-mapfile-delete-entry
 #
 
-if test -z "${GLOBUS_LOCATION}"; then
-    echo ""
-    echo "ERROR: Please set GLOBUS_LOCATION to the Globus installation directory before"
-    echo "running this script"
-    echo ""
+if test -f ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer; then
+    . ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer
+elif test -f ${GLOBUS_LOCATION:-/usr}/libexec/globus-script-initializer; then
+    . ${GLOBUS_LOCATION:-/usr}/libexec/globus-script-initializer
+else
+    echo "ERROR: Please set GLOBUS_LOCATION to the Globus installation directory before" 1>&2
+    echo "running this script" 1>&2
     exit 1
 fi
-
-. ${GLOBUS_LOCATION}/libexec/globus-script-initializer
-globus_source ${GLOBUS_LOCATION}/libexec/globus-sh-tools.sh
+globus_source ${libexecdir}/globus-sh-tools.sh
 
 PROGRAM_NAME=`echo $0 |${GLOBUS_SH_SED-sed} 's|.*/||g'`
 


--- NEW FILE globus-gss-assist.spec ---
%ifarch alpha ia64 ppc64 s390x sparc64 x86_64
%global flavor gcc64pthr
%else
%global flavor gcc32pthr
%endif

Name:		globus-gss-assist
%global _name %(tr - _ <<< %{name})
Version:	4.0
Release:	1%{?dist}
Summary:	Globus Toolkit - GSSAPI Assist library

Group:		System Environment/Libraries
License:	ASL 2.0
URL:		http://www.globus.org/
#		Source is extracted from the globus toolkit installer:
#		wget -N http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2
#		tar -jxf gt4.2.1-all-source-installer.tar.bz2
#		mv gt4.2.1-all-source-installer/source-trees/gsi/gss_assist/source globus_gss_assist-4.0
#		cp -p gt4.2.1-all-source-installer/source-trees/core/source/GLOBUS_LICENSE globus_gss_assist-4.0
#		tar -zcf globus_gss_assist-4.0.tar.gz globus_gss_assist-4.0
Source:		%{_name}-%{version}.tar.gz
#		This is a workaround for the broken epstopdf script in RHEL5
#		See: https://bugzilla.redhat.com/show_bug.cgi?id=450388
Source9:	epstopdf-2.9.5gw
#		Environment variable elimination patch:
#		http://bugzilla.globus.org/bugzilla/show_bug.cgi?id=6480
Patch0:		%{name}.patch
#		the GRIDMAPDIR patch from VDT:
#		http://vdt.cs.wisc.edu/patches/1.10.1/011__gss_assist_gridmap.diff
Patch1:		%{name}-gridmapdir.patch
#		globus_i_gss_assist_gridmap_parse_globusid and
#		X509_NAME_oneline don't normalize DNs the same way:
#		http://bugzilla.globus.org/bugzilla/show_bug.cgi?id=1417
Patch2:		%{name}-normalization.patch
#		Fix some doxygen warnings:
#		http://bugzilla.globus.org/bugzilla/show_bug.cgi?id=6482
Patch3:		%{name}-doxygen.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires:	globus-common
BuildRequires:	grid-packaging-tools
BuildRequires:	globus-gsi-cert-utils-devel >= 2
BuildRequires:	globus-gsi-sysconfig-devel >= 1
BuildRequires:	globus-common-devel >= 3
BuildRequires:	globus-callout-devel
BuildRequires:	globus-gssapi-gsi-devel >= 4
BuildRequires:	globus-core >= 4
BuildRequires:	doxygen
%if %{?fedora}%{!?fedora:0} >= 3
BuildRequires:	graphviz
BuildRequires:	ghostscript
%else
%if %{?rhel}%{!?rhel:0} >= 5
BuildRequires:	graphviz
BuildRequires:	ghostscript
%if "%{?rhel}" == "5"
BuildRequires:	graphviz-gd
%endif
%endif
%endif
%if %{?fedora}%{!?fedora:0} >= 9
BuildRequires:	tex(latex)
%else
%if %{?rhel}%{!?rhel:0} >= 6
BuildRequires:	tex(latex)
%else
BuildRequires:	tetex-latex
%endif
%endif

%package progs
Summary:	Globus Toolkit - GSSAPI Assist library Programs
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
Requires:	globus-common-progs >= 3

%package devel
Summary:	Globus Toolkit - GSSAPI Assist library Development Files
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:	globus-gsi-cert-utils-devel >= 2
Requires:	globus-gsi-sysconfig-devel >= 1
Requires:	globus-common-devel >= 3
Requires:	globus-callout-devel
Requires:	globus-gssapi-gsi-devel >= 4
Requires:	globus-core >= 4

%package doc
Summary:	Globus Toolkit - GSSAPI Assist library Documentation Files
Group:		Documentation
Requires:	%{name} = %{version}-%{release}

%description
The Globus Toolkit is an open source software toolkit used for building Grid
systems and applications. It is being developed by the Globus Alliance and
many others all over the world. A growing number of projects and companies are
using the Globus Toolkit to unlock the potential of grids for their cause.

The %{name} package contains:
GSSAPI Assist library

%description progs
The Globus Toolkit is an open source software toolkit used for building Grid
systems and applications. It is being developed by the Globus Alliance and
many others all over the world. A growing number of projects and companies are
using the Globus Toolkit to unlock the potential of grids for their cause.

The %{name}-progs package contains:
GSSAPI Assist library Programs

%description devel
The Globus Toolkit is an open source software toolkit used for building Grid
systems and applications. It is being developed by the Globus Alliance and
many others all over the world. A growing number of projects and companies are
using the Globus Toolkit to unlock the potential of grids for their cause.

The %{name}-devel package contains:
GSSAPI Assist library Development Files

%description doc
The Globus Toolkit is an open source software toolkit used for building Grid
systems and applications. It is being developed by the Globus Alliance and
many others all over the world. A growing number of projects and companies are
using the Globus Toolkit to unlock the potential of grids for their cause.

The %{name}-doc package contains:
GSSAPI Assist library Documentation Files

%prep
%setup -q -n %{_name}-%{version}
%patch0 -p1
%patch1 -p5
%patch2 -p1
%patch3 -p1

%if "%{rhel}" == "5"
mkdir bin
install %{SOURCE9} bin/epstopdf
%endif

%build
%if "%{rhel}" == "5"
export PATH=$PWD/bin:$PATH
%endif

# Remove files that should be replaced during bootstrap
rm -f doxygen/Doxyfile*
rm -f doxygen/Makefile.am
rm -f pkgdata/Makefile.am
rm -f globus_automake*
rm -rf autom4te.cache

# Remove flavor tags
for f in `find . -name Makefile.am` ; do
  sed -e 's!^flavorinclude_HEADERS!include_HEADERS!' \
      -e 's!\(lib[a-zA-Z_]*\)_$(GLOBUS_FLAVOR_NAME)\.la!\1.la!g' \
      -e 's!^\(lib[a-zA-Z_]*\)___GLOBUS_FLAVOR_NAME__la_!\1_la_!' -i $f
done
sed -e "s!<With_Flavors!<With_Flavors ColocateLibraries=\"no\"!" \
  -i pkgdata/pkg_data_src.gpt.in

%{_datadir}/globus/globus-bootstrap.sh

%configure --with-flavor=%{flavor} --enable-doxygen

make %{?_smp_mflags}

%install
%if "%{rhel}" == "5"
export PATH=$PWD/bin:$PATH
%endif

rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# Remove libtool archives (.la files)
find $RPM_BUILD_ROOT%{_libdir} -name 'lib*.la' -exec rm -v '{}' \;
sed '/lib.*\.la$/d' \
  -i $RPM_BUILD_ROOT%{_datadir}/globus/packages/%{_name}/%{flavor}_rtl.filelist

# Remove static libraries (.a files)
find $RPM_BUILD_ROOT%{_libdir} -name 'lib*.a' -exec rm -v '{}' \;
sed '/lib.*\.a$/d' \
  -i $RPM_BUILD_ROOT%{_datadir}/globus/packages/%{_name}/%{flavor}_dev.filelist

# Generate pkg-config file from GPT metadata
mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
%{_datadir}/globus/globus-gpt2pkg-config pkgdata/pkg_data_%{flavor}_dev.gpt > \
  $RPM_BUILD_ROOT%{_libdir}/pkgconfig/%{name}.pc

# Move documentation to default RPM location
mv $RPM_BUILD_ROOT%{_docdir}/%{_name} \
  $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
sed s!doc/%{_name}!doc/%{name}-%{version}! \
  -i $RPM_BUILD_ROOT%{_datadir}/globus/packages/%{_name}/noflavor_doc.filelist

# Remove unwanted documentation
rm -f $RPM_BUILD_ROOT%{_mandir}/man3/deprecated.3
rm -f $RPM_BUILD_ROOT%{_mandir}/man3/*_%{_name}-%{version}_*.3
sed -e '/deprecated\.3/d' \
    -e '/_%{_name}-%{version}_.*\.3/d' \
  -i $RPM_BUILD_ROOT%{_datadir}/globus/packages/%{_name}/noflavor_doc.filelist

# Install license file
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
install -m 644 -p GLOBUS_LICENSE $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}

# Generate package filelists
cat $RPM_BUILD_ROOT%{_datadir}/globus/packages/%{_name}/%{flavor}_rtl.filelist \
  | sed s!^!%{_prefix}! > package.filelist
cat $RPM_BUILD_ROOT%{_datadir}/globus/packages/%{_name}/%{flavor}_pgm.filelist \
  | sed s!^!%{_prefix}! > package-progs.filelist
cat $RPM_BUILD_ROOT%{_datadir}/globus/packages/%{_name}/%{flavor}_dev.filelist \
  | sed s!^!%{_prefix}! > package-devel.filelist
cat $RPM_BUILD_ROOT%{_datadir}/globus/packages/%{_name}/noflavor_doc.filelist \
  | sed -e 's!/man/.*!&*!' -e 's!^!%doc %{_prefix}!' > package-doc.filelist

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f package.filelist
%defattr(-,root,root,-)
%dir %{_datadir}/globus/packages/%{_name}
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/GLOBUS_LICENSE

%files -f package-progs.filelist progs
%defattr(-,root,root,-)

%files -f package-devel.filelist devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/%{name}.pc

%files -f package-doc.filelist doc
%defattr(-,root,root,-)
%dir %{_docdir}/%{name}-%{version}/html

%changelog
* Thu Apr 16 2009 Mattias Ellert <mattias.ellert at fysast.uu.se> - 4.0-1
- Make comment about source retrieval more explicit
- Change defines to globals
- Remove explicit requires on library packages
- Put GLOBUS_LICENSE file in extracted source tarball

* Sun Mar 15 2009 Mattias Ellert <mattias.ellert at fysast.uu.se> - 4.0-0.5
- Adapting to updated globus-core package

* Thu Feb 26 2009 Mattias Ellert <mattias.ellert at fysast.uu.se> - 4.0-0.4
- Add s390x to the list of 64 bit platforms

* Thu Jan  1 2009 Mattias Ellert <mattias.ellert at fysast.uu.se> - 4.0-0.3
- Adapt to updated GPT package

* Wed Oct 15 2008 Mattias Ellert <mattias.ellert at fysast.uu.se> - 4.0-0.2
- Update to Globus Toolkit 4.2.1

* Mon Jul 14 2008 Mattias Ellert <mattias.ellert at fysast.uu.se> - 3.25-0.1
- Autogenerated


--- NEW FILE import.log ---
globus-gss-assist-4_0-1_fc9:F-11:globus-gss-assist-4.0-1.fc9.src.rpm:1242802236


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/globus-gss-assist/F-11/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	20 May 2009 05:34:41 -0000	1.1
+++ .cvsignore	20 May 2009 06:51:11 -0000	1.2
@@ -0,0 +1,2 @@
+epstopdf-2.9.5gw
+globus_gss_assist-4.0.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/globus-gss-assist/F-11/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	20 May 2009 05:34:41 -0000	1.1
+++ sources	20 May 2009 06:51:11 -0000	1.2
@@ -0,0 +1,2 @@
+44ec158f5ca5f60310cca74a3aaaea2b  epstopdf-2.9.5gw
+e232fea347901601da6df8c7c559d4db  globus_gss_assist-4.0.tar.gz




More information about the fedora-extras-commits mailing list