<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 12/05/2014 03:38 PM, Raphaël Pinson
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACE7ikGqr2oyYkbpD72c0atj0WDmM+C5pdRX4xsoEUC=AwR4yg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Laine,
        <div><br>
        </div>
        <div>I believe [0] might be of interest to you.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Cheers,</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Raphael</div>
        <div><br>
        </div>
        <div>[0] <a moz-do-not-send="true"
href="https://github.com/hercules-team/augeas/commit/3fb6543af886bf3de8e21b0b8b8fc30877826e89">https://github.com/hercules-team/augeas/commit/3fb6543af886bf3de8e21b0b8b8fc30877826e89</a></div>
        <div><br>
        </div>
      </div>
    </blockquote>
    <br>
    As far as I understand, this function is showing preprocessing of
    shell commandline arguments to remove escaping prior to sending the
    args to augeas APIs, *not* any unescaping within the augeas APIs. So
    we can determine from it what escaping is understood by augtool,
    which may or may not have any relationship to escaping understood by
    the augeas APIs.<br>
    <br>
    <br>
    <blockquote
cite="mid:CACE7ikGqr2oyYkbpD72c0atj0WDmM+C5pdRX4xsoEUC=AwR4yg@mail.gmail.com"
      type="cite">
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Dec 5, 2014 at 7:02 PM, Laine
          Stump <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:laine@redhat.com" target="_blank">laine@redhat.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">I want to
            sanitize the path sent to aug_get(aug, path, &result)
            (and<br>
            probably other functions, and it's not clear to me what
            characters are<br>
            considered "special", nor how to escape them in the string.
            An example<br>
            of this, let's say I want to know the mac address of a
            user-supplied<br>
            network interface, so I do this:<br>
            <br>
              sprintf(&path,
            "/files/sys/class/net/%s/address/content", intf)<br>
            <br>
              r = aug_match(aug, path, &mac);<br>
            <br>
            If the interface name contains special characters
            interpreted by<br>
            aug_match's "xpath-like" parser, then I won't necessarily
            get back the<br>
            results I expected.<br>
            <br>
            So what I would like to do is precede this with a call to<br>
            "aug_escape(intf, &sanitized_intf)" which would escape
            any characters<br>
            having a special meaning to augeas. An API in augeas would
            be very nice,<br>
            but since that doesn't exist, can someone point me at some
            documentation<br>
            that is easier to understand than the comments in augeas.c?
            :-o<br>
            <br>
            <br>
            ========== Side Topic<br>
            <br>
            One person suggested creating an augeas variable whose value
            was the<br>
            contents of intf, then referencing that variable in the path
            sent to<br>
            aug_match(); unfortunately, having a path string like this:<br>
            <br>
                /files/sys/class/net/$interface/address/content<br>
            <br>
            seems to never work. For that matter, defining a variable
            that contains<br>
            the entire path, then calling aug_get(aug, "$interface",
            &mac) doesn't<br>
            even do what I want - variable substitution does work when
            the *entire<br>
            path string* is "$variableName", but the xpath-like
            evaluation still<br>
            takes place, so the special characters are still interpreted
            and acted on.<br>
            <br>
            <br>
            _______________________________________________<br>
            augeas-devel mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br>
            <a moz-do-not-send="true"
              href="https://www.redhat.com/mailman/listinfo/augeas-devel"
              target="_blank">https://www.redhat.com/mailman/listinfo/augeas-devel</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">
          <div dir="ltr">Raphaël Pinson
            <div>Infrastructure Developer & Training Leader</div>
            <div>+33 479 26 57 93
              <div>+33 781 90 00 79</div>
              <div><br>
              </div>
              <div>Camptocamp France<br>
                Savoie Technolac<br>
                BP 352<br>
                48, avenue du Lac du Bourget<br>
                73372 Le Bourget du Lac, Cedex<br>
                <a moz-do-not-send="true"
                  href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
augeas-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/augeas-devel">https://www.redhat.com/mailman/listinfo/augeas-devel</a></pre>
    </blockquote>
    <br>
  </body>
</html>