Skip to content

Commit

Permalink
Merge branch 'main' into fix-rpm2cpio
Browse files Browse the repository at this point in the history
  • Loading branch information
danigm committed Sep 4, 2024
2 parents ffe4b2c + 226484c commit cd5f890
Show file tree
Hide file tree
Showing 68 changed files with 1,909 additions and 170 deletions.
4 changes: 2 additions & 2 deletions configs/Fedora/users-groups.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by tools/generate-fedora-users-groups.py on 2022-09-07

StandardUsers = ['abrt', 'activemq', 'adm', 'aeolus', 'amandabackup', 'apache', 'arpwatch', 'ats', 'avahi', 'avahi-autoipd', 'bacula', 'beagleindex', 'bin', 'cassandra', 'ceilometer', 'ceph', 'cimsrvr', 'cinder', 'clamav', 'condor', 'cyrus', 'daemon', 'dbus', 'desktop', 'dhcpd', 'distcache', 'dovecot', 'elasticsearch', 'exim', 'fax', 'frontpage', 'ftp', 'games', 'gdm', 'glance', 'gopher', 'hacluster', 'haldaemon', 'halt', 'haproxy', 'heat', 'hsqldb', 'ident', 'jbosson-agent', 'jetty', 'jonas', 'keystone', 'ldap', 'lp', 'luci', 'mail', 'mailman', 'mailnull', 'majordomo', 'mongodb', 'myproxy', 'mysql', 'named', 'netdump', 'news', 'nobody', 'nocpulse', 'nova', 'nscd', 'nslcd', 'ntp', 'nut', 'operator', 'oprofile', 'ovirt', 'ovirtagent', 'pegasus', 'piranha', 'pkiuser', 'polkituser', 'postfix', 'postgres', 'prelude-manager', 'privoxy', 'pulse', 'puppet', 'pvm', 'qemu', 'quagga', 'quantum', 'radiusd', 'radvd', 'retrace', 'rhevm', 'ricci', 'root', 'rpc', 'rpcuser', 'rpm', 'rtkit', 'sabayon', 'saned', 'sanlock', 'shutdown', 'smmsp', 'snortd', 'squid', 'sshd', 'stap-server', 'swift', 'sync', 'systemd-network', 'systemd-resolve', 'tcpdump', 'tomcat', 'tss', 'usbmuxd', 'uucp', 'vcsa', 'vdsm', 'vhostmd', 'wallaby', 'webalizer', 'wildfly', 'wnn', 'xfs']
StandardUsers = ['abrt', 'activemq', 'adm', 'aeolus', 'amandabackup', 'apache', 'arpwatch', 'ats', 'avahi', 'avahi-autoipd', 'bacula', 'beagleindex', 'bin', 'cassandra', 'ceilometer', 'ceph', 'cimsrvr', 'cinder', 'clamav', 'condor', 'cyrus', 'daemon', 'dbus', 'desktop', 'dhcpd', 'distcache', 'dovecot', 'elasticsearch', 'exim', 'fax', 'frontpage', 'ftp', 'games', 'gdm', 'glance', 'gopher', 'hacluster', 'haldaemon', 'halt', 'haproxy', 'heat', 'hsqldb', 'ident', 'jbosson-agent', 'jetty', 'jonas', 'keystone', 'ldap', 'lp', 'luci', 'mail', 'mailman', 'mailnull', 'majordomo', 'mongodb', 'myproxy', 'mysql', 'named', 'netdump', 'news', 'nobody', 'nocpulse', 'nova', 'nscd', 'nslcd', 'ntp', 'nut', 'operator', 'oprofile', 'ovirt', 'ovirtagent', 'pegasus', 'piranha', 'pkiuser', 'polkituser', 'postfix', 'postgres', 'prelude-manager', 'privoxy', 'pulse', 'puppet', 'pvm', 'qemu', 'quagga', 'quantum', 'radiusd', 'radvd', 'retrace', 'rhevm', 'ricci', 'root', 'rpc', 'rpcuser', 'rpm', 'rtkit', 'sabayon', 'saned', 'sanlock', 'shutdown', 'smmsp', 'snortd', 'squid', 'sshd', 'sssd', 'stap-server', 'swift', 'sync', 'systemd-network', 'systemd-resolve', 'tcpdump', 'tomcat', 'tss', 'usbmuxd', 'uucp', 'vcsa', 'vdsm', 'vhostmd', 'wallaby', 'webalizer', 'wildfly', 'wnn', 'xfs']

