]> arthur.barton.de Git - netatalk.git/commitdiff
Fix papd so it will spool to a BSD lpr queue and change the owner of the file to...
authormorgana <morgana>
Tue, 8 Aug 2000 05:19:19 +0000 (05:19 +0000)
committermorgana <morgana>
Tue, 8 Aug 2000 05:19:19 +0000 (05:19 +0000)
Also added a fix for server messaging in afpd.  Wrong member of structure accessed for dsi info.

etc/afpd/afp_dsi.c
etc/papd/lp.c

index a0624ec51bf0b89ad41b79af8ede33df35461927..d282fe1a608d923101fd0bce8a53202295ed484a 100644 (file)
@@ -101,7 +101,7 @@ static void afp_dsi_timedown()
 static void afp_dsi_getmesg (void)
 {
       readmessage();
-      dsi_attention(child.dsi, AFPATTN_MESG | AFPATTN_TIME(5));
+      dsi_attention(child.obj->handle, AFPATTN_MESG | AFPATTN_TIME(5));
 }
 #endif
 
index fbfc2be916fa2756c7921e0746f45dfb6d77a7d4..1de9a4e0c1d3c97aa6eb6b7dd051d30a7e7a2f8b 100644 (file)
@@ -354,6 +354,27 @@ lp_open( out, sat )
            spoolerror( out, NULL );
            return( -1 );
        }
+
+       if (lp.lp_person != NULL) {
+           if ((pwent = getpwnam(lp.lp_person)) == NULL) {
+               syslog(LOG_ERR, "getpwnam %s: no such user", lp.lp_person);
+               spoolerror( out, NULL );
+               return( -1 );
+           }
+       } else {
+           if ((pwent = getpwnam(printer->p_operator)) == NULL) {
+               syslog(LOG_ERR, "getpwnam %s: no such user", printer->p_operator);
+               spoolerror( out, NULL );
+               return( -1 );
+           }
+       }
+
+       if (fchown(fd, pwent->pw_uid, -1) < 0) {
+           syslog(LOG_ERR, "chown %s %s: %m", pwent->pw_name, name);
+           spoolerror( out, NULL );
+           return( -1 );
+       }
+
        if (( lp.lp_stream = fdopen( fd, "w" )) == NULL ) {
            syslog( LOG_ERR, "lp_open fdopen: %m" );
            spoolerror( out, NULL );