src/net/java/sip/communicator/impl/configuration/ConfigurationActivator.java
/**
     * Makes home folder and the configuration file readable and writable only
     * to the owner.
     *
     * @param cs the <tt>ConfigurationService</tt> instance to check for home
     * folder and configuration file.
     */
Makes home folder and the configuration file readable and writable only
to the owner.

@param cs the ConfigurationService instance to check for home
folder and configuration file.
Makes home folder and the configuration file readable and writable only to the owner . @param cs the ConfigurationService instance to check for home folder and configuration file .
private static void fixPermissions(ConfigurationService cs)
    {
        if(!OSUtils.IS_LINUX && !OSUtils.IS_MAC)
            return;
        try
        {
            File homeFolder
                = new File(cs.getScHomeDirLocation(), cs.getScHomeDirName());
            Set<PosixFilePermission> perms =
                new HashSet<PosixFilePermission>()
                {{
                    add(PosixFilePermission.OWNER_READ);
                    add(PosixFilePermission.OWNER_WRITE);
                    add(PosixFilePermission.OWNER_EXECUTE);
                }};
                Files.setPosixFilePermissions(
                    Paths.get(homeFolder.getAbsolutePath()), perms);
            String fileName = cs.getConfigurationFilename();
            if(fileName != null)
            {
                File cf = new File(homeFolder, fileName);
                if(cf.exists())
                {
                    perms = new HashSet<PosixFilePermission>()
                        {{
                            add(PosixFilePermission.OWNER_READ);
                            add(PosixFilePermission.OWNER_WRITE);
                        }};
                    Files.setPosixFilePermissions(
                        Paths.get(cf.getAbsolutePath()), perms);
                }
            }
        }
        catch(Throwable t)
        {
            logger.error(
                    "Error creating c lib instance for fixing file permissions",
                    t);
            if (t instanceof InterruptedException)
                Thread.currentThread().interrupt();
            else if (t instanceof ThreadDeath)
                throw (ThreadDeath) t;
        }
    }
private static void fixPermissions ( ConfigurationService cs ) { if ( ! OSUtils . IS_LINUX && ! OSUtils . IS_MAC ) return ; try { File homeFolder = new File ( cs . getScHomeDirLocation ( ) , cs . getScHomeDirName ( ) ) ; Set < PosixFilePermission > perms = new HashSet < PosixFilePermission > ( ) { { add ( PosixFilePermission . OWNER_READ ) ; add ( PosixFilePermission . OWNER_WRITE ) ; add ( PosixFilePermission . OWNER_EXECUTE ) ; } } ; Files . setPosixFilePermissions ( Paths . get ( homeFolder . getAbsolutePath ( ) ) , perms ) ; String fileName = cs . getConfigurationFilename ( ) ; if ( fileName != null ) { File cf = new File ( homeFolder , fileName ) ; if ( cf . exists ( ) ) { perms = new HashSet < PosixFilePermission > ( ) { { add ( PosixFilePermission . OWNER_READ ) ; add ( PosixFilePermission . OWNER_WRITE ) ; } } ; Files . setPosixFilePermissions ( Paths . get ( cf . getAbsolutePath ( ) ) , perms ) ; } } } catch ( Throwable t ) { logger . error ( "Error creating c lib instance for fixing file permissions" , t ) ; if ( t instanceof InterruptedException ) Thread . currentThread ( ) . interrupt ( ) ; else if ( t instanceof ThreadDeath ) throw ( ThreadDeath ) t ; } }
Makes home folder and the configuration file readable and writable only
 to the owner.
Makes home folder and the configuration file readable and writable only to the owner .
// let's check config file and config folder