nr_free_pages 555260
nr_zone_inactive_anon 43303
nr_zone_active_anon 460203
nr_zone_inactive_file 372346
nr_zone_active_file 357444
nr_zone_unevictable 1032
nr_zone_write_pending 153
nr_mlock 32
nr_bounce 0
nr_zspages 0
nr_free_cma 0
nr_unaccepted 0
numa_hit 67999557946
numa_miss 0
numa_foreign 0
numa_interleave 974
numa_local 67999603269
numa_other 0
nr_inactive_anon 43303
nr_active_anon 460203
nr_inactive_file 372346
nr_active_file 357444
nr_unevictable 1032
nr_slab_reclaimable 100021
nr_slab_unreclaimable 46166
nr_isolated_anon 0
nr_isolated_file 0
workingset_nodes 38083
workingset_refault_anon 16621172
workingset_refault_file 141237239
workingset_activate_anon 4966030
workingset_activate_file 50346860
workingset_restore_anon 4961756
workingset_restore_file 20359036
workingset_nodereclaim 3985614
nr_anon_pages 459942
nr_mapped 27921
nr_file_pages 798245
nr_dirty 153
nr_writeback 0
nr_writeback_temp 0
nr_shmem 4537
nr_shmem_hugepages 0
nr_shmem_pmdmapped 0
nr_file_hugepages 0
nr_file_pmdmapped 0
nr_anon_transparent_hugepages 297
nr_vmscan_write 24148311
nr_vmscan_immediate_reclaim 6
nr_dirtied 979831681
nr_written 998941699
nr_throttled_written 0
nr_kernel_misc_reclaimable 0
nr_foll_pin_acquired 23219
nr_foll_pin_released 23219
nr_kernel_stack 10860
nr_page_table_pages 4821
nr_sec_page_table_pages 0
nr_iommu_pages 0
nr_swapcached 63918
pgpromote_success 0
pgpromote_candidate 0
  #   ˆl–Ým_Jµ!®Å8 CpÜiå1hßÁ„/¶ïÀ¿ 6…    #!/usr/bin/python3 -EsI
# Copyright (C) 2005 Red Hat
# see file 'COPYING' for use and warranty information
#
#    chcat is a script that allows you modify the Security label on a file
#
#    Author: Daniel Walsh <dwalsh@redhat.com>
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of the GNU General Public License as
#    published by the Free Software Foundation; either version 2 of
#    the License, or (at your option) any later version.
#
#    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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
#                                        02111-1307  USA
#
#
import subprocess
import sys
import os
import pwd
import getopt
import selinux
import seobject

PROGNAME = "selinux-python"
try:
    import gettext
    kwargs = {}
    if sys.version_info < (3,):
        kwargs['unicode'] = True
    t = gettext.translation(PROGNAME,
                    localedir="/usr/share/locale",
                    **kwargs,
                    fallback=True)
    _ = t.gettext
except:
    try:
        import builtins
        builtins.__dict__['_'] = str
    except ImportError:
        import __builtin__
        __builtin__.__dict__['_'] = unicode


def errorExit(error):
    sys.stderr.write("%s: " % sys.argv[0])
    sys.stderr.write("%s\n" % error)
    sys.stderr.flush()
    sys.exit(1)


def verify_users(users):
    for u in users:
        try:
            pwd.getpwnam(u)
        except KeyError:
            error("User %s does not exist" % u)


def chcat_user_add(newcat, users):
    errors = 0
    logins = seobject.loginRecords()
    seusers = logins.get_all()
    add_ind = 0
    verify_users(users)
    for u in users:
        if u in seusers.keys():
            user = seusers[u]
        else:
            add_ind = 1
            user = seusers["__default__"]
        serange = user[1].split("-")
        cats = []
        top = ["s0"]
        if len(serange) > 1:
            top = serange[1].split(":")
            if len(top) > 1:
                cats = expandCats(top[1].split(','))

        for i in newcat[1:]:
            if i not in cats:
                cats.append(i)

        if len(cats) > 0:
            new_serange = "%s-%s:%s" % (serange[0], top[0], ",".join(cats))
        e