[389-devel] Please review (take 2): [389 Project] #47555: db2bak.pl issue when specifying non-default directory

Noriko Hosoi nhosoi at redhat.com
Fri Nov 1 00:38:17 UTC 2013


https://fedorahosted.org/389/ticket/47555

https://fedorahosted.org/389/attachment/ticket/47555/0001-Ticket-47555-db2bak.pl-issue-when-specifying-non-def.patch

  Thank you for your comments, Rich.  Revised the patch as follows:
  Bug description: db2bak.pl takes an option "-a backupdir", which is
  supposed to be generated by the server and used as a backup directory.
  But since the created directory inherits the parent's selinux context,
  it fails to store the backup files in the directory.

  Fix description: As the reporter agaviola suggested, it should be a
  good idea to add one more level to the archive directory.
    $archivedir = "${archivedir}/ID-${yr}_${mn}_${dy}_${h}_${m}_${s}";
  But to keep the backward compatibility, introducing a new option "-A
  backupdir" and when "-A" is given, storing the backup files in the
  nested backup directory.  If the option is "-a backupdir", the backup
  files are stored in the backupdir.

  Respecting the selinux policy, the server and its utilities are not
  supposed to create a file/directory where it is not allowed.  This
  patch creates a symlink from the back up location to the specified
  path by a user.  bak2db.pl follows the symlink and restore from the
  back up directory.



More information about the 389-devel mailing list