38 lines
1.5 KiB
Text
38 lines
1.5 KiB
Text
$NetBSD: patch-ad,v 1.4 2010/01/27 18:14:05 joerg Exp $
|
|
|
|
--- src/recommend.c.orig 1999-10-20 04:47:45.000000000 +0000
|
|
+++ src/recommend.c
|
|
@@ -19,7 +19,6 @@ int main(argc,argv)const int argc;const
|
|
{ fprintf(stderr,"Please run this program via 'make recommend'\n");
|
|
return EX_USAGE;
|
|
}
|
|
- strchr(mailspooldir,'\0')[-1]='\0'; /* strip last character */
|
|
for(p=checkf;*p;p++)
|
|
if(!stat(*p,&stbuf)&&stbuf.st_mode&S_ISGID)
|
|
{ if(stbuf.st_mode&S_ISGID)
|
|
@@ -36,19 +35,19 @@ int main(argc,argv)const int argc;const
|
|
}
|
|
if(gid!=stbuf.st_gid)
|
|
sgid=0;
|
|
- printf("chown root %s\n",argv[1]);
|
|
+ printf("chown root ${DESTDIR}%s\n",argv[1]);
|
|
if(sgid)
|
|
if(grp=getgrgid(gid))
|
|
- printf("chgrp %s %s %s\n",grp->gr_name,argv[1],argv[2]);
|
|
+ printf("chgrp %s ${DESTDIR}%s ${DESTDIR}%s\n",grp->gr_name,argv[1],argv[2]);
|
|
else
|
|
- printf("chgrp %u %s %s\n",(unsigned)gid,argv[1],argv[2]);
|
|
- printf("chmod %lo %s\n",(unsigned long)(sgid|S_ISUID|PERMIS),argv[1]);
|
|
+ printf("chgrp %u ${DESTDIR}%s ${DESTDIR}%s\n",(unsigned)gid,argv[1],argv[2]);
|
|
+ printf("chmod %lo ${DESTDIR}%s\n",(unsigned long)(sgid|S_ISUID|PERMIS),argv[1]);
|
|
if(sgid)
|
|
- printf("chmod %lo %s\n",(unsigned long)(sgid|PERMIS),argv[2]);
|
|
+ printf("chmod %lo ${DESTDIR}%s\n",(unsigned long)(sgid|PERMIS),argv[2]);
|
|
else if(chmdir==1)
|
|
goto nogchmod;
|
|
if(chmdir)
|
|
- printf("chmod %c+w %s/.\n",chmdir==1?'g':'a',mailspooldir);
|
|
+ printf("chmod %c+w ${DESTDIR}%s/.\n",chmdir==1?'g':'a',mailspooldir);
|
|
nogchmod:
|
|
return EXIT_SUCCESS;
|
|
}
|