gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS gsasl/lib/src


From: gsasl-commit
Subject: CVS gsasl/lib/src
Date: Thu, 14 Oct 2004 23:55:38 +0200

Update of /home/cvs/gsasl/lib/src
In directory dopio:/tmp/cvs-serv4559

Modified Files:
        property.c gsasl.h.in 
Log Message:
(gsasl_property_lset): Add.


--- /home/cvs/gsasl/lib/src/property.c  2004/10/14 21:34:17     1.13
+++ /home/cvs/gsasl/lib/src/property.c  2004/10/14 21:55:38     1.14
@@ -154,6 +154,29 @@
 gsasl_property_set (Gsasl_session * sctx, Gsasl_property prop,
                    const char *data)
 {
+  gsasl_property_lset (sctx, prop, data, data ? strlen (data) : 0);
+}
+
+/**
+ * gsasl_property_lset:
+ * @sctx: session handle.
+ * @prop: enumerated value of Gsasl_property type, indicating the
+ *        type of data in @data.
+ * @data: character string to store.
+ * @len: length of character string to store.
+ *
+ * Make a copy of @len sized @data and store a zero terminated version
+ * of it in the session handle for the indicated property @prop.  You
+ * can immediately deallocate @data after calling this function,
+ * without affecting the data stored in the session handle.
+ *
+ * Except for the length indicator, this function is identical to
+ * gsasl_property_set.
+ **/
+void
+gsasl_property_lset (Gsasl_session * sctx, Gsasl_property prop,
+                    const char *data, size_t len)
+{
   char **p = map (sctx, prop);
 
   if (p)
@@ -161,7 +184,11 @@
       if (*p)
        free (*p);
       if (data)
-       *p = strdup (data);
+       {
+         *p = malloc (len + 1);
+         memcpy (*p, data, len);
+         (*p)[len] = '\0';
+       }
       else
        *p = NULL;
     }
--- /home/cvs/gsasl/lib/src/gsasl.h.in  2004/10/14 19:06:40     1.38
+++ /home/cvs/gsasl/lib/src/gsasl.h.in  2004/10/14 21:55:38     1.39
@@ -139,10 +139,12 @@
     GSASL_VALIDATE_SECURID,
     GSASL_VALIDATE_ANONYMOUS,
     GSASL_VALIDATE_EXTERNAL,
+    GSASL_VALIDATE_GSSAPI,
     GSASL_SERVER_REALM,
     GSASL_SERVER_QOP,
     GSASL_SERVER_MAXBUF,
-    GSASL_SERVER_CIPHER
+    GSASL_SERVER_CIPHER,
+    GSASL_GSSAPI_DISPLAY_NAME
   } Gsasl_property;
 
   /**
@@ -185,6 +187,8 @@
   /* Property handling: property.c */
   extern void gsasl_property_set (Gsasl_session * sctx, Gsasl_property prop,
                                  const char *data);
+  extern void gsasl_property_lset (Gsasl_session * sctx, Gsasl_property prop,
+                                  const char *data, size_t len);
   extern void gsasl_property_set_global (Gsasl * ctx, Gsasl_property prop,
                                         const char *data);
   extern const char *gsasl_property_get (Gsasl_session * sctx,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]