@@ -1277,7 +1277,7 @@ int tmpl_attr_afrom_list(TALLOC_CTX *ctx, tmpl_t **out, tmpl_t const *list, fr_d
12771277 * We need to rebuild the attribute name, to be the
12781278 * one we copied from the source list.
12791279 */
1280- slen = tmpl_print (& FR_SBUFF_OUT (attr , sizeof (attr )), vpt , TMPL_ATTR_REF_PREFIX_AUTO ,
1280+ slen = tmpl_print (& FR_SBUFF_OUT (attr , sizeof (attr )), vpt ,
12811281 fr_value_escape_by_quote [list -> quote ]);
12821282 if (slen < 0 ) {
12831283 fr_strerror_printf ("Serialized attribute too long. Must be < "
@@ -2274,11 +2274,10 @@ ssize_t tmpl_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t *err,
22742274 }
22752275
22762276 /*
2277- * We parsed the tmpl as &User-Name, or just User-Name, but NOT %{User-Name}.
2278- * Mark it up as having a prefix.
2277+ * We parsed the tmpl as User-Name, but NOT %{User-Name}.
22792278 */
22802279 MEM (vpt = tmpl_alloc (ctx , TMPL_TYPE_ATTR , T_BARE_WORD , NULL , 0 ));
2281- vpt -> data .attribute .ref_prefix = TMPL_ATTR_REF_PREFIX_YES ;
2280+ vpt -> data .attribute .ref_prefix = TMPL_ATTR_REF_PREFIX_NO ;
22822281 vpt -> rules .attr .prefix = at_rules -> prefix ;
22832282
22842283 /*
@@ -4649,18 +4648,12 @@ fr_slen_t tmpl_request_ref_list_print(fr_sbuff_t *out, FR_DLIST_HEAD(tmpl_reques
46494648 *
46504649 * @param[in] out Where to write the presentation format #tmpl_t string.
46514650 * @param[in] vpt to print.
4652- * @param[in] ar_prefix Whether to print the '&' at the beginning of attribute
4653- * references.
4654- * - TMPL_ATTR_REF_PREFIX_YES - always print.
4655- * - TMPL_ATTR_REF_PREFIX_NO - never print.
4656- * - TMPL_ATTR_REF_PREFIX_AUTO - print if the original tmpl
4657- * was prefixed.
46584651 * @return
46594652 * - >0 the number of bytes written to the out buffer.
46604653 * - 0 invalid argument.
46614654 * - <0 the number of bytes we would have needed to complete the print.
46624655 */
4663- fr_slen_t tmpl_attr_print (fr_sbuff_t * out , tmpl_t const * vpt , tmpl_attr_prefix_t ar_prefix )
4656+ fr_slen_t tmpl_attr_print (fr_sbuff_t * out , tmpl_t const * vpt )
46644657{
46654658 tmpl_attr_t * ar = NULL ;
46664659 fr_da_stack_t stack ;
@@ -4682,22 +4675,6 @@ fr_slen_t tmpl_attr_print(fr_sbuff_t *out, tmpl_t const *vpt, tmpl_attr_prefix_t
46824675 return 0 ;
46834676 }
46844677
4685- /*
4686- * Suppress the prefix on new syntax.
4687- */
4688- if (ar_prefix == TMPL_ATTR_REF_PREFIX_YES ) {
4689- ar_prefix = TMPL_ATTR_REF_PREFIX_AUTO ;
4690- }
4691-
4692- /*
4693- * Handle printing the request reference
4694- * prefix.
4695- */
4696- if ((ar_prefix == TMPL_ATTR_REF_PREFIX_YES ) ||
4697- ((ar_prefix == TMPL_ATTR_REF_PREFIX_AUTO ) && vpt -> data .attribute .ref_prefix )) {
4698- FR_SBUFF_IN_CHAR_RETURN (& our_out , '&' );
4699- }
4700-
47014678 /*
47024679 * Print request references
47034680 */
@@ -4863,36 +4840,23 @@ fr_slen_t tmpl_attr_print(fr_sbuff_t *out, tmpl_t const *vpt, tmpl_attr_prefix_t
48634840 *
48644841 * @param[out] out Where to write the presentation format #tmpl_t string.
48654842 * @param[in] vpt to print.
4866- * @param[in] ar_prefix Whether to print the '&' at the beginning of attribute
4867- * references.
4868- * - TMPL_ATTR_REF_PREFIX_YES - always print.
4869- * - TMPL_ATTR_REF_PREFIX_NO - never print.
4870- * - TMPL_ATTR_REF_PREFIX_AUTO - print if the original tmpl
4871- * was prefixed.
48724843 * @param[in] e_rules Escaping rules used to print strings.
48734844 * @return
48744845 * - >0 the number of bytes written to the out buffer.
48754846 * - 0 invalid argument.
48764847 * - <0 the number of bytes we would have needed to complete the print.
48774848 */
48784849fr_slen_t tmpl_print (fr_sbuff_t * out , tmpl_t const * vpt ,
4879- tmpl_attr_prefix_t ar_prefix , fr_sbuff_escape_rules_t const * e_rules )
4850+ fr_sbuff_escape_rules_t const * e_rules )
48804851{
48814852 fr_sbuff_t our_out = FR_SBUFF (out );
48824853
48834854 TMPL_VERIFY (vpt );
48844855
4885- /*
4886- * Suppress the prefix on new syntax.
4887- */
4888- if (ar_prefix == TMPL_ATTR_REF_PREFIX_YES ) {
4889- ar_prefix = TMPL_ATTR_REF_PREFIX_AUTO ;
4890- }
4891-
48924856 switch (vpt -> type ) {
48934857 case TMPL_TYPE_ATTR_UNRESOLVED :
48944858 case TMPL_TYPE_ATTR :
4895- FR_SBUFF_RETURN (tmpl_attr_print , & our_out , vpt , ar_prefix );
4859+ FR_SBUFF_RETURN (tmpl_attr_print , & our_out , vpt );
48964860 break ;
48974861
48984862 case TMPL_TYPE_DATA :
@@ -4953,26 +4917,20 @@ fr_slen_t tmpl_print(fr_sbuff_t *out, tmpl_t const *vpt,
49534917 *
49544918 * @param[out] out Where to write the presentation format #tmpl_t string.
49554919 * @param[in] vpt to print.
4956- * @param[in] ar_prefix Whether to print the '&' at the beginning of attribute
4957- * references.
4958- * - TMPL_ATTR_REF_PREFIX_YES - always print.
4959- * - TMPL_ATTR_REF_PREFIX_NO - never print.
4960- * - TMPL_ATTR_REF_PREFIX_AUTO - print if the original tmpl
4961- * was prefixed.
49624920 * @return
49634921 * - >0 the number of bytes written to the out buffer.
49644922 * - 0 invalid argument.
49654923 * - <0 the number of bytes we would have needed to complete the print.
49664924 */
4967- fr_slen_t tmpl_print_quoted (fr_sbuff_t * out , tmpl_t const * vpt , tmpl_attr_prefix_t ar_prefix )
4925+ fr_slen_t tmpl_print_quoted (fr_sbuff_t * out , tmpl_t const * vpt )
49684926{
49694927 fr_sbuff_t our_out = FR_SBUFF (out );
49704928
49714929 char quote = fr_token_quote [vpt -> quote ];
49724930
49734931 if (quote != '\0' ) FR_SBUFF_IN_CHAR_RETURN (& our_out , quote );
49744932 FR_SBUFF_RETURN (tmpl_print , & our_out , vpt ,
4975- ar_prefix , fr_value_escape_by_quote [vpt -> quote ]);
4933+ fr_value_escape_by_quote [vpt -> quote ]);
49764934 if (quote != '\0' ) FR_SBUFF_IN_CHAR_RETURN (& our_out , quote );
49774935
49784936 /*
0 commit comments