Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
isv:hp:education
kdelibs3
kdelibs_kpropertiesdialog_acls.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kdelibs_kpropertiesdialog_acls.diff of Package kdelibs3
Index: kio/kfile/kpropertiesdialog.cpp =================================================================== --- kio/kfile/kpropertiesdialog.cpp (revision 505170) +++ kio/kfile/kpropertiesdialog.cpp (revision 505171) @@ -1493,6 +1493,7 @@ bool hasExtendedACL; KACL extendedACL; KACL defaultACL; + bool fileSystemSupportsACLs; }; #define UniOwner (S_IRUSR|S_IWUSR|S_IXUSR) @@ -1550,6 +1551,7 @@ d->hasExtendedACL = item->ACL().isExtended() || item->defaultACL().isValid(); d->extendedACL = item->ACL(); d->defaultACL = item->defaultACL(); + d->fileSystemSupportsACLs = false; if ( properties->items().count() > 1 ) { @@ -1849,6 +1851,22 @@ box->addStretch (10); } +#ifdef USE_POSIX_ACL +static bool fileSystemSupportsACL( const QCString& pathCString ) +{ + bool fileSystemSupportsACLs = false; +#ifdef Q_OS_FREEBSD + struct statfs buf; + fileSystemSupportsACLs = ( statfs( pathCString.data(), &buf ) == 0 ) && ( buf.f_flags & MNT_ACLS ); +#else + fileSystemSupportsACLs = + getxattr( pathCString.data(), "system.posix_acl_access", NULL, 0 ) >= 0 || errno == ENODATA; +#endif + return fileSystemSupportsACLs; +} +#endif + + void KFilePermissionsPropsPlugin::slotShowAdvancedPermissions() { bool isDir = (d->pmode == PermissionsOnlyDirs) || (d->pmode == PermissionsMixed); @@ -2053,20 +2071,13 @@ #ifdef USE_POSIX_ACL KACLEditWidget *extendedACLs = 0; - bool fileSystemSupportsACLs = false; // FIXME make it work with partial entries if ( properties->items().count() == 1 ) { - QCString pathCString = QFile::encodeName( properties->item()->url().path() ); -#ifdef Q_OS_FREEBSD - struct statfs buf; - fileSystemSupportsACLs = ( statfs( pathCString.data(), &buf ) == 0 ) && ( buf.f_flags & MNT_ACLS ); -#else - fileSystemSupportsACLs = - getxattr( pathCString.data(), "system.posix_acl_access", NULL, 0 ) >= 0 || errno == ENODATA; -#endif + QCString pathCString = QFile::encodeName( properties->item()->url().path() ); + d->fileSystemSupportsACLs = fileSystemSupportsACL( pathCString ); } - if ( fileSystemSupportsACLs ) { + if ( d->fileSystemSupportsACLs ) { std::for_each( theNotSpecials.begin(), theNotSpecials.end(), std::mem_fun( &QWidget::hide ) ); extendedACLs = new KACLEditWidget( mainVBox ); if ( d->extendedACL.isValid() && d->extendedACL.isExtended() ) @@ -2465,9 +2476,9 @@ if (files.count() > 0) { job = KIO::chmod( files, orFilePermissions, ~andFilePermissions, owner, group, false ); - if ( ACLChange ) + if ( ACLChange && d->fileSystemSupportsACLs ) job->addMetaData( "ACL_STRING", d->extendedACL.isValid()?d->extendedACL.asString():"ACL_DELETE" ); - if ( defaultACLChange ) + if ( defaultACLChange && d->fileSystemSupportsACLs ) job->addMetaData( "DEFAULT_ACL_STRING", d->defaultACL.isValid()?d->defaultACL.asString():"ACL_DELETE" ); connect( job, SIGNAL( result( KIO::Job * ) ), @@ -2481,9 +2492,9 @@ if (dirs.count() > 0) { job = KIO::chmod( dirs, orDirPermissions, ~andDirPermissions, owner, group, recursive ); - if ( ACLChange ) + if ( ACLChange && d->fileSystemSupportsACLs ) job->addMetaData( "ACL_STRING", d->extendedACL.isValid()?d->extendedACL.asString():"ACL_DELETE" ); - if ( defaultACLChange ) + if ( defaultACLChange && d->fileSystemSupportsACLs ) job->addMetaData( "DEFAULT_ACL_STRING", d->defaultACL.isValid()?d->defaultACL.asString():"ACL_DELETE" ); connect( job, SIGNAL( result( KIO::Job * ) ),
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor