Skip to content

Commit 5394ceb

Browse files
committed
Fix build warnings, update changelog
1 parent 92698cf commit 5394ceb

5 files changed

Lines changed: 44 additions & 33 deletions

File tree

howdy/debian/changelog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
howdy (3.0.0) focal; urgency=medium
2+
3+
* Way too many changes to all list individually, thanks to everyone who contributed!
4+
* Rewrote PAM handling logic in C++ (thanks @saidsay-so!)
5+
* Added simultaneous face recognition and password authentication
6+
* Added native dialog dismissal after successful authentication
7+
* Added configurable image rotation (thanks @matan-arnon!)
8+
* Fixed four config options whose names were opposite of their function
9+
10+
-- boltgolt <boltgolt@gmail.com> Sun, 22 Jun 2025 11:52:44 +0200
11+
112
howdy (2.6.1) xenial; urgency=medium
213

314
* Fixed accidentally using emergency priority for log messages (thanks @kageurufu and many others!)

howdy/debian/postinst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ handleStatus(sc(cmd))
128128
DLIB_DIR = None
129129
# A regex of all files to ignore while unpacking the archive
130130
excludes = re.compile(
131-
"davisking-dlib-\w+/(dlib/(http_client|java|matlab|test/)|"
132-
"(docs|examples|python_examples)|"
133-
"tools/(archive|convert_dlib_nets_to_caffe|htmlify|imglab|python/test|visual_studio_natvis))"
131+
r"davisking-dlib-\w+/(dlib/(http_client|java|matlab|test/)|"
132+
r"(docs|examples|python_examples)|"
133+
r"tools/(archive|convert_dlib_nets_to_caffe|htmlify|imglab|python/test|visual_studio_natvis))"
134134
)
135135

136136
# Open the archive
137137
with tarfile.open(dlib_archive) as tf:
138138
for item in tf:
139-
# Set the destenation dir if unset
139+
# Set the destination dir if unset
140140
if not DLIB_DIR:
141141
DLIB_DIR = "/tmp/" + item.name
142142

@@ -159,7 +159,7 @@ except subprocess.CalledProcessError:
159159
print("Error while building dlib")
160160
raise
161161

162-
# Go through each line from stdout
162+
# Go through each line from stdout to check for CUDA usage
163163
while sp.poll() is None:
164164
line = sp.stdout.readline().decode("utf-8")
165165

@@ -178,12 +178,12 @@ print("Temporary dlib files removed")
178178

179179
log("Configuring howdy")
180180

181-
# Manually change the camera id to the one picked
181+
# Make sure to use CNN if dlib was compiled with CUDA support
182182
for line in fileinput.input(["/etc/howdy/config.ini"], inplace=1):
183183
line = line.replace("use_cnn = false", "use_cnn = " + str(cuda_used).lower())
184184
print(line, end="")
185185

186-
print("Camera ID saved")
186+
print("CNN saved to config, CUDA " + ("enabled" if cuda_used else "disabled"))
187187

188188
# Secure the howdy folder
189189
handleStatus(sc(["chmod 755 -R /lib/security/howdy/"], shell=True))

howdy/src/pam/enter_device.cc

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ EnterDevice::EnterDevice()
1515

