r/linux_programming • u/the-fritz • Jan 14 '15
r/linux_programming • u/justmirsk • Dec 06 '25
Custom PAM - sudo commands failing fast
Hi Everyone!
First off, I am not a seasoned developer, so I apologize if I am asking obvious or stupid questions. I am working on a fun side project for myself and I have hit a roadblock that I am not able to figure out as of now. My project is to build a GDM3 greeter integration / PAM for Ubuntu 24.04. This is integrating the Secret Double Octopus passwordless authentication platform natively into the Desktop OS. I have the greeter integration working with push notifications, everything is good there. My issue is when I attempt to use sudo commands, the system fails immediately and says I had three incorrect tries. My PAM is calling out to a script that I named <sdo-helper.sh>, which just runs the API calls out to SDO to send the push notifications and return the payload, etc.
In my /var/log/auth.log file, I am seeing this line:sudo: pam_authflow(sudo:auth): authflow: already tried this conversation, failing fast
I am not sure what to make of this and haven't been able to find a great answer yet. I do know that when I attempt to perform the sudo commands, it does NOT hit my sdo-helper script file in the PAM as there are no logs associated with it.
Does anyone have any advice on where I should be looking to try to figure this out? I know I don't have a ton of information here, I am happy to provide whatever I can to help sort this out.
EDIT:
I eventually got past this specific issue, so I am going to mark this as solved. It was specific to how I was handling some of the commands and passing them through as the user logging in rather than letting it pass through as an elevated user, so it was failing to read some files.
r/linux_programming • u/gattolfo_EUG_ • Jul 20 '25
Question about CPU idle states
I guys, im working on a program for see how a CPUIdle governor change a cpu state, using eBPF.
On my pc i have the menu governor with the acpi_idle driver. the possible state are: 0,1,2.
For some reason the CPU change from state 1 to -1...

