Don't incorrectly change permissions on link target in SetPermissionsOfLink in unix fs code. Just don't do anything for changes targetting links. b=457487 r=smichaud sr=dougt
authorJosh Aas <joshmoz@gmail.com>
Tue, 07 Oct 2008 21:26:41 -0400
changeset 20124 ea6ec55b087f60f275004aa580a8f876c8731077
parent 20123 f87c1b3d0a192efcb0a5c41390def153303730e6
child 20125 2225040a7f30d8fac3d84b611df096236d73ff48
push idunknown
push userunknown
push dateunknown
reviewerssmichaud, dougt
bugs457487
milestone1.9.1b2pre
Don't incorrectly change permissions on link target in SetPermissionsOfLink in unix fs code. Just don't do anything for changes targetting links. b=457487 r=smichaud sr=dougt
xpcom/io/nsLocalFileUnix.cpp
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -1081,17 +1081,19 @@ nsLocalFile::SetPermissions(PRUint32 aPe
     if (chmod(mPath.get(), aPermissions) < 0)
         return NSRESULT_FOR_ERRNO();
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsLocalFile::SetPermissionsOfLink(PRUint32 aPermissions)
 {
-    return SetPermissions(aPermissions);
+    // There isn't a consistent mechanism for doing this on UNIX platforms. We
+    // might want to carefully implement this in the future though.
+    return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsLocalFile::GetFileSize(PRInt64 *aFileSize)
 {
     NS_ENSURE_ARG_POINTER(aFileSize);
     *aFileSize = LL_ZERO;
     ENSURE_STAT_CACHE();