acl-devel
[Top][All Lists]
Advanced

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

[Acl-devel] acl_from_text() not always setting errno


From: Rob Browning
Subject: [Acl-devel] acl_from_text() not always setting errno
Date: Sun, 13 Oct 2013 13:55:05 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

A problem was reported to the bup-list where python-pylibacl appeared to
be throwing an IOError with errno set to 0.  It looks like that's due to
this code in pylibacl:

    else if(text != NULL)
        self->acl = acl_from_text(text);

  [...]

    if(self->acl == NULL) {
        PyErr_SetFromErrno(PyExc_IOError);
        return -1;
    }

So via PyErr_SetFromErrno(), pylibacl is just reporting whatever errno
value was provided by acl_from_text().

Then I looked in acl_from_text(), and it appears that sometimes errno is
not being set even though NULL is being returned.  I wondered if that
was intentional, or a bug.  If the former, it might be worth updating
this bit of the manpage:

  RETURN VALUE
     On success, this function returns a pointer to the working storage.
     On error, a value of (acl_t)NULL is returned, and errno is set
     appropriately.

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4



reply via email to

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