On 02/08/2017 06:00 PM, Seth Arnold wrote:
> On Wed, Feb 08, 2017 at 10:01:40PM +0000, Tyler Hicks wrote:
>> --- a/utils/apparmor/aa.py
>> +++ b/utils/apparmor/aa.py
>> @@ -73,7 +73,7 @@ _ = init_translation()
>>  # Setup logging incase of debugging is enabled
>>  debug_logger = DebugLogger('aa')
>>  
>> -CONFDIR = '/etc/apparmor'
>> +CONFDIR = os.getenv('APPARMOR_PY_CONFDIR', '/etc/apparmor')
>>  
> 
>>  check: __libapparmor
>> +    export PYTHONPATH=$(PYTHONPATH) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) 
>> LC_ALL=C APPARMOR_PY_CONFDIR=$(CONFDIR) ; $(foreach test, $(wildcard 
>> test-*.py), echo ; echo === $(test) === ; $(call pyalldo, $(test)))
>>  
> 
> Note that it's possible for the variable to be set, but not to a value;
> os.getenv() won't return the fallback in this spot:
> 
> $ export SARS= ; python3 -c 'import os; print(os.getenv("SARNOLD", "NOT 
> SET"))'
> NOT SET
> $ export SARS= ; python3 -c 'import os; print(os.getenv("SARS", "NOT SET"))'
> 
> $ 
> 
> 

Good catch! I'll change the line to:

CONFDIR = os.getenv('APPARMOR_PY_CONFDIR') or '/etc/apparmor'

Let me know if you'd like me to send a v2 of the patch.

Tyler

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to