StandardGroups = ['abrt', 'activemq', 'adm', 'aeolus', 'apache', 'arpwatch', 'ats', 'audio', 'avahi', 'avahi-autoipd', 'bacula', 'beagleindex', 'bin', 'cassandra', 'cdrom', 'ceilometer', 'ceph', 'cimsrvr', 'cinder', 'clamav', 'condor', 'console', 'daemon', 'dbus', 'desktop', 'dhcpd', 'dialout', 'dip', 'disk', 'distcache', 'dovecot', 'elasticsearch', 'exim', 'fax', 'floppy', 'frontpage', 'ftp', 'games', 'gdm', 'glance', 'gopher', 'haclient', 'haldaemon', 'haproxy', 'heat', 'hsqldb', 'ident', 'input', 'jbosson', 'jetty', 'jonas', 'keystone', 'kmem', 'kvm', 'ldap', 'lock', 'lp', 'luci', 'mail', 'mailman', 'mailnull', 'majordomo', 'man', 'mem', 'mock', 'mongodb', 'myproxy', 'mysql', 'named', 'netdump', 'news', 'nobody', 'nocpulse', 'nova', 'nscd', 'ntp', 'nut', 'oprofile', 'ovirt', 'ovirtagent', 'pegasus', 'piranha', 'pkiuser', 'polkituser', 'popusers', 'postdrop', 'postfix', 'postgres', 'pppusers', 'prelude-manager', 'privoxy', 'pulse', 'puppet', 'pvm', 'qemu', 'quagga', 'quaggavt', 'quantum', 'radiusd', 'radvd', 'realtime', 'render', 'retrace', 'rhevm', 'ricci', 'root', 'rpc', 'rpcuser', 'rpm', 'rtkit', 'sabayon', 'saned', 'sanlock', 'saslauth', 'screen', 'sgx', 'slipusers', 'slocate', 'smmsp', 'snortd', 'squid', 'sshd', 'stap-server', 'stapdev', 'stapsys', 'stapusr', 'swift', 'sys', 'systemd-journal', 'systemd-network', 'systemd-resolve', 'tape', 'tcpdump', 'tomcat', 'tss', 'tty', 'usbmuxd', 'users', 'utempter', 'utmp', 'uucp', 'vcsa', 'vhostmd', 'video', 'wallaby', 'wbpriv', 'webalizer', 'wheel', 'wildfly', 'wine', 'wnn', 'xfs']
StandardGroups = ['abrt', 'activemq', 'adm', 'aeolus', 'apache', 'arpwatch', 'ats', 'audio', 'avahi', 'avahi-autoipd', 'bacula', 'beagleindex', 'bin', 'cassandra', 'cdrom', 'ceilometer', 'ceph', 'cimsrvr', 'cinder', 'clamav', 'condor', 'console', 'daemon', 'dbus', 'desktop', 'dhcpd', 'dialout', 'dip', 'disk', 'distcache', 'dovecot', 'elasticsearch', 'exim', 'fax', 'floppy', 'frontpage', 'ftp', 'games', 'gdm', 'glance', 'gopher', 'haclient', 'haldaemon', 'haproxy', 'heat', 'hsqldb', 'ident', 'input', 'jbosson', 'jetty', 'jonas', 'keystone', 'kmem', 'kvm', 'ldap', 'lock', 'lp', 'luci', 'mail', 'mailman', 'mailnull', 'majordomo', 'man', 'mem', 'mock', 'mongodb', 'myproxy', 'mysql', 'named', 'netdump', 'news', 'nobody', 'nocpulse', 'nova', 'nscd', 'ntp', 'nut', 'oprofile', 'ovirt', 'ovirtagent', 'pegasus', 'piranha', 'pkiuser', 'polkituser', 'popusers', 'postdrop', 'postfix', 'postgres', 'pppusers', 'prelude-manager', 'privoxy', 'pulse', 'puppet', 'pvm', 'qemu', 'quagga', 'quaggavt', 'quantum', 'radiusd', 'radvd', 'realtime', 'render', 'retrace', 'rhevm', 'ricci', 'root', 'rpc', 'rpcuser', 'rpm', 'rtkit', 'sabayon', 'saned', 'sanlock', 'saslauth', 'screen', 'sgx', 'slipusers', 'slocate', 'smmsp', 'snortd', 'squid', 'sshd', 'sssd', 'stap-server', 'stapdev', 'stapsys', 'stapusr', 'swift', 'sys', 'systemd-journal', 'systemd-network', 'systemd-resolve', 'tape', 'tcpdump', 'tomcat', 'tss', 'tty', 'usbmuxd', 'users', 'utempter', 'utmp', 'uucp', 'vcsa', 'vhostmd', 'video', 'wallaby', 'wbpriv', 'webalizer', 'wheel', 'wildfly', 'wine', 'wnn', 'xfs']
5 changes: 5 additions & 0 deletions configs/openSUSE/users-groups.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ StandardGroups = [
'privoxy',
'prometheus',
'prosody',
'proxy',
'ptokax',
'public',
'pulse',
Expand Down Expand Up @@ -181,6 +182,7 @@ StandardGroups = [
'sogo',
'squid',
'sshd',
'sssd',
'suse-ncc',
'svn',
'swift',
Expand Down Expand Up @@ -218,6 +220,7 @@ StandardGroups = [
'woodpecker',
'www',
'xok',
'xpra',
'xrootd',
'xymon',
'zabbix',
Expand Down Expand Up @@ -390,6 +393,7 @@ StandardUsers = [
'privoxy',
'prometheus',
'prosody',
'proxy',
'ptokax',
'pulse',
'puppet',
Expand Down Expand Up @@ -418,6 +422,7 @@ StandardUsers = [
'sogo',
'squid',
'sshd',
'sssd',
'statd',
'suse-ncc',
'svn',
Expand Down
22 changes: 11 additions & 11 deletions rpmlint/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,17 @@ def __enter__(self):
def __exit__(self, exc_type, exc_val, exc_tb):
self.cleanup()

def check_versioned_dep(self, name, version):
# try to match name%_isa as well (e.g. 'foo(x86-64)', 'foo(x86-32)')
name_re = re.compile(r'^%s(\(\w+-\d+\))?$' % re.escape(name))
for d in self.requires + self.prereq:
if name_re.match(d[0]):
if d[1] & rpm.RPMSENSE_EQUAL != rpm.RPMSENSE_EQUAL \
or d[2][1] != version:
return False
return True
return False

def read_with_mmap(self, filename):
"""Mmap a file, return it's content decoded."""
try:
Expand Down Expand Up @@ -715,17 +726,6 @@ def readlink(self, pkgfile):
result = self.files.get(linkpath)
return result

def check_versioned_dep(self, name, version):
# try to match name%_isa as well (e.g. 'foo(x86-64)', 'foo(x86-32)')
name_re = re.compile(r'^%s(\(\w+-\d+\))?$' % re.escape(name))
for d in self.requires + self.prereq:
if name_re.match(d[0]):
if d[1] & rpm.RPMSENSE_EQUAL != rpm.RPMSENSE_EQUAL \
or d[2][1] != version:
return False
return True
return False


def get_installed_pkgs(name):
"""Get list of installed package objects by name."""
Expand Down
Binary file removed test/binary/Nonutfpostcheck-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/appdata-1.91-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/bashisms-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/builddate-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/buildroot-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/dbusrule-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/desktopfile-bad-binary-0-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/desktopfile-bad-duplicate-0-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/desktopfile-bad-section-0-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/desktopfile-bad-unicode-0-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/desktopfile-good-0-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/development-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/erlang-test-0-2.1.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/file-zero-length-1.1-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/filechecks-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/init-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/libslp-missing-suffix-1.0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/libslp1234-1.0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/makefile-junk-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/manual-pages-0-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/menuxdg1-0-0.noarch.rpm
Binary file not shown.
Binary file removed test/binary/mixed-ownership-1.0-0.x86_64.rpm
Binary file not shown.
Binary file not shown.
Binary file removed test/binary/non-utf8-1.0-1.el5.centos.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/pam-module-1.0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/pc-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/python3-greenlet-0.4.15-1.5.x86_64.rpm
Binary file not shown.
Binary file not shown.
Binary file removed test/binary/rc-links-1.0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/rust-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/shlib1-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/shlib2-devel-0-0.x86_64.rpm
Binary file not shown.
Binary file not shown.
Binary file removed test/binary/systemd-tmpfiles-1.0-0.x86_64.rpm
Binary file not shown.
Binary file not shown.
Binary file removed test/binary/tasque-0.1.12-12.7.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/tclpackage-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/testdocumentation-0-0.x86_64.rpm
Binary file not shown.
Binary file removed test/binary/unexpanded-macro-files-0.1-1.noarch.rpm
Binary file not shown.
Binary file added test/files/README1.gz
Binary file not shown.
Binary file added test/files/README2.bz2
Binary file not shown.
Binary file added test/files/README3.xz
Binary file not shown.
106 changes: 106 additions & 0 deletions test/files/netmask/errors.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/* errors.c -- error message handlers.
Copyright (C) 1998 Robert Stone <[email protected]>
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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */

#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "errors.h"
#include "config.h"


/* compatibility section */
#ifdef HAVE_SYSLOG_H
# include <syslog.h>
#else /* HAVE_SYSLOG_H */
#warning no syslog facility? Errors will go to stderr.
# define syslog(x,y,z)
# define LOG_DEBUG 7
# define LOG_WARNING 4
# define LOG_ERR 3
#endif

#ifndef HAVE_VPRINTF
#error no vprintf? not ANSI C3.159-1989 (``ANSI C'') compliant?
#endif

#ifndef HAVE_STRERROR
#define strerror(x) "system error"
#endif
/* end compatibility section */

static char *progname = NULL;

static int show_status = 0;
static int use_syslog = 0;

static int message(int, const char *);

int initerrors(char *pn, int type, int stat) {
#ifdef HAVE_SYSLOG_H
if(type == 0 || type == 1) use_syslog = type;
#endif /* HAVE_SYSLOG_H */
if(pn != NULL) progname = pn;
if(stat == 0 || stat == 1) show_status = stat;
return(0);
}

int status(const char *fmt, ...) {
static char buf[1024];
va_list args;

if(!show_status) return(0);
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
return(message(LOG_DEBUG, buf));
}

int warn(const char *fmt, ...) {
static char buf[1024];
va_list args;

va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
return(message(LOG_WARNING, buf));
}

int panic(const char *fmt, ...) {
static char buf[1024];
va_list args;

va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
message(LOG_ERR, buf);
exit(1);
}

int message(int priority, const char *msg) {
char buf[1024];

/* only handle errno if this is not an informational message */
if(errno && priority < 5) {
sprintf(buf, "%s: %s", msg, strerror(errno));
errno = 0;
} else strcpy(buf, msg);
if(use_syslog) syslog(priority, "%s", buf);
else fprintf(stderr, "%s: %s\n", progname, buf);
return(0);
}
45 changes: 45 additions & 0 deletions test/files/netmask/errors.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* errors.h -- error message handlers.
Copyright (C) 1998 Robert Stone <[email protected]>
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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */

#ifndef _HAVE_ERRORS_H
#define _HAVE_ERRORS_H

/* call initerrors before using these other functions
*
* these functions seem pretty straightforward to me, the messaging
* functions take sprintf formatted strings and have a limit of
* 1024 byte long error messages.
* progname should be set to argv[0]
* if progname is NULL, it is unchanged
* type == 0 for stderr
* type == 1 for syslog
* otherwise type is unchanged
* stat == 0 to skip status reporting
* stat == 1 to print status messages
* otherwise stat is unchanged
* defaults: progname = NULL, type = 0, stat = 0 */
int initerrors(char *progname, int type, int stat);

int status(const char *fmt, ...);
/* print a status message */

int warn(const char *fmt, ...);
/* print a warning message */

int panic(const char *fmt, ...);
/* print an error and exit */
#endif
Loading

0 comments on commit cd5f890

Please sign in to comment.