<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7990</bug_id>
          
          <creation_ts>2015-07-13 08:44:41 +0000</creation_ts>
          <short_desc>lsetxattr: value truncated</short_desc>
          <delta_ts>2015-09-22 14:41:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Pseudo</product>
          <component>pseudo</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.9 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Seebs">seebs</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yp.pseudo.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          <qa_contact name="Daniel Istrate">daniel.alexandrux.istrate</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>52305</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-07-13 08:44:41 +0000</bug_when>
    <thetext>Certain xattr values get truncated. Here&apos;s an example, using setfattr and getfattr from Debian&apos;s &quot;attr&quot; package. Run under pseudo:

# touch foobar
# setfattr -n security.ima -v 0x032f foobar
# getfattr -d -m . -e hex foobar
# file: foobar
security.ima=0x03

Note that the last byte of the value is missing. It&apos;s also suspicious that 2f is hex for a slash, and that there is special handling for trailing slashes in pseudo_client_op().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52307</commentid>
    <comment_count>1</comment_count>
      <attachid>2587</attachid>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-07-13 09:57:19 +0000</bug_when>
    <thetext>Created attachment 2587
don&apos;t truncate xattr values

It was the pseudo server which removed the trailing slash from the xattr value. Here&apos;s a patch against 1.6.4 (as in Poky Fido) which avoids that for those operations where &quot;oldpath&quot; is not really a path.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52415</commentid>
    <comment_count>2</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2015-07-15 21:59:27 +0000</bug_when>
    <thetext>D&apos;oh. That&apos;s a really beautiful bug, and one I&apos;d completely failed to think of. Nice catch! Yes, that needs to get fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52565</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-07-23 20:41:36 +0000</bug_when>
    <thetext>Fixed in pseudo 1.6.7, merged in oe-core 0295947a2ccc66037f9c20f06b4b69a781a046bd.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54444</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Istrate">daniel.alexandrux.istrate</who>
    <bug_when>2015-09-22 14:41:05 +0000</bug_when>
    <thetext>Verified on master: 7b86c771c80d0759c2ca0e57c46c4c966f89c49e

Steps to verify:
1. bitbake m4 -c devshell
2. When the terminal pops up attempt the commands from the Description:

[root@fedora-ws m4-1.4.17]# touch foobar
[root@fedora-ws m4-1.4.17]# setfattr -n security.ima -v 0x032f foobar
[root@fedora-ws m4-1.4.17]# getfattr -d -m . -e hex foobar
# file: foobar
security.ima=0x032f

[root@fedora-ws m4-1.4.17]#</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>2587</attachid>
            <date>2015-07-13 09:57:19 +0000</date>
            <delta_ts>2015-07-13 09:57:19 +0000</delta_ts>
            <desc>don&apos;t truncate xattr values</desc>
            <filename>pseudo-xattr.patch</filename>
            <type>text/plain</type>
            <size>1626</size>
            <attacher name="Patrick Ohly">patrick.ohly</attacher>
            
              <data encoding="base64">KioqIHBzZXVkby5jLm9yaWcJTW9uIEp1bCAxMyAxMTo1NDowMiAyMDE1Ci0tLSBwc2V1ZG8uYwlN
b24gSnVsIDEzIDExOjU0OjI1IDIwMTUKKioqKioqKioqKioqKioqCioqKiA0OTgsNTAzICoqKioK
LS0tIDQ5OCw1MDQgLS0tLQogIAlpbnQgcHJlZmVyX2lubyA9IDA7CiAgCWludCB4YXR0cl9mbGFn
cyA9IDA7CiAgCWludCB0cmFpbGluZ19zbGFzaCA9IDAsIG9sZF90cmFpbGluZ19zbGFzaCA9IDA7
CisgCWludCByZW1vdmVfdHJhaWxpbmdfc2xhc2hfaW5fb2xkcGF0aCA9IDE7CiAgCiAgCWlmICgh
bXNnKQogIAkJcmV0dXJuIDE7CioqKioqKioqKioqKioqKgoqKiogNTI4LDUzOSAqKioqCiAgCWlm
IChtc2ctPnBhdGhsZW4pIHsKICAJCXNpemVfdCBpbml0aWFsX2xlbjsKICAJCXN3aXRjaCAobXNn
LT5vcCkgewotIAkJY2FzZSBPUF9SRU5BTUU6CiAgCQljYXNlIE9QX0NSRUFURV9YQVRUUjoKLSAJ
CWNhc2UgT1BfR0VUX1hBVFRSOgotIAkJY2FzZSBPUF9MSVNUX1hBVFRSOgogIAkJY2FzZSBPUF9S
RVBMQUNFX1hBVFRSOgogIAkJY2FzZSBPUF9TRVRfWEFUVFI6CiAgCQkJLyogSW4gYSByZW5hbWUg
dGhlcmUgYXJlIHR3byBwYXRocywgbnVsbCBzZXBhcmF0ZWQgaW4gbXN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