don't redefine _PATH_TMP; don't assume it begins "/tmp/";
[unix-history] / usr / src / usr.bin / rdist / server.c
index 2653756..534bf09 100644 (file)
@@ -2,21 +2,11 @@
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)server.c   5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)server.c   5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "defs.h"
 #endif /* not lint */
 
 #include "defs.h"
@@ -662,7 +652,7 @@ recvf(cmd, type)
        struct timeval tvp[2];
        char *owner, *group;
        char new[BUFSIZ];
        struct timeval tvp[2];
        char *owner, *group;
        char new[BUFSIZ];
-       extern char *tmpname;
+       extern char *tempname;
 
        cp = cmd;
        opts = 0;
 
        cp = cmd;
        opts = 0;
@@ -757,12 +747,12 @@ recvf(cmd, type)
                (void) sprintf(tp, "/%s", cp);
        cp = rindex(target, '/');
        if (cp == NULL)
                (void) sprintf(tp, "/%s", cp);
        cp = rindex(target, '/');
        if (cp == NULL)
-               strcpy(new, tmpname);
+               strcpy(new, tempname);
        else if (cp == target)
        else if (cp == target)
-               (void) sprintf(new, "/%s", tmpname);
+               (void) sprintf(new, "/%s", tempname);
        else {
                *cp = '\0';
        else {
                *cp = '\0';
-               (void) sprintf(new, "%s/%s", target, tmpname);
+               (void) sprintf(new, "%s/%s", target, tempname);
                *cp = '/';
        }
 
                *cp = '/';
        }
 
@@ -1473,7 +1463,7 @@ response()
  */
 cleanup()
 {
  */
 cleanup()
 {
-       (void) unlink(tmpfile);
+       (void) unlink(tempfile);
        exit(1);
 }
 
        exit(1);
 }