McdeSys: mcde_sys_users/user_add/user_delete (users.c, POSIX getpwent and useradd/userdel), user_set_password and user_set_admin per system (NetBSD: pw_gensalt+crypt for usermod -p, wheel; a group member removed by rewriting the group's line as user.c does, since usermod -G only appends -- measured; Linux: chpasswd on stdin, gpasswd, sudo), mcde_sys_update_check/apply (NetBSD: /etc/makronix/update, RELEASE, sysupgrade, pkg_add -uu; Linux: apt-get). A secret goes through a pipe, never on a command line. Tests: test_sysinfo refuses a bad login and, not as root, adding (PASS on Linux and NetBSD); as root in the NetBSD VM add/admin on/off/password/delete pass and /etc/group is as before. dtsystemsettings: Accounts (list, Add/Delete/Password/Administrator, Unlock... through su -m root in a terminal, password fields show stars), Software Update (running, available, new packages, source, Check Now, Update Now... runs -apply-update as root in a terminal; the check runs after the pane shows: apt took 21 s here). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.3 KiB
C
39 lines
1.3 KiB
C
/*
|
|
* ui.h -- dtsystemsettings: what the panes share (main.c)
|
|
*
|
|
* Copyright (c) 2026 The Makronix project. GNU LGPL 2.0 or later, as CDE.
|
|
*/
|
|
|
|
#ifndef _dtsystemsettings_ui_h
|
|
#define _dtsystemsettings_ui_h
|
|
|
|
#include <X11/Intrinsic.h>
|
|
#include <Xm/Xm.h>
|
|
|
|
extern XtAppContext app;
|
|
|
|
XmRenderTable PaneFont(Widget w, int size, Boolean bold);
|
|
Widget Text(Widget parent, const char *name, const char *text);
|
|
void SetText(Widget w, const char *text);
|
|
Widget Button(Widget parent, const char *label, XtCallbackProc cb,
|
|
XtPointer data);
|
|
Widget PaneButton(Widget parent, const char *label, XtCallbackProc cb,
|
|
XtPointer data);
|
|
Widget Table(Widget parent, const char *const *rows, int n, Widget *values);
|
|
Pixmap Icon(Widget w, const char *file);
|
|
void Spawn(const char *command);
|
|
|
|
/* a message in a small window; ERROR: an error */
|
|
void Message(Widget parent, const char *text, int error);
|
|
/* the command line that runs COMMAND as root in a terminal, after su(1)
|
|
* asked for the password there ("Unlock..."); into BUF */
|
|
void AsRoot(const char *title, const char *command, char *buf, size_t len);
|
|
|
|
/* the panes in accounts.c and update.c */
|
|
Widget MakeAccounts(Widget parent);
|
|
Widget MakeUpdate(Widget parent);
|
|
/* dtsystemsettings -apply-update: what the terminal of "Update Now" runs */
|
|
int ApplyUpdate(void);
|
|
|
|
#endif /* _dtsystemsettings_ui_h */
|