Uses standard Unix setuid
to change the current process user id and executes the parameters passed.
On other platforms, this usually requires root
authority, but on IBM i we just need *USE
authority
to the user profile. :)
gcc -o sudo sudo.c
#!/QOpenSys/pkgs/bin/bash | |
MBRPATH=/qsys.lib/qsysinc.lib/h.file/stdio.mbr | |
RCDLEN=80 # default, use whatever was specified on CRTSRCPF | |
CCSID=037 # needs leading zeros if less than 3 digits | |
OUTFILE=stdio.h | |
# What it does: | |
# 1. Convert the member "stream of bytes" to UTF-8 |
from ctypes import c_char, c_int, c_uint, c_int16, c_uint16, \ | |
c_size_t, c_ulonglong, c_void_p, c_char_p, \ | |
addressof, sizeof, create_string_buffer, \ | |
CDLL, DEFAULT_MODE, POINTER, Structure | |
import unicodedata | |
RTLD_MEMBER = 0x00040000 | |
gcc -std=c99 -o pase-signal-msgid pase-signal-msgid.c && ./pase-signal-msgid
Example output:
ptr: ffffffffffffba1
----- in handler -----
msgid = MCH0602
If PHP tests fail with
[IBM][CLI Driver][AS] SQL0805N Package "NULLID.SYSSH000" was not found. SQLSTATE=51002 SQLCODE=-805
You'll need to set up the DB2 Connect SQL packages by "binding" them.
From the clidriver directory
🚨 This gist is obsolete 🚨
This was a way to easily set up a few certificates for GitHub, BitBucket, etc for use with git. It's largely irrelevant nowadays with the advent of ca-certificates being availabe.
Instead, just yum install ca-certificates-mozilla
. This installs the Mozilla CA trust store (the same used
by Firefox and many other open source projects), as well as the ca-certificates infrastructure. ca-certificates
will generate the format needed by OpenSSL (and Java, too!).
For some reason I'm getting CPF3C1D when calling the API and I don't know why.
The API is defined here and the structure is defined here.
The last field of the structure is at offset 570 and is 512 bytes, which means the whole structure is 1082, which is what we're passing. It says that we need to pass 1 more byte, but I have no idea why or what it should be.
Also: the lib
option to iSrvPgm
does not work...
Update: I added a 2 byte dummy field to make it greater than 1083 bytes long and now get: "A value in the instance data at decimal offset 28 is not valid"
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2017 IBM Corp. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |