CC-3531: When importing watched directory, correcting a file's permissions does not work correctly.

-fixed
This commit is contained in:
Martin Konecny 2012-03-27 16:59:26 -04:00
parent 45fcedfbd3
commit f8a71a3923
2 changed files with 7 additions and 2 deletions

View File

@ -187,9 +187,14 @@ class AirtimeNotifier(Notifier):
mm = self.proc_fun()
self.mmc.set_needed_file_permissions(directory, True)
for (path, dirs, files) in os.walk(directory):
for d in dirs:
self.mmc.set_needed_file_permissions(os.path.join(path, d), True)
for filename in files:
full_filepath = path+"/"+filename
full_filepath = os.path.join(path, filename)
if self.mmc.is_audio_file(full_filepath):
if self.mmc.set_needed_file_permissions(full_filepath, False):

View File

@ -75,7 +75,7 @@ class MediaMonitorCommon:
def set_needed_file_permissions(self, item, is_dir):
try:
omask = os.umask(0)
if not self.has_correct_permissions(item, 'www-data', 'www-data'):
if not self.has_correct_permissions(item, 'www-data', 'www-data') or not self.has_correct_permissions(item, 'pypo', 'pypo'):
# stats.st_mode is the original permission
# stat.S_IROTH - readable by all permission
# stat.S_IXOTH - excutable by all permission