]> arthur.barton.de Git - netatalk.git/commitdiff
papd lp_init, fatal error if we can't getpwnam() or setruid
authordidg <didg>
Sun, 1 Feb 2009 18:55:37 +0000 (18:55 +0000)
committerdidg <didg>
Sun, 1 Feb 2009 18:55:37 +0000 (18:55 +0000)
etc/papd/lp.c
etc/papd/lp.h

index 5f19a1a00b6a4dddcb3fa52b064097eab72f9c41..81f2cbb87ee79f62479d8b374ce687b0956581a7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: lp.c,v 1.23 2009-02-01 18:00:41 didg Exp $
+ * $Id: lp.c,v 1.24 2009-02-01 18:55:37 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -375,7 +375,7 @@ void lp_for ( lpfor )
 }
 
 
-int lp_init( out, sat )
+static int lp_init( out, sat )
     struct papfile     *out;
     struct sockaddr_at *sat;
 {
@@ -571,10 +571,12 @@ int lp_open( out, sat )
        if (lp.lp_person != NULL) {
            if((pwent = getpwnam(lp.lp_person)) != NULL) {
                if(setreuid(pwent->pw_uid, pwent->pw_uid) != 0) {
-                   LOG(log_info, logtype_papd, "setreuid error: %s", strerror(errno));
+                   LOG(log_error, logtype_papd, "setreuid error: %s", strerror(errno));
+                   exit(1);
                }
            } else {
-               LOG(log_info, logtype_papd, "Error getting username (%s)", lp.lp_person);
+               LOG(log_error, logtype_papd, "Error getting username (%s)", lp.lp_person);
+                exit(1);
            }
        }
 
index 30a53074a2b6addd154537b647517f919447672f..d4ab8423a854c2cd79d81fe186dd79c27aded950 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: lp.h,v 1.4 2005-04-28 20:49:49 bfernhomberg Exp $
+ * $Id: lp.h,v 1.5 2009-02-01 18:55:37 didg Exp $
  */
 
 #ifndef PAPD_LP_H
@@ -18,8 +18,6 @@ void lp_origin __P(( int ));
 int lp_rmjob __P(( int ));
 int lp_queue __P(( struct papfile * ));
 
-/* initialize printing interface */
-int lp_init __P(( struct papfile *, struct sockaddr_at * ));
 /* cancel current job */
 int lp_cancel __P(( void ));
 /* print current job */