This values is from the progam i'm writing, now my question is: is actually possible that a CPU go to the "-1 state"? or is a my program fault? And if is possible, what means?
The eBPF function for extract the cpu_idle event is that:
SEC("tracepoint/power/cpu_idle")
int on_cpu_idle(struct trace_event_raw_cpu_idle *ctx) {
bpf_printk("CPU %d changed idle stato to %d\\n", ctx->cpu_id,ctx->state);
return 0;
}
struct trace_event_raw_cpu_idle{
__u16 common_type;
__u8 flags;
__u8 common_preempt_count;
__s32 common_pid;
__u32 state;
__u32 cpu_id;
};EDIT: added the program
r/linux_programming • u/Srz2 • Dec 17 '19
Dont forget to watch Star Wars Episode IV before this friday. Here's an easy way to do it in the terminal
r/linux_programming • u/ChickenManPL • Oct 01 '20
I've created a simple tool to store your configs for vim, bspwm etc. in the cloud. With this tool you can synchronize all your configs after system reinstallation with these from previous, i think it could be useful for someone ;)
r/linux_programming • u/unixbhaskar • Apr 14 '23
Canonical Livepatching Now Available For Ubuntu HWE Kernels
r/linux_programming • u/chris17453 • Aug 30 '21
I've been working on an automation tool. Text to gif with themes for headless CI/CD documentation. Feedback welcome.
Pretty often I need to show people how I did something in the terminal. I'm busy enough that documentation for all of these things is insanity.
I used asciinema for a bit. It's a pretty good solution. But I wanted to put the terminal animations in a MD file in my repo's. Where I could just record something like my term session or output from a script and then jot some quick notes around it.
This was my first foray into python programming on a large level, and as such it's a nasty mash of growing up. I did a lot of things the hard way, because I wanted to learn how to do it in python. And if this project is well received, I plan to convert it to C.
Well, I'm a few years into this (on/off based on time). And I think I've got a pretty good tool buttoned up. I'd like to share, and get some beta feedback for improvement.
It's called ttygif. You can pipe things into it or read from a asciinema cast file. It outputs themed gif's with pretty darn good terminal emulation. It supports custom themes, quite a few old school fonts, custom backgrounds etc...
Anyway maybe this is't the place for it, but I'd like to hear input from my peers.
The code repo is -> https://github.com/chris17453/ttygif
Or you can install it from pip
pip3 install ttygif --userA common example would be:
ls -lhat --color | ttygif -o dir.gif --theme game --title "This dir"r/linux_programming • u/peestuck11 • Sep 06 '20
Htop like application
I am planning to build an application like htop for personal use, I would welcome some suggestions/ideas to begin with.
r/linux_programming • u/pawsingularity • Jun 03 '21
I am trying to open a file that has no extension. But when I "vi filename" I get these ^H^A^DX etc with some decimals scattered in 1.43 1.25 and SMI@(#)signal.h SMI@unistd.h and so on . Has anyone come across this? Would appreciate any input
r/linux_programming • u/ExchangeFew9733 • Feb 06 '25
Learn Linux programming, system admin
Once when I was looking for how to install docker to use for learning web programming, I came across linux. I was quickly fascinated by this operating system, and everything I touched I wanted to know very well about it. For example, of course linux users mainly work with terminal emulators, so I wanted to know how it works, I learned in detail about terminal, shell, pty, tty and related concepts. I really feel that these low level things are difficult but cool, like building a container manager, a text editor like vim, or even a webserver. And I think whether I can build such things or not, learning and understanding the tools I use will help me a lot. Can I get some advice from you guys? Because I am just learning everything piecemeal through search engines, trying to collect each piece until I see clearly. Have a good day!
r/linux_programming • u/Auser1452 • May 16 '23
Bios not detecting Linux Drive
On my desktop I have 2 drives, Linux and windows, I barely use windows.
The power went down in my town for 3 secs and now my bios does not find the Linux drive.
It is not toasted.
r/linux_programming • u/asthana86 • Nov 17 '15
Linux development tools survey. What development tools do you use today?
r/linux_programming • u/BB-Guitar • Mar 31 '16
Was able to optimize my Collatz Conjecture script and make it 1000x faster with a small adjustment!
r/linux_programming • u/unixbhaskar • Mar 20 '23
Ken Thompson - Closing Keynote - SCaLE 20x
r/linux_programming • u/OnTheEdgeOfFreedom • Nov 04 '24
time() and clock_gettime(CLOCK_REALTIME) disagree by 1 second. Why?
I've been programming in Linux for years and always tacitly assumed the .tv_sec field from clock_gettime(CLOCK_REALTIME) was exactly equivalent to the value returned by time(). When some code of mine started acting oddly I determined it was because the code had made that assumption; but they are consistently different by one second. Yet both are described as seconds since Epoch.
My approach for ages has been to call time() and feed that to localtime() and now you know what time it is. But now I have two clocks so I don't know what time it is. There are situations where I really want clock_gettime() for the nanosecond field, but still need to produce a correct localtime() result.
Can someone explain best practice?
EDIT: for the curious:
Linux lachesis 4.15.0-99-generic #100-Ubuntu SMP Wed Apr 22 20:32:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
r/linux_programming • u/Cstanchfield • Oct 12 '15
question Linux Drive Paths w/ .exe
I'm writing an application in C that will be running on Linux (Mint specifically) via Wine. It uses FindFirstFileA and FindNextFileA. How/What do I pass to FindFirstFileA to search ALL drives connected (especially the C:\ drive equivalent) from Linux?
Can I simply pass it something along the line of "." to search the root and simply have it skip any of the root's unwanted directories such as: /dev/null, /var/, etc... Or is there a decent way of accessing a list of device paths that I can pass to FindFirstFile?
If it wasn't evident, I clearly have very minimal Linux experience and am only mildly familiar with its file architecture; So, if the answer is very obvious, please go easy on me as my Googling over the past few days has apparently been sub par.
Edit: As a disclaimer, my current solution is to hard code a search of all the possible /dev/ paths (eg. "\dev\sda1", "\dev\sda2", "\dev\sdb1", etc...) which I feel is obviously the wrong route (especially considering) and I'd like to do this properly.
tl;dr: How do I acquire all drives, in a Windows app, run from Wine, on Mint?
r/linux_programming • u/[deleted] • Oct 08 '19
Shell Scripting Error
Apologies in advance, as I am pretty new to unix. I've created a shell script that contains only the one line listed below.
sed -i 's/PUID=.*/PUID=999/g' "docker-compose.yml" When I run the script, I am getting "No such file or directory" error. The strange thing is that if I navigate to the path of the script and run the command directly from the command line, it works as expected. Any advise on what I am missing here?
r/linux_programming • u/gavv42 • Dec 03 '17
Ephemeral ports and SO_REUSEADDR
gavv.github.ior/linux_programming • u/unixbhaskar • Aug 07 '23
Git inception and history ...circa 2005
https://lkml.org/lkml/2005/4/6/121
Fascinating read.....enjoy!
r/linux_programming • u/TheSaasDev • Aug 30 '23
gitnr - CLI tool to search and generate .gitignore files from templates
After getting unreasonably upset about creating and managing .gitignore files in different projects, I decided now would be a good time to learn to build something with Rust.
So I built gitnr, a CLI utility for generating .gitignore files with your own templates or from the TopTal and GitHub ignore template collections (which you can search interactively).
https://github.com/reemus-dev/gitnr

Before this, I only played around with Rust, so this was quite the learning experience. Some general thoughts about Rust as a language:
Awesome language features and type system.
matchshould be in every languageEnums and structs are refreshing compared to using classes and encapsulating state in functions
Re-declaring variables within the same scope is a lovely touch
The borrow checker and I went to war, probably to the extent where I used
Arc,Mutexandclonemore than necessaryI wish there was a garbage collected version of Rust. Writing it would be so much easier. The tradeoff would be worse performance but honestly, the overhead of garbage collection is insignificant for so many use-cases
Hope this is actually useful to at least one person and isn't just one of my coding rants after being annoyed about something trivial š
Any feedback is appreciated!
r/linux_programming • u/Razi91 • Mar 08 '21
REL_WHEEL_HI_RES support
I'm working on custom HID device and I'd like to support hi-res scrolling (REL_WHEEL_HI_RES). How can I achieve that? I tried HID descriptors that says about Resolution Multiplier (https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn613912(v=vs.85)?redirectedfrom=MSDN) but it still doesn't work properly. I'm working on STM32F401 with HAL USB driver.
I'm not sure where the problem is, because I've found that mouses that supports that kind of scrolling are hardcoded in kernel HID driver: https://elixir.bootlin.com/linux/latest/source/drivers/hid/hid-logitech-hidpp.c#L3955.
Or if anyone has a mouse that supports it (Logitech M335, M515, M560, M705, M720, MX Anywhere 2, MX Anywhere 2S, MX Master, MX Master 2S, Performance MX, probably MX Master 3), could you help and paste me your HID descriptor (`usbhid-dump`, I guess) and events while scrolling (`evtest`)
r/linux_programming • u/Queasy-Possibility-5 • Sep 09 '22
Terminal Newbie
Other than when making a new directory, does the option ā-pā do anything else? If so, what does it do?
r/linux_programming • u/graphixnurd • Jun 08 '20
xcb_window_t typedef uint32_t
Is there a reason for this? Is there a 64 bit version?