1616
int err;
1717
struct libevdev_uinput *uinput_dev_ptr;
18-
if ((err = libevdev_uinput_create_from_device(
19-
dev_ptr, LIBEVDEV_UINPUT_OPEN_MANAGED, &uinput_dev_ptr)) != 0) {
20-
throw std::runtime_error(std::string("Failed to create device: ") +
21-
strerror(-err));
18+
19+
err = libevdev_uinput_create_from_device(dev_ptr, LIBEVDEV_UINPUT_OPEN_MANAGED, &uinput_dev_ptr);
20+
if (err != 0) {
21+
throw std::runtime_error(std::string("Failed to create device: ") + strerror(-err));
2222
}
2323

2424
raw_uinput_device.reset(uinput_dev_ptr);
@@ -28,21 +28,18 @@ void EnterDevice::send_enter_press() const {
2828
auto *uinput_dev_ptr = raw_uinput_device.get();
2929

3030
int err;
31-
if ((err = libevdev_uinput_write_event(uinput_dev_ptr, EV_KEY, KEY_ENTER,
32-
1)) != 0) {
33-
throw std::runtime_error(std::string("Failed to write event: ") +
34-
strerror(-err));
31+
err = libevdev_uinput_write_event(uinput_dev_ptr, EV_KEY, KEY_ENTER, 1);
32+
if (err != 0) {
33+
throw std::runtime_error(std::string("Failed to write event: ") + strerror(-err));
3534
}
3635

37-
if ((err = libevdev_uinput_write_event(uinput_dev_ptr, EV_KEY, KEY_ENTER,
38-
0)) != 0) {
39-
throw std::runtime_error(std::string("Failed to write event: ") +
40-
strerror(-err));
36+
err = libevdev_uinput_write_event(uinput_dev_ptr, EV_KEY, KEY_ENTER, 0);
37+
if (err != 0) {
38+
throw std::runtime_error(std::string("Failed to write event: ") + strerror(-err));
4139
}
4240

43-
if ((err = libevdev_uinput_write_event(uinput_dev_ptr, EV_SYN, SYN_REPORT,
44-
0)) != 0) {
45-
throw std::runtime_error(std::string("Failed to write event: ") +
46-
strerror(-err));
47-
};
41+
err = libevdev_uinput_write_event(uinput_dev_ptr, EV_SYN, SYN_REPORT, 0);
42+
if (err != 0) {
43+
throw std::runtime_error(std::string("Failed to write event: ") + strerror(-err));
44+
}
4845
}

howdy/src/pam/main.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ auto check_enabled(const INIReader &config, const char *username) -> int {
190190
* The main function, runs the identification and authentication
191191
* @param pamh The handle to interface directly with PAM
192192
* @param flags Flags passed on to us by PAM, XORed
193-
* @param argc Amount of rules in the PAM config (disregared)
193+
* @param argc Amount of rules in the PAM config (disregarded)
194194
* @param argv Options defined in the PAM config
195195
* @param ask_auth_tok True if we should ask for a password too
196196
* @return Returns a PAM return code
@@ -212,14 +212,15 @@ auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv,
212212

213213
// Get the username from PAM, needed to match correct face model
214214
char *username = nullptr;
215-
if ((pam_res = pam_get_user(pamh, const_cast<const char **>(&username),
216-
nullptr)) != PAM_SUCCESS) {
215+
pam_res = pam_get_user(pamh, const_cast<const char **>(&username), nullptr);
216+
if (pam_res != PAM_SUCCESS) {
217217
syslog(LOG_ERR, "Failed to get username");
218218
return pam_res;
219219
}
220220

221221
// Check if we should continue
222-
if ((pam_res = check_enabled(config, username)) != PAM_SUCCESS) {
222+
pam_res = check_enabled(config, username);
223+
if (pam_res != PAM_SUCCESS) {
223224
return pam_res;
224225
}
225226

@@ -231,7 +232,9 @@ auto identify(pam_handle_t *pamh, int flags, int argc, const char **argv,
231232
const void **conv_ptr =
232233
const_cast<const void **>(reinterpret_cast<void **>(&conv));
233234

234-
if ((pam_res = pam_get_item(pamh, PAM_CONV, conv_ptr)) != PAM_SUCCESS) {
235+
// Retrieve the PAM conversation structure
236+
pam_res = pam_get_item(pamh, PAM_CONV, conv_ptr);
237+
if (pam_res != PAM_SUCCESS) {
235238
syslog(LOG_ERR, "Failed to acquire conversation");
236239
return pam_res;
237240
}

howdy/src/pam/main.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
#include <cstring>
55
#include <string>
66
#include <unistd.h>
7+
#include <cstdint>
78

8-
enum class ConfirmationType { Unset, Howdy, Pam };
9-
10-
enum class Workaround { Off, Input, Native };
9+
enum class ConfirmationType : std::uint8_t { Unset, Howdy, Pam };
10+
enum class Workaround : std::uint8_t { Off, Input, Native };
1111

1212
// Exit status codes returned by the compare process
13-
enum CompareError : int {
13+
enum CompareError : std::uint8_t {
1414
NO_FACE_MODEL = 10,
1515
TIMEOUT_REACHED = 11,
1616
ABORT = 12,

0 commit comments

Comments
 (0)