@@ -420,7 +420,7 @@ int protect(char *pkgname, gid_t gid)
420420 return -1 ;
421421 }
422422 if (chmod (pkgpath , S_IRUSR |S_IWUSR |S_IRGRP ) < 0 ) {
423- ALOGE ("failed to chmod '%s': %s\n" , pkgpath , strerror (errno ));
423+ ALOGE ("protect(): failed to chmod '%s': %s\n" , pkgpath , strerror (errno ));
424424 return -1 ;
425425 }
426426
@@ -1014,13 +1014,13 @@ int linklib(const char* dataDir, const char* asecLibDir)
10141014
10151015 if (stat (dataDir , & s ) < 0 ) return -1 ;
10161016
1017- if (chown (dataDir , 0 , 0 ) < 0 ) {
1017+ if (chown (dataDir , AID_INSTALL , AID_INSTALL ) < 0 ) {
10181018 ALOGE ("failed to chown '%s': %s\n" , dataDir , strerror (errno ));
10191019 return -1 ;
10201020 }
10211021
10221022 if (chmod (dataDir , 0700 ) < 0 ) {
1023- ALOGE ("failed to chmod '%s': %s\n" , dataDir , strerror (errno ));
1023+ ALOGE ("linklib() 1: failed to chmod '%s': %s\n" , dataDir , strerror (errno ));
10241024 rc = -1 ;
10251025 goto out ;
10261026 }
@@ -1058,7 +1058,7 @@ int linklib(const char* dataDir, const char* asecLibDir)
10581058
10591059out :
10601060 if (chmod (dataDir , s .st_mode ) < 0 ) {
1061- ALOGE ("failed to chmod '%s': %s\n" , dataDir , strerror (errno ));
1061+ ALOGE ("linklib() 2: failed to chmod '%s': %s\n" , dataDir , strerror (errno ));
10621062 rc = - errno ;
10631063 }
10641064
@@ -1091,13 +1091,13 @@ int unlinklib(const char* dataDir)
10911091 return -1 ;
10921092 }
10931093
1094- if (chown (dataDir , 0 , 0 ) < 0 ) {
1094+ if (chown (dataDir , AID_INSTALL , AID_INSTALL ) < 0 ) {
10951095 ALOGE ("failed to chown '%s': %s\n" , dataDir , strerror (errno ));
10961096 return -1 ;
10971097 }
10981098
10991099 if (chmod (dataDir , 0700 ) < 0 ) {
1100- ALOGE ("failed to chmod '%s': %s\n" , dataDir , strerror (errno ));
1100+ ALOGE ("unlinklib() 1: failed to chmod '%s': %s\n" , dataDir , strerror (errno ));
11011101 rc = -1 ;
11021102 goto out ;
11031103 }
@@ -1140,7 +1140,7 @@ int unlinklib(const char* dataDir)
11401140
11411141out :
11421142 if (chmod (dataDir , s .st_mode ) < 0 ) {
1143- ALOGE ("failed to chmod '%s': %s\n" , dataDir , strerror (errno ));
1143+ ALOGE ("unlinklib() 2: failed to chmod '%s': %s\n" , dataDir , strerror (errno ));
11441144 rc = -1 ;
11451145 }
11461146
0 commit comments