[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
[sfrench/samba-autobuild/.git] / source3 / lib / substitute.c
index 80233c5080f74ba885e3ea97e647c1d5b4d1aa93..57df02f7216f7b7a7141104ecaaf6f30368e5b77 100644 (file)
@@ -767,3 +767,21 @@ void standard_sub_advanced(const char *servicename, const char *user,
                SAFE_FREE( s );
        }
 }
+
+/****************************************************************************
+ *  Do some standard substitutions in a string.
+ *  ****************************************************************************/
+
+void standard_sub_conn(connection_struct *conn, char *str, size_t len)
+{
+       char *s;
+
+       s = alloc_sub_advanced(lp_servicename(SNUM(conn)), conn->user, conn->connectpath,
+                              conn->gid, smb_user_name, "", str);
+
+       if ( s ) {
+               strncpy( str, s, len );
+               SAFE_FREE( s );
+       }
+}
+