当我在root用户下执行时,cupsGetJobs返回'user = unknown''title = untitled',但是普通用户是正确的

时间:2019-05-21 04:58:00

标签: linux arm cups

我想获取杯子作业信息,所以我使用了//model get,set method does not access sqlcmd.Parameters.Add("@ID", SqlDbType.Int).Value = 42; sqlcmd.Parameters.Add("@Name", SqlDbType.VarChar, 100).Value = "Miller"; sqlcmd.Parameters.Add("@City", SqlDbType.VarChar, 100).Value = "London"; sqlcmd.Parameters.Add("@Address", SqlDbType.VarChar, 100).Value = "123 Earl's Court"; sqlcmd.ExecuteNonQuery(); ,但是当我在root shell下执行命令时,它不能返回所有作业信息。但是当我将帐户更改为普通帐户时,结果是正确的。

cupsGetJobs(&pJobList, NULL, 0, CUPS_WHICHJOBS_ALL)

不同用户的执行效果

根帐户

jobNum = cupsGetJobs(&pjobList, NULL, 0, CUPS_WHICHJOBS_ALL);                                                                                           
if (jobNum == 0) {
    return 0;
}

for (i = 0; i<jobNum; i++) {
    printf("--start----------------------------------------------------\n");
    printf("------------id = %d--------------------------------\n", pjobList[i].id);
    printf("------------user = %s------------------------------\n", pjobList[i].user);
    printf("------------title = %s--------------------------------\n", pjobList[i].title);
    printf("------------name = %s------------------------------\n", pjobList[i].dest);
    printf("------------type = %s------------------------------\n", pjobList[i].format);
    printf("--end-----------------------------------------------------\n");
}

长城帐户(所有职位信息均正确)

root@zhhyu-PC:~/test/# ./ipp_test    /* execute demo */
--start----------------------------------------------------
------------id = 19--------------------------------
------------user = unknown------------------------------
------------title = untitled--------------------------------
------------name = HP-LaserJet-Professional-M1213nf-MFP--------------
------------type = application/pdf------------------------------
--end-----------------------------------------------------
--start----------------------------------------------------
------------id = 20--------------------------------
------------user = unknown------------------------------
------------title = untitled--------------------------------
------------name = HP-LaserJet-Professional-M1213nf-MFP--------------
------------type = application/pdf------------------------------
--end-----------------------------------------------------
/* only root job is right */
--start----------------------------------------------------
------------id = 21--------------------------------
------------user = root------------------------------
------------title = debug.sh--------------------------------
------------name = Pantum-P3300DN-series------------------------------
------------type = application/x-shell------------------------------
--end-----------------------------------------------------
--start----------------------------------------------------
------------id = 22--------------------------------
------------user = unknown------------------------------
------------title = untitled--------------------------------
------------name = HP-LaserJet-Professional-M1213nf-MFP--------------
------------type = application/pdf------------------------------
--end-----------------------------------------------------

0 个答案:

没有答案