SULDR Forums Supported Printers Printing Questions Scanning Questions General Questions Samsung Installer

Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Diego

#1
Quote from: b1b1 on September 23, 2012, 10:49:04
Quote from: Diego on September 03, 2012, 07:54:13
I would use mktemp instead of a hardcoded file name. This way two print jobs can be sent at the same time without messing.

It's not hardcoded. It appends $$ (the shell's PID) to create a unique filename. mktemp may be useful though, if you are concerned about malicious users mounting a timing attack on the filename.

A better solution would be to avoid a temporary file, buffer the output header in memory, then write when the rest of the data starts flowing. Maybe dd could do this, or maybe a little Python script...

Sorry on my mistake. My bash scripting abilities are somewhat rusty. Reading bash man page again is in my to-do list.
#2
Sorry, whitespaces in wrong place: now fixed.



#!/bin/bash
TMPFILE=`mktemp` || exit 1
`dirname $0`/rastertosamsungspl.orig "$@" > $TMPFILE
cat $TMPFILE
rm $TMPFILE
#3
I would use mktemp instead of a hardcoded file name. This way two print jobs can be sent at the same time without messing.


#!/bin/bash
TMPFILE = `mktemp` || exit 1
`dirname $0`/rastertosamsungspl.orig "$@" > $TMPFILE
cat $TMPFILE
rm $TMPFILE


Repository Information Legal Contact Alternative Drivers