linux - 在 PAM 模块中刷新 printf 语句
问题描述
我编写了一个带有身份验证过程的 PAM 模块,它输出带有时间延迟的状态消息。
int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) {
printf("Welcome to my PAM Module ... authentication\n");
/* doing something which lasts about 30 seconds */
printf("Authentication successfull!\n");
return PAM_SUCCESS;
}
问题是身份验证过程(使用 sshd 测试)在 30 秒内没有输出任何内容。然后两条线同时出现。
Welcome to my PAM Module ... authentication
Authentication successfull!
我需要第一行立即出现,第二行在 30 秒后出现。
亲切的问候
解决方案
推荐阅读
- git - 假设我已经有一个公共回购的公共分叉,我如何将我的回购设为私有,同时保留所有问题和 PR 等?
- javascript - Javascript Ajax 在一个 PHP 页面中提交多个单独的表单(具有相同的表单结构)
- php - 在外部网站上按 ID 显示 WordPress 帖子?
- oracle - 从其他用户导出或导入包
- java - 从另一个类但同一个包的对象创建一个 ArrayList
- php - 针对分组产品类型在单个产品页面上按类别对产品进行分组
- java - 当我从 android:onClick 刷新时出现 Android TCP 错误
- dart - 保存和加载,共享首选项
- php - 如何在不刷新页面的情况下更新 HTML data-* 属性
- amazon-web-services - 手动删除 SAM CloudFormation 堆栈中的函数后未找到函数