On Sun, 23 Sep 2012, Marcin Cieslak wrote:

> I am working on dtprintinfo now -
> "dtprintinfo -populate" does not create
> any printer actions, despite the fact that
> it finds the printes via CUPS.
>
> Here's the output of the preprocessing stage
> of programs/dtprintinfo/UI/DtPrinterIcon.C
>
>    if (stat(filename, &statbuff) < 0 || statbuff.st_size == 0)
>         create_file = 0;
>      else
>         create_file = 0;
>    }
>
> and later:
>
> if (create_file)
>    {
>      if (fp = fopen(filename, "w"))
>
> Even changing those lines of objects/BaseObj.h does not help:
>
> #elif defined(linux) || defined(CSRG_BASED)
>  #define false 0
>  #define true 0
>  #define boolean int
> #else
>
> Strange, isn't it?
>

Looks f'ing stupid to me, but what do I know :)  I haven't even looked
at the ancillary dtprint stuff yet.  At XiG, I created a 'dtlp' ksh
shell script that worried about the details of a given system's lp
implementation (old-style, LPNG, CUPS, etc) and had dtprintinfo and
friends just use that instead, with well defined options.

Ie: instead of:
  sprintf(command, "lprm -P%s %s", me->Parent()->Name(),  me->_jobNumber);

you would use:
  sprintf(command, "/usr/dt/bin/dtlpc lprm -P%s %s", me->Parent()->Name(), 
me->_jobNumber);

note - the first one is a security hole waiting to happen anyway
(calling lprm without a full path).

Might want to consider something similiar moving forward.

-- 
Jon Trulson

The Higgs Field is what make atoms matter.
                 -- Tom L.



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to