Comments (6)
Just pushed a fix if you want to give it a go.
from deb-simple.
I looked at the patch, and I don't think that would fix it.
As I mentioned earlier, the string returned by inspectPackageControl
can contain trailing newlines if the pkg control file has trailing newlines. This string gets written directly to the buffer thats being built to output the Packages.gz file. Hence, that file can end up containing things like:
The offending code:
tempCtlData, err := inspectPackage(debPath)
if err != nil {
return err
}
packBuf.WriteString(tempCtlData) // <-- If tempCtlData contains newlines, they get written through
Package: foo
SomeStuff: blahblah
\n
\n <-- !!! these newlines are BAD. they "leak" from tempCtlData
\n
MD5sum: BADBADSUM
SHA1: SUMSUM
\n <-- these newlines are VALID separators
\n
Package: bar
SomeStuff: blahblah
... and so on and so forth...
from deb-simple.
A possible fix is:
@@ -152,7 +157,7 @@ func inspectPackageControl(filename bytes.Buffer) (string, error) {
case tar.TypeReg:
if name == "./control" {
io.Copy(&controlBuf, tarReader)
- return controlBuf.String(), nil
+ return strings.TrimRight(controlBuf.String(), "\n") + "\n", nil
}
from deb-simple.
My bad, I misunderstood what the issue was and thought it was just newlines at the end of the file. Let me play around with your suggestion and see what happens.
It's strange that this is an issue because we're just doing an io.Copy
of the original control file. I wonder why the issue is not seen with other repo solutions? Either way we'll figure it out :)
from deb-simple.
Just merged in #15 if you want to give it a go again...
from deb-simple.
gonna go ahead and close this guy, feel free to re-open it if the previous PR didn't fix your issue.
from deb-simple.
Related Issues (18)
- Look at memory usage HOT 1
- Create additional createPackagesGz() test HOT 1
- Ability to use a directory containing deb pkgs HOT 7
- Mention building of debian packages with `debpkg` HOT 1
- Add support for Let's Encrypt HOT 2
- Access control? HOT 5
- deb-simple API client HOT 7
- Why is there no deb repository for this project? HOT 2
- Where are the binaries? HOT 2
- no Package: header / Problem with MergeList HOT 5
- Usage as CLI tool HOT 2
- Changes from ubuntu 16.04 to 18.04 HOT 8
- Make fsnotify configurable HOT 1
- Illegal option -s
- MAINTAINER WANTED HOT 8
- Update documentation HOT 1
- Add ability to set distro and section
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deb-simple.