builds and runs on intel-x86 and rpi4 with acceptable realtime performance

This commit is contained in:
vaughn committed 2026-09-25 17:29:14 -04:00
1 parent 2bce6fa556
commit 3faf544f0b
120 files changed
+6317 -1

No files matched your search

@@ -0,0 +1,31 @@
From 232757d8dc40384db38281bd2d0f99f1d94ddd9e Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Thu, 26 Dec 2024 15:31:15 +0800
Subject: [PATCH] modules/pam_postgresok: change uid to 28
The default uid for postgres user is 28 in meta-oe rather than 26 in
redhat linux.
Upstream-Status: Inappropriate [WRLinux Specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
modules/pam_postgresok/pam_postgresok.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/pam_postgresok/pam_postgresok.c b/modules/pam_postgresok/pam_postgresok.c
index 0961b72..786a233 100644
--- a/modules/pam_postgresok/pam_postgresok.c
+++ b/modules/pam_postgresok/pam_postgresok.c
@@ -69,7 +69,7 @@ int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc
uid = getuid();
pw = pam_modutil_getpwuid(pamh, uid);
- if ((uid == 26) && (pw != NULL) && (strcmp(pw->pw_name, "postgres") == 0))
+ if ((uid == 28) && (pw != NULL) && (strcmp(pw->pw_name, "postgres") == 0))
retval = PAM_SUCCESS;
if (ctrl & PAM_DEBUG_ARG) {
--
2.25.1
@@ -0,0 +1,130 @@
From aa752cb9d30072912dd3b5d51a86ab2fe6f08970 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Mon, 11 Jan 2021 15:40:21 +0800
Subject: [PATCH] pam_faillock: add option to accept uid as argument
Add options '--uid' for command pam_faillock to accept uid as argument.
Upstream-Status: Submitted [https://github.com/linux-pam/linux-pam/pull/595]
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
modules/pam_faillock/main.c | 62 ++++++++++++++++++++++++++++++++++---
1 file changed, 58 insertions(+), 4 deletions(-)
diff --git a/modules/pam_faillock/main.c b/modules/pam_faillock/main.c
index c6dd19c..ff0e647 100644
--- a/modules/pam_faillock/main.c
+++ b/modules/pam_faillock/main.c
@@ -56,10 +56,29 @@
#include "faillock.h"
#include "faillock_config.h"
+static int get_uid (const char *uidstr, uid_t *uid)
+{
+ long long int val;
+ char *endptr;
+
+ errno = 0;
+ val = strtoll (uidstr, &endptr, 10);
+ if ( ('\0' == *uidstr)
+ || ('\0' != *endptr)
+ || (ERANGE == errno)
+ || (val != (uid_t)val)) {
+ return 0;
+ }
+
+ *uid = (uid_t)val;
+ return 1;
+}
+
static int
args_parse(int argc, char **argv, struct options *opts)
{
int i;
+ int cline_user = 0;
int rv;
const char *dir = NULL;
const char *conf = NULL;
@@ -67,6 +86,7 @@ args_parse(int argc, char **argv, struct options *opts)
memset(opts, 0, sizeof(*opts));
opts->progname = argv[0];
+ opts->uid = (uid_t)-1;
for (i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--conf") == 0) {
@@ -94,6 +114,24 @@ args_parse(int argc, char **argv, struct options *opts)
return -1;
}
opts->user = argv[i];
+ cline_user++;
+ }
+ else if (strcmp(argv[i], "--uid") == 0) {
+ ++i;
+ if(i >= argc || strlen(argv[i]) == 0) {
+ fprintf(stderr, "%s: No user id supplied.\n", argv[0]);
+ return -1;
+ }
+ uid_t user_id = (uid_t)-1;
+ if ( (get_uid (argv[i], &user_id) ==0)
+ || (user_id == (uid_t)-1)) {
+ fprintf (stderr,
+ _("%s: invalid user ID '%s'\n"),
+ argv[0], argv[i]);
+ return -1;
+ }
+ opts->uid = user_id;
+ cline_user++;
}
else if (strcmp(argv[i], "--reset") == 0) {
opts->reset = 1;
@@ -121,6 +159,10 @@ args_parse(int argc, char **argv, struct options *opts)
}
}
+ if (cline_user > 1) {
+ fprintf(stderr, "--user and --uid are mutually exclusive options!\n");
+ return -1;
+ }
return 0;
}
@@ -129,8 +171,8 @@ usage(const char *progname)
{
fprintf(stderr,
_("Usage: %s [--dir /path/to/tally-directory]"
- " [--user username] [--reset] [--legacy-output]\n"), progname);
-
+ " [--user username] [--uid userid] [--reset] [--legacy-output]\n"), progname);
+ fprintf(stderr, "NOTE: --user and --uid are mutually exclusive options, userid must be non-negative.\n");
}
static int
@@ -323,9 +365,21 @@ main (int argc, char *argv[])
return 1;
}
- if (opts.user == NULL) {
+ if (opts.user == NULL && opts.uid == (uid_t)-1) {
return do_allusers(&opts);
}
- return do_user(&opts, opts.user);
+ if (opts.user != NULL) {
+ return do_user(&opts, opts.user);
+ }
+ else {
+ errno = 0;
+ struct passwd *pwd = getpwuid(opts.uid);
+ if (pwd) {
+ return do_user(&opts, pwd->pw_name);
+ }
+ else {
+ fprintf(stderr, "%s: No matching passwd found, errno: %d\n", opts.progname, errno);
+ }
+ }
}
--
2.25.1
@@ -0,0 +1,20 @@
Upstream-Status: Inappropriate [WRLinux Specific]
diff --git a/modules/meson.build b/modules/meson.build
index 68a7a63..cbe5c8a 100644
--- a/modules/meson.build
+++ b/modules/meson.build
@@ -1,5 +1,6 @@
subdir('pam_access')
subdir('pam_canonicalize_user')
+subdir('pam_chroot')
subdir('pam_debug')
subdir('pam_deny')
subdir('pam_echo')
@@ -23,6 +24,7 @@ subdir('pam_motd')
subdir('pam_namespace')
subdir('pam_nologin')
subdir('pam_permit')
+subdir('pam_postgresok')
subdir('pam_pwhistory')
subdir('pam_rhosts')
subdir('pam_rootok')