Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Aug 1998 20:07:22 +0200 (CEST)
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        freebsd-questions@FreeBSD.ORG, freebsd-stable@FreeBSD.ORG
Subject:   Found reason why lpr -r -s doesn't work as expected
Message-ID:  <199808141807.UAA13224@internal>

next in thread | raw e-mail | index | archive | help
While trying to find out why the temporay files made by samba for
printing aren't removed, I found that this is due to the following
code in usr.sbin/lpr/lpd/printjob.c:

                case 'U':
                        if (strchr(line+1, '/'))
                                continue;
                        (void) unlink(line+1);

and


        fseek(cfp, 0L, 0);
        while (getline(cfp))
                if (line[0] == 'U' && !strchr(line+1, '/'))
                        (void) unlink(line+1);  


This disables the removement of files starting with '/'. This was
introduced in version 1.14 according to the CVS log. However, I didn't
find an explanation  why this change was made. Is it a security hole?

If this behaviour is considered, maybe we should not in the manual page
that 'lpr -s -r' only removes the symlink and is equal to 'lpr -s'...

What do you think?

Thanks,

	-Andre

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808141807.UAA13224>