[CentOS] restorecon and sudo

Thu Apr 26 07:28:45 UTC 2012
Philippe Naudin <philippe.naudin at supagro.inra.fr>

Hello,

On CentOS-6.2, these two commands (on the same machine) give me
different results : 
# restorecon -r /var/www/html/Centos/      # (as root)
$ sudo restorecon -r /var/www/html/Centos/ # (as an unprivileged user) 

/var/www/html/Centos/ is a symlink to /mnt/packages/Centos/

In the first case, I get :
# ls -Z /var/www/html/Centos/
drwxr-xr-x. naudin biom system_u:object_r:httpd_sys_content_t 6

and in the second case :
$ ls -Z /var/www/html/Centos/
drwxr-xr-x. naudin biom system_u:object_r:unlabeled_t:s0 6

Is this the expected behavior, or is there something I have missed ?


-- 
Philippe Naudin
UMR MISTEA : Mathématiques, Informatique et STatistique pour 
l'Environnement et l'Agronomie
INRA, bâtiment 29   -   2 place Viala   -   34060 Montpellier cedex 2
tél: 04.99.61.26.34, fax: 04.99.61.29.03, mél: naudin at supagro.inra.fr